* Re: about s3c2442
2013-01-10 15:07 about s3c2442 Yi Qingliang
@ 2013-01-10 8:36 ` Juergen Beisert
2013-01-10 9:08 ` Yi Qingliang
0 siblings, 1 reply; 9+ messages in thread
From: Juergen Beisert @ 2013-01-10 8:36 UTC (permalink / raw)
To: barebox
Hi Yi,
Yi Qingliang wrote:
> I'm using barebox (based on mini2440) on my s3c2442 board,
> 1. flash barebox into nand: can't start normally, but can see early output
> on serial.
> 2. load it in sdram: can start normally into shell, and then I use it to
> boot kernel (also in sdram, also based on mini2440).
> the kernel hang, no output.
>
> after dig into it, I found something: add "mem=64M" into the kernel
> paramer, then the kernel can start.
>
> BUT:
> the barebox doesn't pass that paramert to kernel for mini2440,
> why the mini2440 kernel can start normally?
>
> how does the kernel on 2440 get the sdram size?
There is no autodetection possible. Take a look into
the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This is the code
which runs immediately after reset. It calls the
function "s3c24x0_sdram_init" from the generic part, and uses hard coded
values from "arch/arm/boards/friendlyarm-mini2440/config.h" to setup the
SDRAM controller according to the attached SDRAM type.
When the SDRAM is up and running, it is very easy to read back the SDRAM size
from the SDRAM controller's registers (which is done in the
function "s3c24xx_get_memory_size").
So you need routines which do the same job for your S3C2442 CPU.
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: about s3c2442
2013-01-10 8:36 ` Juergen Beisert
@ 2013-01-10 9:08 ` Yi Qingliang
2013-01-10 9:14 ` Juergen Beisert
0 siblings, 1 reply; 9+ messages in thread
From: Yi Qingliang @ 2013-01-10 9:08 UTC (permalink / raw)
To: Juergen Beisert; +Cc: barebox
On Thursday, January 10, 2013 09:36:36 AM Juergen Beisert wrote:
> Hi Yi,
>
> Yi Qingliang wrote:
> > I'm using barebox (based on mini2440) on my s3c2442 board,
> >
> > 1. flash barebox into nand: can't start normally, but can see early output
> > on serial.
> > 2. load it in sdram: can start normally into shell, and then I use it to
> > boot kernel (also in sdram, also based on mini2440).
> > the kernel hang, no output.
> >
> > after dig into it, I found something: add "mem=64M" into the kernel
> > paramer, then the kernel can start.
> >
> > BUT:
> > the barebox doesn't pass that paramert to kernel for mini2440,
> > why the mini2440 kernel can start normally?
> >
> > how does the kernel on 2440 get the sdram size?
>
> There is no autodetection possible. Take a look into
> the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This is the code
> which runs immediately after reset. It calls the
> function "s3c24x0_sdram_init" from the generic part, and uses hard coded
> values from "arch/arm/boards/friendlyarm-mini2440/config.h" to setup the
> SDRAM controller according to the attached SDRAM type.
> When the SDRAM is up and running, it is very easy to read back the SDRAM
> size from the SDRAM controller's registers (which is done in the
> function "s3c24xx_get_memory_size").
>
> So you need routines which do the same job for your S3C2442 CPU.
and the kernel? how does the kernel know the sdram size for mini2440?
read the cpu register set by barebox?
>
> Regards,
> Juergen
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: about s3c2442
2013-01-10 9:08 ` Yi Qingliang
@ 2013-01-10 9:14 ` Juergen Beisert
2013-01-10 17:45 ` Yi Qingliang
2013-01-10 17:54 ` Yi Qingliang
0 siblings, 2 replies; 9+ messages in thread
From: Juergen Beisert @ 2013-01-10 9:14 UTC (permalink / raw)
To: barebox
Hi Yi,
Yi Qingliang wrote:
> On Thursday, January 10, 2013 09:36:36 AM Juergen Beisert wrote:
> > Yi Qingliang wrote:
> > > I'm using barebox (based on mini2440) on my s3c2442 board,
> > >
> > > 1. flash barebox into nand: can't start normally, but can see early
> > > output on serial.
> > > 2. load it in sdram: can start normally into shell, and then I use it
> > > to boot kernel (also in sdram, also based on mini2440).
> > > the kernel hang, no output.
> > >
> > > after dig into it, I found something: add "mem=64M" into the kernel
> > > paramer, then the kernel can start.
> > >
> > > BUT:
> > > the barebox doesn't pass that paramert to kernel for mini2440,
> > > why the mini2440 kernel can start normally?
> > >
> > > how does the kernel on 2440 get the sdram size?
> >
> > There is no autodetection possible. Take a look into
> > the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This is the
> > code which runs immediately after reset. It calls the
> > function "s3c24x0_sdram_init" from the generic part, and uses hard coded
> > values from "arch/arm/boards/friendlyarm-mini2440/config.h" to setup the
> > SDRAM controller according to the attached SDRAM type.
> > When the SDRAM is up and running, it is very easy to read back the SDRAM
> > size from the SDRAM controller's registers (which is done in the
> > function "s3c24xx_get_memory_size").
> >
> > So you need routines which do the same job for your S3C2442 CPU.
>
> and the kernel? how does the kernel know the sdram size for mini2440?
> read the cpu register set by barebox?
No. The bootloader forwards this information to the kernel as an ATAG or via
device tree. But this can only work, if also the bootloader knows the correct
SDRAM size!
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: about s3c2442
2013-01-10 17:45 ` Yi Qingliang
@ 2013-01-10 10:00 ` Juergen Beisert
2013-01-10 19:14 ` Yi Qingliang
0 siblings, 1 reply; 9+ messages in thread
From: Juergen Beisert @ 2013-01-10 10:00 UTC (permalink / raw)
To: barebox
Hi Yi,
Yi Qingliang wrote:
> On Thursday, January 10, 2013 10:14:07 AM Juergen Beisert wrote:
> > Yi Qingliang wrote:
> > > On Thursday, January 10, 2013 09:36:36 AM Juergen Beisert wrote:
> > > > Yi Qingliang wrote:
> > > > > I'm using barebox (based on mini2440) on my s3c2442 board,
> > > > >
> > > > > 1. flash barebox into nand: can't start normally, but can see early
> > > > > output on serial.
> > > > > 2. load it in sdram: can start normally into shell, and then I use
> > > > > it to boot kernel (also in sdram, also based on mini2440).
> > > > > the kernel hang, no output.
> > > > >
> > > > > after dig into it, I found something: add "mem=64M" into the kernel
> > > > > paramer, then the kernel can start.
> > > > >
> > > > > BUT:
> > > > > the barebox doesn't pass that paramert to kernel for mini2440,
> > > > > why the mini2440 kernel can start normally?
> > > > >
> > > > > how does the kernel on 2440 get the sdram size?
> > > >
> > > > There is no autodetection possible. Take a look into
> > > > the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This is
> > > > the
>
> I found it,
> but:
> md 0x48000028
> 48000028: 000000b2 (represents is 128)
> it looks like the lowlevel_init is not executed, what's the problem.
Is the symbol "CONFIG_MACH_DO_LOWLEVEL_INIT" enabled in your config?
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: about s3c2442
2013-01-10 19:14 ` Yi Qingliang
@ 2013-01-10 11:20 ` Juergen Beisert
0 siblings, 0 replies; 9+ messages in thread
From: Juergen Beisert @ 2013-01-10 11:20 UTC (permalink / raw)
To: barebox
Hi Yi,
Yi Qingliang wrote:
> On Thursday, January 10, 2013 11:00:53 AM Juergen Beisert wrote:
> > Yi Qingliang wrote:
> > > On Thursday, January 10, 2013 10:14:07 AM Juergen Beisert wrote:
> > > > Yi Qingliang wrote:
> > > > > On Thursday, January 10, 2013 09:36:36 AM Juergen Beisert wrote:
> > > > > > Yi Qingliang wrote:
> > > > > > > I'm using barebox (based on mini2440) on my s3c2442 board,
> > > > > > >
> > > > > > > 1. flash barebox into nand: can't start normally, but can see
> > > > > > > early
> > > > > > > output on serial.
> > > > > > > 2. load it in sdram: can start normally into shell, and then I
> > > > > > > use it to boot kernel (also in sdram, also based on mini2440).
> > > > > > > the kernel hang, no output.
> > > > > > >
> > > > > > > after dig into it, I found something: add "mem=64M" into the
> > > > > > > kernel
> > > > > > > paramer, then the kernel can start.
> > > > > > >
> > > > > > > BUT:
> > > > > > > the barebox doesn't pass that paramert to kernel for mini2440,
> > > > > > > why the mini2440 kernel can start normally?
> > > > > > >
> > > > > > > how does the kernel on 2440 get the sdram size?
> > > > > >
> > > > > > There is no autodetection possible. Take a look into
> > > > > > the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This
> > > > > > is the
> > >
> > > I found it,
> > > but:
> > > md 0x48000028
> > > 48000028: 000000b2 (represents is 128)
> > > it looks like the lowlevel_init is not executed, what's the problem.
> >
> > Is the symbol "CONFIG_MACH_DO_LOWLEVEL_INIT" enabled in your config?
>
> enabled already, but when loaded in sdram, the barebox skipped the sdram
> init code. am i right?
Yes, you are right. It must skip the initialization, because the code itself
runs already from SDRAM. When you would stop the SDRAM controller in this
case it would crash your machine.
You must ensure your routines can detect the case where they already run from
the SDRAM area (I do not know the details how the S3C2440 and S34C2443
differ).
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* about s3c2442
@ 2013-01-10 15:07 Yi Qingliang
2013-01-10 8:36 ` Juergen Beisert
0 siblings, 1 reply; 9+ messages in thread
From: Yi Qingliang @ 2013-01-10 15:07 UTC (permalink / raw)
To: barebox
Hello,
I'm using barebox (based on mini2440) on my s3c2442 board,
1. flash barebox into nand: can't start normally, but can see early output on
serial.
2. load it in sdram: can start normally into shell, and then I use it to boot
kernel (also in sdram, also based on mini2440).
the kernel hang, no output.
after dig into it, I found something: add "mem=64M" into the kernel paramer,
then the kernel can start.
BUT:
the barebox doesn't pass that paramert to kernel for mini2440,
why the mini2440 kernel can start normally?
how does the kernel on 2440 get the sdram size?
THANKS!
Nanjing Jilong
Yi Qingliang
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: about s3c2442
2013-01-10 9:14 ` Juergen Beisert
@ 2013-01-10 17:45 ` Yi Qingliang
2013-01-10 10:00 ` Juergen Beisert
2013-01-10 17:54 ` Yi Qingliang
1 sibling, 1 reply; 9+ messages in thread
From: Yi Qingliang @ 2013-01-10 17:45 UTC (permalink / raw)
To: Juergen Beisert; +Cc: barebox
On Thursday, January 10, 2013 10:14:07 AM Juergen Beisert wrote:
> Hi Yi,
>
> Yi Qingliang wrote:
> > On Thursday, January 10, 2013 09:36:36 AM Juergen Beisert wrote:
> > > Yi Qingliang wrote:
> > > > I'm using barebox (based on mini2440) on my s3c2442 board,
> > > >
> > > > 1. flash barebox into nand: can't start normally, but can see early
> > > > output on serial.
> > > > 2. load it in sdram: can start normally into shell, and then I use it
> > > > to boot kernel (also in sdram, also based on mini2440).
> > > > the kernel hang, no output.
> > > >
> > > > after dig into it, I found something: add "mem=64M" into the kernel
> > > > paramer, then the kernel can start.
> > > >
> > > > BUT:
> > > > the barebox doesn't pass that paramert to kernel for mini2440,
> > > > why the mini2440 kernel can start normally?
> > > >
> > > > how does the kernel on 2440 get the sdram size?
> > >
> > > There is no autodetection possible. Take a look into
> > > the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This is the
I found it,
but:
md 0x48000028
48000028: 000000b2 (represents is 128)
it looks like the lowlevel_init is not executed, what's the problem.
> > > code which runs immediately after reset. It calls the
> > > function "s3c24x0_sdram_init" from the generic part, and uses hard coded
> > > values from "arch/arm/boards/friendlyarm-mini2440/config.h" to setup the
> > > SDRAM controller according to the attached SDRAM type.
> > > When the SDRAM is up and running, it is very easy to read back the SDRAM
> > > size from the SDRAM controller's registers (which is done in the
> > > function "s3c24xx_get_memory_size").
> > >
> > > So you need routines which do the same job for your S3C2442 CPU.
> >
> > and the kernel? how does the kernel know the sdram size for mini2440?
> > read the cpu register set by barebox?
>
> No. The bootloader forwards this information to the kernel as an ATAG or via
> device tree. But this can only work, if also the bootloader knows the
> correct SDRAM size!
>
> Regards,
> Juergen
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: about s3c2442
2013-01-10 9:14 ` Juergen Beisert
2013-01-10 17:45 ` Yi Qingliang
@ 2013-01-10 17:54 ` Yi Qingliang
1 sibling, 0 replies; 9+ messages in thread
From: Yi Qingliang @ 2013-01-10 17:54 UTC (permalink / raw)
To: Juergen Beisert; +Cc: barebox
I got it:
CONFIG_S3C_SDRAM_INIT
This adds generic code to configure the SDRAM controller after reset.
The initialisation will be skipped if the code is already running
from SDRAM.
the low level skipped?
On Thursday, January 10, 2013 10:14:07 AM Juergen Beisert wrote:
> Hi Yi,
>
> Yi Qingliang wrote:
> > On Thursday, January 10, 2013 09:36:36 AM Juergen Beisert wrote:
> > > Yi Qingliang wrote:
> > > > I'm using barebox (based on mini2440) on my s3c2442 board,
> > > >
> > > > 1. flash barebox into nand: can't start normally, but can see early
> > > > output on serial.
> > > > 2. load it in sdram: can start normally into shell, and then I use it
> > > > to boot kernel (also in sdram, also based on mini2440).
> > > > the kernel hang, no output.
> > > >
> > > > after dig into it, I found something: add "mem=64M" into the kernel
> > > > paramer, then the kernel can start.
> > > >
> > > > BUT:
> > > > the barebox doesn't pass that paramert to kernel for mini2440,
> > > > why the mini2440 kernel can start normally?
> > > >
> > > > how does the kernel on 2440 get the sdram size?
> > >
> > > There is no autodetection possible. Take a look into
> > > the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This is the
> > > code which runs immediately after reset. It calls the
> > > function "s3c24x0_sdram_init" from the generic part, and uses hard coded
> > > values from "arch/arm/boards/friendlyarm-mini2440/config.h" to setup the
> > > SDRAM controller according to the attached SDRAM type.
> > > When the SDRAM is up and running, it is very easy to read back the SDRAM
> > > size from the SDRAM controller's registers (which is done in the
> > > function "s3c24xx_get_memory_size").
> > >
> > > So you need routines which do the same job for your S3C2442 CPU.
> >
> > and the kernel? how does the kernel know the sdram size for mini2440?
> > read the cpu register set by barebox?
>
> No. The bootloader forwards this information to the kernel as an ATAG or via
> device tree. But this can only work, if also the bootloader knows the
> correct SDRAM size!
>
> Regards,
> Juergen
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: about s3c2442
2013-01-10 10:00 ` Juergen Beisert
@ 2013-01-10 19:14 ` Yi Qingliang
2013-01-10 11:20 ` Juergen Beisert
0 siblings, 1 reply; 9+ messages in thread
From: Yi Qingliang @ 2013-01-10 19:14 UTC (permalink / raw)
To: Juergen Beisert; +Cc: barebox
On Thursday, January 10, 2013 11:00:53 AM Juergen Beisert wrote:
> Hi Yi,
>
> Yi Qingliang wrote:
> > On Thursday, January 10, 2013 10:14:07 AM Juergen Beisert wrote:
> > > Yi Qingliang wrote:
> > > > On Thursday, January 10, 2013 09:36:36 AM Juergen Beisert wrote:
> > > > > Yi Qingliang wrote:
> > > > > > I'm using barebox (based on mini2440) on my s3c2442 board,
> > > > > >
> > > > > > 1. flash barebox into nand: can't start normally, but can see
> > > > > > early
> > > > > > output on serial.
> > > > > > 2. load it in sdram: can start normally into shell, and then I use
> > > > > > it to boot kernel (also in sdram, also based on mini2440).
> > > > > > the kernel hang, no output.
> > > > > >
> > > > > > after dig into it, I found something: add "mem=64M" into the
> > > > > > kernel
> > > > > > paramer, then the kernel can start.
> > > > > >
> > > > > > BUT:
> > > > > > the barebox doesn't pass that paramert to kernel for mini2440,
> > > > > > why the mini2440 kernel can start normally?
> > > > > >
> > > > > > how does the kernel on 2440 get the sdram size?
> > > > >
> > > > > There is no autodetection possible. Take a look into
> > > > > the "arch/arm/boards/friendlyarm-mini2440/lowlevel_init.S": This is
> > > > > the
> >
> > I found it,
> > but:
> > md 0x48000028
> > 48000028: 000000b2 (represents is 128)
> > it looks like the lowlevel_init is not executed, what's the problem.
>
> Is the symbol "CONFIG_MACH_DO_LOWLEVEL_INIT" enabled in your config?
enabled already, but when loaded in sdram, the barebox skipped the sdram init
code. am i right?
>
> Regards,
> Juergen
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-01-10 11:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-10 15:07 about s3c2442 Yi Qingliang
2013-01-10 8:36 ` Juergen Beisert
2013-01-10 9:08 ` Yi Qingliang
2013-01-10 9:14 ` Juergen Beisert
2013-01-10 17:45 ` Yi Qingliang
2013-01-10 10:00 ` Juergen Beisert
2013-01-10 19:14 ` Yi Qingliang
2013-01-10 11:20 ` Juergen Beisert
2013-01-10 17:54 ` Yi Qingliang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox