barebox startup

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 10 07:10:03 EST 2011


On Thu, Feb 10, 2011 at 10:04:26AM +0100, Vanalme Filip wrote:
> After struggling a while with i.MX27 NAND flash controller, I was able to start Barebox. Now, I have added some device, but I am not sure that everything starts as it should.
> This is how my devices_init function looks like now : 
> 
> static struct memory_platform_data ram_pdata = {
> 	.name = "ram0",
> 	.flags = DEVFS_RDWR,
> };
> 
> static struct device_d sdram_dev = {
> 	.id	  = -1,
> 	.name     = "mem",
> 	.map_base = 0xa0000000,
> 	.size     = 128 * 1024 * 1024,  /* 128 MB SDRAM */
> 	.platform_data = &ram_pdata,
> };
> 
> static struct fec_platform_data fec_info = {
> 	.xcv_type = MII100,
> 	.phy_addr = 1,
> };

The phy address may be wrong, please check in the schematics/phy data
sheet whether it is correct.

> 
> 
> I expected to see the autoboot count-down and at least something about
> the network initialization.  I think it probably has something to do
> with the env/config script file. I don't know exactly how it should be
> used. I ran ./scripts/bareboxenv -s -p 0x10000 arch/arm/imx27pdk/env
> env.bin which created env.bin in the barebox root. Afterwards, when
> doing a make all, I could see that there is a /env folder on my device
> which contains the config file. I could execute that script from the
> command line, but I suppose it should be executed automatically
> somehow.

You should have something like the following in your config to get an
environment:

CONFIG_DEFAULT_ENVIRONMENT=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/karo-tx28/env"

(with karo-tx28 being your board)

> 
> 
> For the moment, I don't have any activity on my Ethernet ports (no
> leds on or blinking), although I added the fec device. When I execute
> the dhcp command, I get :
> 
> barebox:/ dhcp
> warning: No MAC address set. Using random address 8E:A2:E8:DD:E2:73
> phy0: Link is up - 100/Full
> transmission timeout
> T transmission timeout
> T transmission timeout
> 
> But, whether I connect the cable or not, it always shows "phy0:Link is up - 100/Full".

Have a look at the output of md -s /dev/phy0. You should see valid phy
registers, not 0xffffffff.

> 
> I also have a problem with the environment settings. Obviously, I can
> set some environment variables, e.g. ipaddr=192.168.1.10 :
> 
> barebox:/ ipaddr=192.168.1.10
> barebox:/ printenv
> locals:
> ipaddr=192.168.1.10
> globals:
> barebox:/ saveenv
> saving environment
> barebox:/
> 
> But, although I did a saveenv (obviously successful), the environment
> settings disappear after resetting the board.

Unlike U-Boot barebox does not save the content of environment
variables. Instead it saves the content of /env/. So to change the ip
address do a 'edit /env/config', saveenv. Also, the ip address is stored
in a device variable which is accessible through eth0.ipaddr=a.b.c.d.

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 |



More information about the barebox mailing list