mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* am335x questions
@ 2016-05-26 13:41 Yegor Yefremov
  2016-05-26 14:44 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Yegor Yefremov @ 2016-05-26 13:41 UTC (permalink / raw)
  To: barebox

I'm porting an am335x based board. We have systems either with 256MB
or 512MB RAM. Currently I'm using following code:

ENTRY_FUNCTION(start_am33xx_baltos_sdram, r0, r1, r2)
{
        uint32_t sdram_size;
        void *fdt;

        sdram_size = SZ_256M;
        fdt = __dtb_am335x_baltos_minimal_start;

        fdt -= get_runtime_offset();

        barebox_arm_entry(0x80000000, sdram_size, fdt);
}

This way I always have 256MB "detected" regardless of the used
hardware. Is it possible to let Barebox autodetect RAM size like it is
done in U-Boot?

Another question concerns booting medium. Whether I start from NAND or
MMC I always want to be able to boot from MMC too. Now, if I boot
Barebox from NAND I can see following in devinfo output:

 `-- 48060000.mmc
         `-- mmc0

How can I make system enumerate MMC partition, so that I can mount
them? "detect mmc0" doesn't help.

When booting completely from MMC, mmco will be enumerated.

Yegor

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: am335x questions
  2016-05-26 13:41 am335x questions Yegor Yefremov
@ 2016-05-26 14:44 ` Sascha Hauer
  2016-05-27 13:52   ` Yegor Yefremov
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2016-05-26 14:44 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: barebox

Hi Yegor,

On Thu, May 26, 2016 at 03:41:46PM +0200, Yegor Yefremov wrote:
> I'm porting an am335x based board. We have systems either with 256MB
> or 512MB RAM. Currently I'm using following code:
> 
> ENTRY_FUNCTION(start_am33xx_baltos_sdram, r0, r1, r2)
> {
>         uint32_t sdram_size;
>         void *fdt;
> 
>         sdram_size = SZ_256M;
>         fdt = __dtb_am335x_baltos_minimal_start;
> 
>         fdt -= get_runtime_offset();
> 
>         barebox_arm_entry(0x80000000, sdram_size, fdt);
> }
> 
> This way I always have 256MB "detected" regardless of the used
> hardware. Is it possible to let Barebox autodetect RAM size like it is
> done in U-Boot?

Try am335x_barebox_entry() instead of barebox_arm_entry(), it will
read back the configured SDRAM size from the SDRAM controller. Make sure
you don't have a /memory node in your device tree conflicting with the
real amount of RAM (i.e. when you have a board with 512MiB and your
device tree contains a /memory node with 256MiB then you will have
conflicts during startup, most likely barebox will bail out in the MMU
startup). Just delete the /memory node from the device tree, barebox
will create it automatically later.

For a full runtime SDRAM size detection you could call
am335x_sdram_init() with different setups and call get_ram_size()
afterwards. I'm not aware of other tricks on AM335x. How does U-Boot do
it?

> 
> Another question concerns booting medium. Whether I start from NAND or
> MMC I always want to be able to boot from MMC too. Now, if I boot
> Barebox from NAND I can see following in devinfo output:
> 
>  `-- 48060000.mmc
>          `-- mmc0
> 
> How can I make system enumerate MMC partition, so that I can mount
> them? "detect mmc0" doesn't help.

"detect mmc0" should generally work. If it doesn't my guess is that the
pinmux is not configured correctly. When you boot from MMC then the ROM
configures the pinmux and the SD card works in barebox aswell. When you
boot from Nand then the pinmux is missing. Just a guess, could be clocks
aswell or something else.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: am335x questions
  2016-05-26 14:44 ` Sascha Hauer
@ 2016-05-27 13:52   ` Yegor Yefremov
  0 siblings, 0 replies; 3+ messages in thread
From: Yegor Yefremov @ 2016-05-27 13:52 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Thu, May 26, 2016 at 4:44 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> Hi Yegor,
>
> On Thu, May 26, 2016 at 03:41:46PM +0200, Yegor Yefremov wrote:
>> I'm porting an am335x based board. We have systems either with 256MB
>> or 512MB RAM. Currently I'm using following code:
>>
>> ENTRY_FUNCTION(start_am33xx_baltos_sdram, r0, r1, r2)
>> {
>>         uint32_t sdram_size;
>>         void *fdt;
>>
>>         sdram_size = SZ_256M;
>>         fdt = __dtb_am335x_baltos_minimal_start;
>>
>>         fdt -= get_runtime_offset();
>>
>>         barebox_arm_entry(0x80000000, sdram_size, fdt);
>> }
>>
>> This way I always have 256MB "detected" regardless of the used
>> hardware. Is it possible to let Barebox autodetect RAM size like it is
>> done in U-Boot?
>
> Try am335x_barebox_entry() instead of barebox_arm_entry(), it will
> read back the configured SDRAM size from the SDRAM controller. Make sure
> you don't have a /memory node in your device tree conflicting with the
> real amount of RAM (i.e. when you have a board with 512MiB and your
> device tree contains a /memory node with 256MiB then you will have
> conflicts during startup, most likely barebox will bail out in the MMU
> startup). Just delete the /memory node from the device tree, barebox
> will create it automatically later.
>
> For a full runtime SDRAM size detection you could call
> am335x_sdram_init() with different setups and call get_ram_size()
> afterwards. I'm not aware of other tricks on AM335x. How does U-Boot do
> it?

I haven't looked at U-Boot solution closely as detection was working
from the very beginning. I'll look at am335x_barebox_entry().

>>
>> Another question concerns booting medium. Whether I start from NAND or
>> MMC I always want to be able to boot from MMC too. Now, if I boot
>> Barebox from NAND I can see following in devinfo output:
>>
>>  `-- 48060000.mmc
>>          `-- mmc0
>>
>> How can I make system enumerate MMC partition, so that I can mount
>> them? "detect mmc0" doesn't help.
>
> "detect mmc0" should generally work. If it doesn't my guess is that the
> pinmux is not configured correctly. When you boot from MMC then the ROM
> configures the pinmux and the SD card works in barebox aswell. When you
> boot from Nand then the pinmux is missing. Just a guess, could be clocks
> aswell or something else.

You're right. Missing pinmux was the problem.

Yegor

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-27 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-26 13:41 am335x questions Yegor Yefremov
2016-05-26 14:44 ` Sascha Hauer
2016-05-27 13:52   ` Yegor Yefremov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox