Re: [PATCH 2/2] ARM: omap: Add bootsource serial to xload
On Wed, Nov 12, 2014 at 10:24:48AM +0100, Jan Weitzel wrote: > Am 12.11.2014 um 09:22 schrieb Sascha Hauer: > >Hi Jan, > > > >On Wed, Nov 12, 2014 at 08:41:54AM +0100, Jan Weitzel wrote: > >>If booted from serial via xmodem, also get barebox.bin per xmodem > >>For first stage you need the .pblx file instead of MLO. > >> > >>Signed-off-by: Jan Weitzel > >>--- > >> arch/arm/mach-omap/Kconfig | 7 +++ > >> arch/arm/mach-omap/xload.c | 46 > >> ++ > >> 2 files changed, 53 insertions(+) > >> > >>diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig > >>index f9b5ec3..953dd8f 100644 > >>--- a/arch/arm/mach-omap/Kconfig > >>+++ b/arch/arm/mach-omap/Kconfig > >>@@ -118,6 +118,13 @@ config OMAP4_USBBOOT > >> You need the utility program omap4_usbboot to boot from USB. > >> Please read omap4_usb_booting.txt for more information. > >>+config OMAP_SERIALBOOT > >>+ bool > >>+ default y > >No default y please. Better keep it disabled by default because the > >OMAP4 xload configs are quiet tight I think. > > Is adding it to am335x_mlo_defconfig ok? Because of the size I added the > ARCH_AM33XX dependency. I overlooked this dependency. So the dependency is only because of the binary size and it's otherwise usable on Omap aswell? In this case I suggest to drop the dependency. And yes, ok to add it to the am335x_mlo_defconfig. 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 2/3] pci: align bridge windows
The bridge filtering logic needs a minimum alignment of 1MB for mem and 4KB for io resources. Take this into account while assigning resources to devices in oredr to not produce overlapping windows between different bridges. Signed-off-by: Lucas Stach --- drivers/pci/pci.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 87c2fca..7f8ebcf 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1,4 +1,5 @@ #include +#include #include #ifdef DEBUG @@ -259,14 +260,17 @@ static void postscan_setup_bridge(struct pci_dev *dev) pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, bus_index - 1); if (last_mem) + last_mem = ALIGN(last_mem, SZ_1M); pci_write_config_word(dev, PCI_MEMORY_LIMIT, ((last_mem - 1) & 0xfff0) >> 16); if (last_mem_pref) + last_mem_pref = ALIGN(last_mem_pref, SZ_1M); pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, ((last_mem_pref - 1) & 0xfff0) >> 16); if (last_io) { + last_io = ALIGN(last_io, SZ_4K); pci_write_config_byte(dev, PCI_IO_LIMIT, ((last_io - 1) & 0xf000) >> 8); pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, -- 1.9.3 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 1/3] pci: correct BAR size calculation
The previous math would return negative sizes for some BARs. Signed-off-by: Lucas Stach --- drivers/pci/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index ba9d097..87c2fca 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -154,7 +154,7 @@ static void setup_device(struct pci_dev *dev, int max_bar) } if (mask & 0x01) { /* IO */ - size = -(mask & 0xfffe); + size = ((~(mask & 0xfffe)) & 0x) + 1; DBG(" PCI: pbar%d: mask=%08x io %d bytes\n", bar, mask, size); if (last_io + size > dev->bus->resource[PCI_BUS_RESOURCE_IO]->end) { @@ -167,7 +167,7 @@ static void setup_device(struct pci_dev *dev, int max_bar) last_io += size; } else if ((mask & PCI_BASE_ADDRESS_MEM_PREFETCH) && last_mem_pref) /* prefetchable MEM */ { - size = -(mask & 0xfff0); + size = (~(mask & 0xfff0)) + 1; DBG(" PCI: pbar%d: mask=%08x P memory %d bytes\n", bar, mask, size); if (last_mem_pref + size > @@ -181,7 +181,7 @@ static void setup_device(struct pci_dev *dev, int max_bar) last_addr = last_mem_pref; last_mem_pref += size; } else { /* non-prefetch MEM */ - size = -(mask & 0xfff0); + size = (~(mask & 0xfff0)) + 1; DBG(" PCI: pbar%d: mask=%08x NP memory %d bytes\n", bar, mask, size); if (last_mem + size > -- 1.9.3 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 3/3] pci: tegra: relax link-up timeout
Some devices need a considerable amount of time from reset deassertion until they are ready to establish a link. Relaxing the link-up timeout helps to detect them more reliable. Signed-off-by: Lucas Stach --- drivers/pci/pci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci-tegra.c b/drivers/pci/pci-tegra.c index f2ade77..1ff3c0d 100644 --- a/drivers/pci/pci-tegra.c +++ b/drivers/pci/pci-tegra.c @@ -1145,7 +1145,7 @@ static bool tegra_pcie_port_check_link(struct tegra_pcie_port *port) writel(value, port->base + RP_PRIV_MISC); do { - timeout = wait_on_timeout(50 * MSECOND, + timeout = wait_on_timeout(150 * MSECOND, readl(port->regs.start + RP_VEND_XP) & RP_VEND_XP_DL_UP); if (timeout) { -- 1.9.3 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 0/4] mvebu: Add network support for Armada 370/XP
On 11/12/2014 11:56 AM, Uwe Kleine-König wrote: Hello again, here come the recent insights. [...] It seems to be not possible to easily dump the register space in both U-Boot and barebox for comparison. md 0xf1074000+0x4000 just hangs somewhere in the middle. A difference between U-Boot and barebox is the location where the internal registers are mapped. Maybe something that depends on U-Boot's memory layout leaks into barebox because I do 2nd stage booting? Out of ideas at the moment. :-( Uwe, Nice comparison, but did you double check caches are disabled? There is no support for Dcache on mvebu SoCs in barebox atm. Sebastian ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 0/4] mvebu: Add network support for Armada 370/XP
Hello again, here come the recent insights. On Tue, Nov 11, 2014 at 10:06:49AM +0100, Uwe Kleine-König wrote: > shouldn't it? It has the address 192.168.77.1). Running "ping 192.168.77.1" > seems to result in packages like this: > > 10:01:30.233928 42:40:00:10:40:60 > 00:00:00:34:00:12, ethertype MOP RC > (0x6002), length 60: > 0x: 0034 0012 4240 0010 4060 6002 4000 ...4..B@..@``.@. > 0x0010: 0054 8080 0012 4100 0002 c095 08e8 01a0 .TA. > 0x0020: 1420 0020 8001 1020 > 0x0030: > > which is utter nonsense. I sprinkled printfs over the network driver. The packet that is intended to be sent looks ok: Send a packet (len = 42, txdesc=0x01f15000): 01f12040: ff ff ff ff ff ff 28 c6 8e 36 df 57 08 06 00 01 ..(..6.W 01f12050: 08 00 06 04 00 01 28 c6 8e 36 df 57 c0 a8 4d 85 ..(..6.W..M. 01f12060: 00 00 00 00 00 00 c0 a8 4d 01 M. That's an ARP request asking for the address of 192.168.77.1 which is expected. After that, both the descriptor and the data buffer look ok: barebox:/ md 0x01f15000+32 01f15000: fefe 002a6fef 01f12040 f7e4.o*.@ .. 01f15010: fcfefcfa ff2fbff6 fdfbffef 01f14ff8 ../..O.. barebox:/ md -b 0x01f12040+42 01f12040: ff ff ff ff ff ff 28 c6 8e 36 df 57 08 06 00 01 ..(..6.W 01f12050: 08 00 06 04 00 01 28 c6 8e 36 df 57 c0 a8 4d 85 ..(..6.W..M. 01f12060: 00 00 00 00 00 00 c0 a8 4d 01 M. And I don't see what this has to do with the packet that enters my router: 10:26:31.133258 fe:bf:f7:f3:fb:7f (oui Unknown) > da:74:f7:fc:fb:fa (oui Unknown), ethertype Unknown (0xdfbf), length 60: 0x: da74 f7fc fbfa febf f7f3 fb7f dfbf fffb .t.. 0x0010: dffd ffea 7ffd c6e7 fffb faff febd fb5f ..._ 0x0020: fefb effc fefc eff5 0x0030: The size looks OK (it was increased from 42 to 60 because that's the minimal size that is supported by ethernet). So my theory is that either the phy or some setting in the ethernet address range is broken. The output of md -s /dev/phy1 looks sane, too: barebox:/ md -s /dev/phy1 : 796d1140 0e900141 cde101e1 2001000f @.myA.. 0010: 03004502 3800 3000 .E...8.0 0020: bc083060 1c400080 0020 `0@. ... 0030: 0040 @... It seems to be not possible to easily dump the register space in both U-Boot and barebox for comparison. md 0xf1074000+0x4000 just hangs somewhere in the middle. A difference between U-Boot and barebox is the location where the internal registers are mapped. Maybe something that depends on U-Boot's memory layout leaks into barebox because I do 2nd stage booting? Out of ideas at the moment. :-( Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König| Industrial Linux Solutions | http://www.pengutronix.de/ | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/2] ARM: omap: Add bootsource serial to xload
Am 12.11.2014 um 09:22 schrieb Sascha Hauer: Hi Jan, On Wed, Nov 12, 2014 at 08:41:54AM +0100, Jan Weitzel wrote: If booted from serial via xmodem, also get barebox.bin per xmodem For first stage you need the .pblx file instead of MLO. Signed-off-by: Jan Weitzel --- arch/arm/mach-omap/Kconfig | 7 +++ arch/arm/mach-omap/xload.c | 46 ++ 2 files changed, 53 insertions(+) diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index f9b5ec3..953dd8f 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -118,6 +118,13 @@ config OMAP4_USBBOOT You need the utility program omap4_usbboot to boot from USB. Please read omap4_usb_booting.txt for more information. +config OMAP_SERIALBOOT + bool + default y No default y please. Better keep it disabled by default because the OMAP4 xload configs are quiet tight I think. Is adding it to am335x_mlo_defconfig ok? Because of the size I added the ARCH_AM33XX dependency. Jan Sascha + select XYMODEM + select FS_RAMFS + depends on ARCH_AM33XX && SHELL_NONE + config OMAP_MULTI_BOARDS bool "Allow multiple boards to be selected" select HAVE_DEFAULT_ENVIRONMENT_NEW diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index e9d7bbb..8d9d84c 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -11,6 +11,7 @@ #include #include #include +#include #include struct omap_barebox_part *barebox_part; @@ -184,6 +185,45 @@ static void *omap4_xload_boot_usb(void){ return buf; } +static void *omap_serial_boot(void){ + struct console_device *cdev; + int ret; + void *buf; + int len; + int fd; + + /* need temporary place to store file */ + ret = mount("none", "ramfs", "/", NULL); + if (ret < 0) { + printf("failed to mount ramfs\n"); + return NULL; + } + + cdev = console_get_first_active(); + if (!cdev) { + printf("failed to get console\n"); + return NULL; + } + + fd = open("/barebox.bin", O_WRONLY | O_CREAT); + if (fd < 0) { + printf("could not create barebox.bin\n"); + return NULL; + } + + ret = do_load_serial_xmodem(cdev, fd); + if (ret < 0) { + printf("loadx failed\n"); + return NULL; + } + + buf = read_file("/barebox.bin", &len); + if (!buf) + printf("could not read barebox.bin from serial\n"); + + return buf; +} + /* * Replaces the default shell in xload configuration */ @@ -218,6 +258,12 @@ static __noreturn int omap_xload(void) func = omap_xload_boot_spi(barebox_part->nor_offset, barebox_part->nor_size); break; + case BOOTSOURCE_SERIAL: + if (IS_ENABLED(CONFIG_OMAP_SERIALBOOT)) { + printf("booting from serial\n"); + func = omap_serial_boot(); + break; + } default: printf("unknown boot source. Fall back to nand\n"); func = omap_xload_boot_nand(barebox_part->nand_offset, -- 1.9.1 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/2] xymodem: select CRC16 from lib
On Wed, Nov 12, 2014 at 08:41:53AM +0100, Jan Weitzel wrote: > Signed-off-by: Jan Weitzel > --- > commands/Kconfig | 1 - > lib/Kconfig | 1 + > 2 files changed, 1 insertion(+), 1 deletion(-) Applied this one, thanks Sascha > > diff --git a/commands/Kconfig b/commands/Kconfig > index bef5847..494a019 100644 > --- a/commands/Kconfig > +++ b/commands/Kconfig > @@ -481,7 +481,6 @@ config CMD_LOADS > Load S-Record file over serial line with offset OFFS. > > config CMD_LOADY > - select CRC16 > select XYMODEM > depends on !CONSOLE_NONE > tristate > diff --git a/lib/Kconfig b/lib/Kconfig > index d4095fd..62695f1 100644 > --- a/lib/Kconfig > +++ b/lib/Kconfig > @@ -41,6 +41,7 @@ config QSORT > > config XYMODEM > bool > + select CRC16 > > config LIBSCAN > bool > -- > 1.9.1 > > > ___ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox > -- 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/2] am335x:phyflex: Remove phy fixup from board file
On Wed, Nov 12, 2014 at 08:58:05AM +0100, Christian Hemp wrote: > The ethernet timings are set by the devicetree. They are no longer required > in the > board file. > > Signed-off-by: Christian Hemp Applied both, thanks Sascha > --- > arch/arm/boards/phytec-phyflex-am335x/board.c | 10 -- > 1 file changed, 10 deletions(-) > > diff --git a/arch/arm/boards/phytec-phyflex-am335x/board.c > b/arch/arm/boards/phytec-phyflex-am335x/board.c > index cf7dd2e..f265e52 100644 > --- a/arch/arm/boards/phytec-phyflex-am335x/board.c > +++ b/arch/arm/boards/phytec-phyflex-am335x/board.c > @@ -32,21 +32,11 @@ > #include > #include > > -static int ksz9031rn_phy_fixup(struct phy_device *dev) > -{ > - phy_write_mmd_indirect(dev, 6, 2, 0); > - phy_write_mmd_indirect(dev, 8, 2, 0x003ff); > - > - return 0; > -} > - > static int pfla03_coredevice_init(void) > { > if (!of_machine_is_compatible("phytec,phyflex-am335x-som")) > return 0; > > - phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, > - ksz9031rn_phy_fixup); > am33xx_register_ethaddr(0, 0); > am33xx_register_ethaddr(1, 1); > > -- > 1.9.1 > > > ___ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox > -- 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/2] ARM: omap: Add bootsource serial to xload
Hi Jan, On Wed, Nov 12, 2014 at 08:41:54AM +0100, Jan Weitzel wrote: > If booted from serial via xmodem, also get barebox.bin per xmodem > For first stage you need the .pblx file instead of MLO. > > Signed-off-by: Jan Weitzel > --- > arch/arm/mach-omap/Kconfig | 7 +++ > arch/arm/mach-omap/xload.c | 46 > ++ > 2 files changed, 53 insertions(+) > > diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig > index f9b5ec3..953dd8f 100644 > --- a/arch/arm/mach-omap/Kconfig > +++ b/arch/arm/mach-omap/Kconfig > @@ -118,6 +118,13 @@ config OMAP4_USBBOOT > You need the utility program omap4_usbboot to boot from USB. > Please read omap4_usb_booting.txt for more information. > > +config OMAP_SERIALBOOT > + bool > + default y No default y please. Better keep it disabled by default because the OMAP4 xload configs are quiet tight I think. Sascha > + select XYMODEM > + select FS_RAMFS > + depends on ARCH_AM33XX && SHELL_NONE > + > config OMAP_MULTI_BOARDS > bool "Allow multiple boards to be selected" > select HAVE_DEFAULT_ENVIRONMENT_NEW > diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c > index e9d7bbb..8d9d84c 100644 > --- a/arch/arm/mach-omap/xload.c > +++ b/arch/arm/mach-omap/xload.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > > struct omap_barebox_part *barebox_part; > @@ -184,6 +185,45 @@ static void *omap4_xload_boot_usb(void){ > return buf; > } > > +static void *omap_serial_boot(void){ > + struct console_device *cdev; > + int ret; > + void *buf; > + int len; > + int fd; > + > + /* need temporary place to store file */ > + ret = mount("none", "ramfs", "/", NULL); > + if (ret < 0) { > + printf("failed to mount ramfs\n"); > + return NULL; > + } > + > + cdev = console_get_first_active(); > + if (!cdev) { > + printf("failed to get console\n"); > + return NULL; > + } > + > + fd = open("/barebox.bin", O_WRONLY | O_CREAT); > + if (fd < 0) { > + printf("could not create barebox.bin\n"); > + return NULL; > + } > + > + ret = do_load_serial_xmodem(cdev, fd); > + if (ret < 0) { > + printf("loadx failed\n"); > + return NULL; > + } > + > + buf = read_file("/barebox.bin", &len); > + if (!buf) > + printf("could not read barebox.bin from serial\n"); > + > + return buf; > +} > + > /* > * Replaces the default shell in xload configuration > */ > @@ -218,6 +258,12 @@ static __noreturn int omap_xload(void) > func = omap_xload_boot_spi(barebox_part->nor_offset, > barebox_part->nor_size); > break; > + case BOOTSOURCE_SERIAL: > + if (IS_ENABLED(CONFIG_OMAP_SERIALBOOT)) { > + printf("booting from serial\n"); > + func = omap_serial_boot(); > + break; > + } > default: > printf("unknown boot source. Fall back to nand\n"); > func = omap_xload_boot_nand(barebox_part->nand_offset, > -- > 1.9.1 > > > ___ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox > -- 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 2/2] ARM: defconfig: Enable Micrel PHY driver in am335x_defconfig
From: Wadim Egorov Signed-off-by: Wadim Egorov --- arch/arm/configs/am335x_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/am335x_defconfig b/arch/arm/configs/am335x_defconfig index a682fe4..e9bc1ba 100644 --- a/arch/arm/configs/am335x_defconfig +++ b/arch/arm/configs/am335x_defconfig @@ -92,6 +92,7 @@ CONFIG_OF_BAREBOX_DRIVERS=y CONFIG_DRIVER_SERIAL_NS16550=y CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y CONFIG_DRIVER_NET_CPSW=y +CONFIG_MICREL_PHY=y CONFIG_NET_USB=y CONFIG_NET_USB_ASIX=y CONFIG_NET_USB_SMSC95XX=y -- 1.9.1 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 1/2] am335x:phyflex: Remove phy fixup from board file
The ethernet timings are set by the devicetree. They are no longer required in the board file. Signed-off-by: Christian Hemp --- arch/arm/boards/phytec-phyflex-am335x/board.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/arm/boards/phytec-phyflex-am335x/board.c b/arch/arm/boards/phytec-phyflex-am335x/board.c index cf7dd2e..f265e52 100644 --- a/arch/arm/boards/phytec-phyflex-am335x/board.c +++ b/arch/arm/boards/phytec-phyflex-am335x/board.c @@ -32,21 +32,11 @@ #include #include -static int ksz9031rn_phy_fixup(struct phy_device *dev) -{ - phy_write_mmd_indirect(dev, 6, 2, 0); - phy_write_mmd_indirect(dev, 8, 2, 0x003ff); - - return 0; -} - static int pfla03_coredevice_init(void) { if (!of_machine_is_compatible("phytec,phyflex-am335x-som")) return 0; - phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, - ksz9031rn_phy_fixup); am33xx_register_ethaddr(0, 0); am33xx_register_ethaddr(1, 1); -- 1.9.1 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox