* barebox startup @ 2011-02-10 9:04 Vanalme Filip 2011-02-10 12:10 ` Sascha Hauer 0 siblings, 1 reply; 4+ messages in thread From: Vanalme Filip @ 2011-02-10 9:04 UTC (permalink / raw) To: barebox 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, }; static struct imx_nand_platform_data nand_info = { .width = 1, .hw_ecc = 1, .flash_bbt = 1, }; static int imx27pdk_devices_init(void) { int i; unsigned int mode[] = { /* FEC */ PD0_AIN_FEC_TXD0, PD1_AIN_FEC_TXD1, PD2_AIN_FEC_TXD2, PD3_AIN_FEC_TXD3, PD4_AOUT_FEC_RX_ER, PD5_AOUT_FEC_RXD1, PD6_AOUT_FEC_RXD2, PD7_AOUT_FEC_RXD3, PD8_AF_FEC_MDIO, PD9_AIN_FEC_MDC | GPIO_PUEN, PD10_AOUT_FEC_CRS, PD11_AOUT_FEC_TX_CLK, PD12_AOUT_FEC_RXD0, PD13_AOUT_FEC_RX_DV, PD14_AOUT_FEC_RX_CLK, PD15_AOUT_FEC_COL, PD16_AIN_FEC_TX_ER, PF23_AIN_FEC_TX_EN, /* UART */ PE12_PF_UART1_TXD, PE13_PF_UART1_RXD, PE14_PF_UART1_CTS, PE15_PF_UART1_RTS, /* display */ PA5_PF_LSCLK, PA6_PF_LD0, PA7_PF_LD1, PA8_PF_LD2, PA9_PF_LD3, PA10_PF_LD4, PA11_PF_LD5, PA12_PF_LD6, PA13_PF_LD7, PA14_PF_LD8, PA15_PF_LD9, PA16_PF_LD10, PA17_PF_LD11, PA18_PF_LD12, PA19_PF_LD13, PA20_PF_LD14, PA21_PF_LD15, PA22_PF_LD16, PA23_PF_LD17, PA24_PF_REV, PA25_PF_CLS, PA26_PF_PS, PA27_PF_SPL_SPR, PA28_PF_HSYNC, PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD, }; /* initialize gpios */ for (i = 0; i < ARRAY_SIZE(mode); i++) imx_gpio_mode(mode[i]); register_device(&sdram_dev); imx27_add_fec(&fec_info); imx27_add_nand(&nand_info); devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw"); dev_add_bb_dev("self_raw", "self0"); devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw"); dev_add_bb_dev("env_raw", "env0"); armlinux_add_dram(&sdram_dev); armlinux_set_bootparams((void *)0xa0000100); return 0; } device_initcall(imx27pdk_devices_init); (I used the pcm038 board as a reference. Most of the items in this function I took from that board's lowlevel function). When starting up, I get the following console output : barebox 2010.12.0-00073-gfad11e8-dirty (Feb 9 2011 - 14:09:49) Board: Freescale i.MX27 PDK 3Stack NAND device: Manufacturer ID: 0xec, Chip ID: 0xaa (Samsung NAND 256MiB 1,8V 8-bit) Bad block table found at page 131008, version 0x02 Bad block table found at page 130944, version 0x02 Malloc space: 0xa7b00000 -> 0xa7f00000 (size 4 MB) Stack space : 0xa7af8000 -> 0xa7b00000 (size 32 kB) running /env/bin/init... not found barebox:/ This is the console output when executing the devinfo command : barebox:/ devinfo devices: |----imx_serial0 |----cs0 |----ramfs0 |----devfs0 |----mem0 (defaultenv) |----mem1 (mem) |----mem2 (ram0) |----fec_imx0 |----miidev0 (phy0) |----eth0 |----imx_nand0 |----nand0 (nand0, nand_oob0, self_raw, env_raw) drivers: imx_serial ramfs devfs fec_imx miidev imx_nand cfi_flash imxfb mem barebox:/ 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. 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". 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. I think I might still miss something to make my board start correctly. Someone can point me in the good direction ? (or point me to some doc about this) Filip _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: barebox startup 2011-02-10 9:04 barebox startup Vanalme Filip @ 2011-02-10 12:10 ` Sascha Hauer 2011-10-05 13:44 ` Pierre Schirrer 0 siblings, 1 reply; 4+ messages in thread From: Sascha Hauer @ 2011-02-10 12:10 UTC (permalink / raw) To: Vanalme Filip; +Cc: barebox 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 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: barebox startup 2011-02-10 12:10 ` Sascha Hauer @ 2011-10-05 13:44 ` Pierre Schirrer 2011-10-10 9:33 ` Sascha Hauer 0 siblings, 1 reply; 4+ messages in thread From: Pierre Schirrer @ 2011-10-05 13:44 UTC (permalink / raw) To: barebox [-- Attachment #1.1: Type: text/plain, Size: 1814 bytes --] Hello Sascha, >/ />/ />/ 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 have exactly the same problem on an i.MX21 board (proprietary design). I have used the imx21ads to start from. md -s /dev/phy0 returns 0xffffffff. Any ideas how to correct this (the smc91c111 base address is 0xd2c80000) ? Here is the devinfo output : barebox:/ devinfo devices: |----imx_serial0 |----cs0 |----ramfs0 |----devfs0 |----mem0 (defaultenv) |----mem1 (mem) |----cfi_flash0 (nor0, self0, env0) |----cfi_flash1 (nor1) |----mem2 (ram0) |----smc91c1110 |----miidev0 (phy0) |----eth0 |----imxfb0 drivers: imx_serial ramfs devfs smc911x smc91c111 miidev cfi_flash mem barebox:/ devinfo miidev0 base : 0x00000000 size : 0x00000000 driver: miidev no info available for miidev0 no parameters available barebox:/ devinfo smc91c1110 base : 0xd2c80000 size : 0x00000000 driver: smc91c111 no info available for smc91c1110 no parameters available barebox:/ devinfo phy0 no such device: phy0 barebox:/ devinfo eth0 base : 0x00000000 size : 0x00000000 driver: none Parameters: ipaddr = 10.32.50.10 ethaddr = 00:1A:09:20:00:17 gateway = 10.32.51.148 netmask = 255.255.252.0 serverip = 10.32.51.148 barebox:/ [-- Attachment #1.2: Type: text/html, Size: 3009 bytes --] [-- Attachment #2: platfaxio.c --] [-- Type: text/x-csrc, Size: 7387 bytes --] /* * Copyright (C) 2010 Pierre Schirrer * * Based on imx21ads.c * Copyright (C) 2009 Ivo Clarysse * * Based on imx27ads.c, * Copyright (C) 2007 Sascha Hauer, Pengutronix * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * */ #include <common.h> #include <net.h> #include <init.h> #include <environment.h> #include <mach/imx-regs.h> #include <asm/armlinux.h> #include <asm/io.h> #include <mach/gpio.h> #include <partition.h> #include <fs.h> #include <fcntl.h> #include <generated/mach-types.h> #include <mach/imx-nand.h> #include <mach/imxfb.h> #include <mach/iomux-mx21.h> #include <mach/devices-imx21.h> #define REG_LEDS ((volatile u32 *)IMX_CS5_BASE) #define LED_RED 1 #define LED_YELLOW 2 #define LED_GREEN 4 #define PLATFAXIO_LAN_IO ((volatile u32 *)(IMX_CS4_BASE + 0xC80000)) static struct device_d cfi_dev = { .id = -1, .name = "cfi_flash", .map_base = IMX_CS0_BASE, .size = 64 * 1024 * 1024, }; static struct device_d cfi_dev1 = { .id = -1, .name = "cfi_flash", .map_base = IMX_CS1_BASE, .size = 64 * 1024 * 1024, }; static struct memory_platform_data ram_pdata = { .name = "ram0", .flags = DEVFS_RDWR, }; static struct device_d sdram_dev = { .id = -1, .name = "mem", .map_base = 0xc0000000, .size = 128 * 1024 * 1024, .platform_data = &ram_pdata, }; static struct device_d lan91111_dev = { .id = -1, .name = "smc91c111", .map_base = PLATFAXIO_LAN_IO, // IRQ is connected to PC28 }; #ifdef CONFIG_MMU static void platfaxio_mmu_init(void) { mmu_init(); arm_create_section(0xC0000000, 0xa0000000, 128, PMD_SECT_DEF_CACHED); arm_create_section(0xC4000000, 0xa0000000, 128, PMD_SECT_DEF_UNCACHED); setup_dma_coherent(0x10000000); #if TEXT_BASE & (0x100000 - 1) #warning cannot create vector section. Adjust TEXT_BASE to a 1M boundary #else arm_create_section(0x0, TEXT_BASE, 1, PMD_SECT_DEF_UNCACHED); #endif mmu_enable(); } #else static void platfaxio_mmu_init(void) { } #endif /* Ampire AM640408 VGA display */ static struct imx_fb_videomode imx_fb_modedata = { .mode = { .name = "Ampire-AM640480", .refresh = 60, .xres = 640, .yres = 480, .pixclock = 39722, .left_margin = 6, .right_margin = 16, .upper_margin = 8, .lower_margin = 10, .hsync_len = 2, .vsync_len = 1, .sync = 0, .vmode = FB_VMODE_NONINTERLACED, .flag = 0, }, .pcr = 0xfb108bc7, .bpp = 16, }; static struct imx_fb_platform_data imx_fb_data = { .mode = &imx_fb_modedata, .cmap_greyscale = 0, .cmap_inverse = 0, .cmap_static = 0, .pwmr = 0x00a903ff, .lscr1 = 0x00120300, .dmacr = 0x00020008, }; static struct device_d imxfb_dev = { .name = "imxfb", .map_base = 0x10021000, .size = 0x1000, .platform_data = &imx_fb_data, }; static int platfaxio_timing_init(void) { u32 temp; #if 1 /* Configure External Interface Module */ /* CS0: burst flash */ CS0U = 0x00000A00; CS0L = 0x20220E01; /* CS1: burst flash */ CS1U = 0x00000A00; CS1L = 0x20220E01; /* SDRAM bank 1 <= SDRAM bank 0 */ SDCTL1 = SDCTL0; FMCR |= 0x00000002; /* CS2: disable (not available, since CSD0 in use) */ CS2U = 0x0; CS2L = 0x0; /* CS3: disable (not available, since CSD1 in use) */ CS3U = 0x00000E00; CS3L = 0x11110601; /* CS4: disable */ CS4U = 0x00050A04; CS4L = 0x26443541; /* CS5: LEDS, BACKLIGHT and NIOS access */ CS5U = 0x04050E00; CS5L = 0x44443301; #endif /* 0 */ temp = PCDR0; temp &= ~0xF000; temp |= 0xA000; /* Set NFC divider; 0xA yields 24.18MHz */ PCDR0 = temp; return 0; } core_initcall(platfaxio_timing_init); static int platfaxio_devices_init(void) { char *envdev = "no"; int i; unsigned int mode[] = { /* Chip selects */ (GPIO_PORTF | GPIO_PF | 21), (GPIO_PORTF | GPIO_PF | 22), /* LAN91C111 */ (GPIO_PORTC | GPIO_GPIO | GPIO_IN | 28), /* UART1 */ PE12_PF_UART1_TXD, PE13_PF_UART1_RXD, PE14_PF_UART1_CTS, PE15_PF_UART1_RTS, /* UART2 */ PE6_PF_UART2_TXD, PE7_PF_UART2_RXD, PE3_PF_UART2_CTS, PE4_PF_UART2_RTS, /* UART3 (IrDA) - only TXD and RXD */ PE8_PF_UART3_TXD, PE9_PF_UART3_RXD, /* UART4 */ PB26_AF_UART4_RTS, PB28_AF_UART4_TXD, PB29_AF_UART4_CTS, PB31_AF_UART4_RXD, /* LCDC */ PA5_PF_LSCLK, PA6_PF_LD0, PA7_PF_LD1, PA8_PF_LD2, PA9_PF_LD3, PA10_PF_LD4, PA11_PF_LD5, PA12_PF_LD6, PA13_PF_LD7, PA14_PF_LD8, PA15_PF_LD9, PA16_PF_LD10, PA17_PF_LD11, PA18_PF_LD12, PA19_PF_LD13, PA20_PF_LD14, PA21_PF_LD15, PA22_PF_LD16, PA24_PF_REV, /* Sharp panel dedicated signal */ PA25_PF_CLS, /* Sharp panel dedicated signal */ PA26_PF_PS, /* Sharp panel dedicated signal */ PA27_PF_SPL_SPR, /* Sharp panel dedicated signal */ PA28_PF_HSYNC, PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD, /* MMC/SDHC */ (GPIO_PORTB | GPIO_GPIO | GPIO_IN | 29), (GPIO_PORTB | GPIO_GPIO | GPIO_IN | 31), PE18_PF_SD1_D0, PE19_PF_SD1_D1, PE20_PF_SD1_D2, PE21_PF_SD1_D3, PE22_PF_SD1_CMD, PE23_PF_SD1_CLK, /* RTC chip */ (GPIO_PORTC | GPIO_GPIO | GPIO_IN | 16), /* Compact Flash */ /* NIOS */ (GPIO_PORTB | GPIO_GPIO | GPIO_IN | 27), (GPIO_PORTB | GPIO_GPIO | GPIO_IN | 28), /* Misc. */ /* Power fail */ (GPIO_PORTB | GPIO_GPIO | GPIO_IN | 30), /* Relay driver */ (GPIO_PORTC | GPIO_GPIO | GPIO_OUT | 14), }; /* Initialize MMU */ platfaxio_mmu_init(); /* initizalize gpios */ for (i = 0; i < ARRAY_SIZE(mode); i++) imx_gpio_mode(mode[i]); register_device(&cfi_dev); register_device(&cfi_dev1); devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0"); devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0"); protect_file("/dev/env0", 1); envdev = "NOR"; printf("Using environment in %s Flash\n", envdev); register_device(&sdram_dev); register_device(&lan91111_dev); // imx21_add_fb(&imx_fb_data); register_device(&imxfb_dev); armlinux_add_dram(&sdram_dev); armlinux_set_bootparams((void *)0xc0100000); armlinux_set_architecture(MACH_TYPE_PLATFAXIO); return 0; } device_initcall(platfaxio_devices_init); /* static int platfaxio_enable_display(void) { u16 tmp; tmp = readw(MX21ADS_IO_REG); tmp |= MX21ADS_IO_LCDON; writew(tmp, MX21ADS_IO_REG); return 0; } late_initcall(mx21ads_enable_display); */ static int platfaxio_console_init(void) { imx21_add_uart0(); return 0; } console_initcall(platfaxio_console_init); #ifdef CONFIG_NAND_IMX_BOOT void __bare_init nand_boot(void) { PCCR0 |= PCCR0_NFC_EN; imx_nand_load_image((void *)TEXT_BASE, 256 * 1024); } #endif [-- Attachment #3: Type: text/plain, Size: 149 bytes --] _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: barebox startup 2011-10-05 13:44 ` Pierre Schirrer @ 2011-10-10 9:33 ` Sascha Hauer 0 siblings, 0 replies; 4+ messages in thread From: Sascha Hauer @ 2011-10-10 9:33 UTC (permalink / raw) To: Pierre Schirrer; +Cc: barebox On Wed, Oct 05, 2011 at 03:44:54PM +0200, Pierre Schirrer wrote: > Hello Sascha, > > >/ > />/ > />/ 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 have exactly the same problem on an i.MX21 board (proprietary > design). I have used the imx21ads to start from. > > md -s /dev/phy0 returns 0xffffffff. Any ideas how to correct this > (the smc91c111 base address is 0xd2c80000) ? Have you used the correct phy address? In the smc91111 driver the phy address is currently hardcoded to 0: priv->miidev.address = 0; 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] 4+ messages in thread
end of thread, other threads:[~2011-10-10 9:33 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-02-10 9:04 barebox startup Vanalme Filip 2011-02-10 12:10 ` Sascha Hauer 2011-10-05 13:44 ` Pierre Schirrer 2011-10-10 9:33 ` Sascha Hauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox