Re: How to debug Ethernet connectivity
On Tue, Dec 10, 2013 at 07:24:40PM +0400, Antony Pavlov wrote: > On Tue, 10 Dec 2013 14:31:23 +0100 > Atilla Filiz wrote: > > > Ok, then my problem is slightly more clear, that /dev/phy0 does not exist. > > I do define a struct fec_platform_data with > > xcv_type=PHY_INTERFACE_MODE_MII and register it via imx27_add_fec(). > > > > Now I need to find out why it fails to register the device. > > There is issue with current barebox. > > The /dev/phy0 device is unavailable till you use network. > You can use this (ugly!) way > So just after boot type 'dhcp', next type 'ctrl-c' to interrupt dhcp and > check /dev/phy0 presence. > mh, bad... :( Maybe just try a ping instead of dhcp to bring /dev/phy0 alive. But that's a ugly hack, too. Is there no some global(var/env) to enable it? - Alex ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: How to debug Ethernet connectivity
On Tue, 10 Dec 2013 14:31:23 +0100 Atilla Filiz wrote: > Ok, then my problem is slightly more clear, that /dev/phy0 does not exist. > I do define a struct fec_platform_data with > xcv_type=PHY_INTERFACE_MODE_MII and register it via imx27_add_fec(). > > Now I need to find out why it fails to register the device. There is issue with current barebox. The /dev/phy0 device is unavailable till you use network. You can use this (ugly!) way So just after boot type 'dhcp', next type 'ctrl-c' to interrupt dhcp and check /dev/phy0 presence. > On Fri, Dec 6, 2013 at 1:43 PM, Alexander Aring wrote: > > On Fri, Dec 06, 2013 at 01:39:25PM +0100, Sascha Hauer wrote: > >> On Fri, Dec 06, 2013 at 01:18:52PM +0100, Atilla Filiz wrote: > >> > Sorry, figured it out. Just most verbose output is funny as well: > >> > :/ miitool -vvv /dev/mc13xxx > >> > >> Don't know what miitool does in this case, but mc13xxx is not your phy, > >> it's your PMIC. > >> > > > > oh, doesn't realize that :D. So reading zeros can make sense in some > > offset. :-) > > > > - Alex > > > > -- > Atilla Filiz > > ___ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox -- -- Best regards, Antony Pavlov ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: How to debug Ethernet connectivity
On Tue, 10 Dec 2013 14:31:23 +0100 Atilla Filiz wrote: > Ok, then my problem is slightly more clear, that /dev/phy0 does not exist. > I do define a struct fec_platform_data with > xcv_type=PHY_INTERFACE_MODE_MII and register it via imx27_add_fec(). > > Now I need to find out why it fails to register the device. There is an issue with current barebox. The /dev/phy0 device not present just after boot. You need somehow to use network to make it appeared. Use this [ugly!] method: Run barebox on your board. Just after boot /dev/phy0 is absent. So run 'dhcp' command. In a few seconds press "ctrl-c" to interrupt it. Check /dev/phy0 presence. > On Fri, Dec 6, 2013 at 1:43 PM, Alexander Aring wrote: > > On Fri, Dec 06, 2013 at 01:39:25PM +0100, Sascha Hauer wrote: > >> On Fri, Dec 06, 2013 at 01:18:52PM +0100, Atilla Filiz wrote: > >> > Sorry, figured it out. Just most verbose output is funny as well: > >> > :/ miitool -vvv /dev/mc13xxx > >> > >> Don't know what miitool does in this case, but mc13xxx is not your phy, > >> it's your PMIC. > >> > > > > oh, doesn't realize that :D. So reading zeros can make sense in some > > offset. :-) > > > > - Alex > > > > -- > Atilla Filiz > > ___ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox -- -- Best regards, Antony Pavlov ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 2/3] pcm051: ethernet and dts fixes
From: Jan Weitzel add compatible phytec,pcm051 clean up pinmux_emac_rmii1_pins introduce davinci_mdio_default pin group set AM33XX_MAC_MII_SEL via dts rmii-clock-ext use bch8 as ecc mode add pagesize to 24c32@52 Signed-off-by: Jan Weitzel --- arch/arm/boards/pcm051/board.c |3 +- arch/arm/dts/am335x-phytec-phycore.dts | 40 ++- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c index a64d219..91e8208 100644 --- a/arch/arm/boards/pcm051/board.c +++ b/arch/arm/boards/pcm051/board.c @@ -39,11 +39,10 @@ static struct omap_barebox_part pcm051_barebox_part = { static int pcm051_devices_init(void) { - if (!of_machine_is_compatible("phytec,phycore-am335x")) + if (!of_machine_is_compatible("phytec,pcm051")) return 0; am33xx_register_ethaddr(0, 0); - writel(0x69, AM33XX_MAC_MII_SEL); switch (bootsource_get()) { case BOOTSOURCE_SPI: diff --git a/arch/arm/dts/am335x-phytec-phycore.dts b/arch/arm/dts/am335x-phytec-phycore.dts index 81c08fd..6196eb3 100644 --- a/arch/arm/dts/am335x-phytec-phycore.dts +++ b/arch/arm/dts/am335x-phytec-phycore.dts @@ -4,7 +4,7 @@ / { model = "Phytec phyCORE AM335x"; - compatible = "phytec,phycore-am335x", "ti,am33xx"; + compatible = "phytec,phycore-am335x", "phytec,pcm051", "ti,am33xx"; chosen { linux,stdout-path = &uart0; @@ -83,16 +83,14 @@ emac_rmii1_pins: pinmux_emac_rmii1_pins { pinctrl-single,pins = < - 0x10c (INPUT_EN | MUX_MODE1) - 0x110 (INPUT_EN | MUX_MODE1) - 0x114 MUX_MODE1 - 0x124 MUX_MODE1 - 0x128 MUX_MODE1 - 0x13c (INPUT_EN | MUX_MODE1) - 0x140 (INPUT_EN | MUX_MODE1) - 0x148 (PULL_UP | INPUT_EN | MUX_MODE0) - 0x14c (PULL_UP | MUX_MODE0) - 0x144 (INPUT_EN | MUX_MODE0) + 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmii1_crs_dv */ + 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxerr.rmii1_rxerr */ + 0x114 (PIN_OUTPUT | MUX_MODE1) /* mii1_txen.rmii1_txen */ + 0x124 (PIN_OUTPUT | MUX_MODE1) /* mii1_txd1.rmii1_txd1 */ + 0x128 (PIN_OUTPUT | MUX_MODE1) /* mii1_txd0.rmii1_txd0 */ + 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */ + 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */ + 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii1_refclk.rmii1_refclk */ /* Slave 2 */ 0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a0.rgmii2_tctl */ @@ -130,6 +128,14 @@ >; }; + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = < + /* MDIO */ + 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ + 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + >; + }; + pcm051_led_pins: pinmux_pcm051_led_pins { pinctrl-single,pins = < 0x80 (MUX_MODE7) @@ -154,6 +160,7 @@ eeprom: 24c32@52 { compatible = "atmel,24c32"; + pagesize = <32>; reg = <0x52>; }; }; @@ -204,6 +211,15 @@ status = "okay"; }; +&davinci_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&davinci_mdio_default>; +}; + +&phy_sel { + rmii-clock-ext; +}; + &cpsw_emac0 { phy_id = <&davinci_mdio>, <0>; phy-mode = "rmii"; @@ -230,7 +246,7 @@ nand: nand@0,0 { reg = <0 0 0>; /* CS0, offset 0 */ nand-bus-width = <8>; - ti,nand-ecc-opt = "bch8-romcode"; + ti,nand-ecc-opt = "bch8"; gpmc,device-nand = "true"; gpmc,device-width = <1>; gpmc,sync-clk-ps = <0>; -- 1.7.0.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 1/3] net: cpsw: Fix gmii_sel config
From: Jan Weitzel Prober slave_num is needed by cpsw_gmii_sel_am335x to calc reg value. Signed-off-by: Jan Weitzel --- drivers/net/cpsw.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index 5e68e1b..52adf50 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -1074,6 +1074,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv) slave->phy_id = phy_id[1]; slave->phy_if = of_get_phy_mode(child); + slave->slave_num = i; i++; } -- 1.7.0.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH 3/3] ARM: OMAP: early call am33xx_register_ethaddr
From: Jan Weitzel am33xx_register_ethaddr must be called before cpsw driver start. Move it from devices_initcall to coredevice_initcall. Signed-off-by: Jan Weitzel --- arch/arm/boards/beaglebone/board.c | 12 ++-- arch/arm/boards/pcm051/board.c | 13 +++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c index 439c4c2..6445d81 100644 --- a/arch/arm/boards/beaglebone/board.c +++ b/arch/arm/boards/beaglebone/board.c @@ -40,6 +40,16 @@ #include "beaglebone.h" +static int beaglebone_coredevice_init(void) +{ + if (!of_machine_is_compatible("ti,am335x-bone")) + return 0; + + am33xx_register_ethaddr(0, 0); + return 0; +} +coredevice_initcall(beaglebone_coredevice_init); + static int beaglebone_devices_init(void) { int black; @@ -54,8 +64,6 @@ static int beaglebone_devices_init(void) omap_set_bootmmc_devname("mmc1"); } - am33xx_register_ethaddr(0, 0); - black = is_beaglebone_black(); globalvar_add_simple("board.variant", black ? "boneblack" : "bone"); diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c index 91e8208..60f00bb 100644 --- a/arch/arm/boards/pcm051/board.c +++ b/arch/arm/boards/pcm051/board.c @@ -30,6 +30,17 @@ #include #include + +static int pcm051_coredevice_init(void) +{ + if (!of_machine_is_compatible("phytec,pcm051")) + return 0; + + am33xx_register_ethaddr(0, 0); + return 0; +} +coredevice_initcall(pcm051_coredevice_init); + static struct omap_barebox_part pcm051_barebox_part = { .nand_offset = SZ_512K, .nand_size = SZ_512K, @@ -42,8 +53,6 @@ static int pcm051_devices_init(void) if (!of_machine_is_compatible("phytec,pcm051")) return 0; - am33xx_register_ethaddr(0, 0); - switch (bootsource_get()) { case BOOTSOURCE_SPI: of_device_enable_path("/chosen/environment-spi"); -- 1.7.0.4 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 04/17] ARM: am335x phytec phyCORE: Switch to devicetree probe support
On Tue, Dec 10, 2013 at 03:22:12PM +0100, Jan Weitzel wrote: > Am Dienstag, den 26.11.2013, 17:45 +0100 schrieb Sascha Hauer: > > This switches the am335x Phytec phyCORE to devicetree probe support. > > For now we use a linked in dtb. > > > > Signed-off-by: Sascha Hauer > > --- > > arch/arm/boards/pcm051/Makefile | 2 +- > > arch/arm/boards/pcm051/board.c| 149 > > ++ > > arch/arm/boards/pcm051/mux.c | 65 --- > > arch/arm/boards/pcm051/mux.h | 4 - > > arch/arm/configs/pcm051_defconfig | 26 -- > > arch/arm/configs/pcm051_mlo_defconfig | 8 +- > > 6 files changed, 32 insertions(+), 222 deletions(-) > > delete mode 100644 arch/arm/boards/pcm051/mux.c > > delete mode 100644 arch/arm/boards/pcm051/mux.h > > > > ... > > diff --git a/arch/arm/configs/pcm051_defconfig > > b/arch/arm/configs/pcm051_defconfig > > index 97e0940..e55ac47 100644 > > --- a/arch/arm/configs/pcm051_defconfig > > +++ b/arch/arm/configs/pcm051_defconfig > > @@ -1,16 +1,21 @@ > > +CONFIG_BUILTIN_DTB=y > > +CONFIG_BUILTIN_DTB_NAME="am335x-phytec-phycore" > > CONFIG_ARCH_OMAP=y > > -CONFIG_ARCH_AM33XX=y > > CONFIG_BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO=y > > CONFIG_MACH_PCM051=y > > -CONFIG_OMAP_UART1=y > > -CONFIG_AEABI=y > > +CONFIG_THUMB2_BAREBOX=y > > Is there a reason to use thumb2 now? It generates smaller binaries. Does this cause trouble? 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
Re: [PATCH 04/17] ARM: am335x phytec phyCORE: Switch to devicetree probe support
Am Dienstag, den 26.11.2013, 17:45 +0100 schrieb Sascha Hauer: > This switches the am335x Phytec phyCORE to devicetree probe support. > For now we use a linked in dtb. > > Signed-off-by: Sascha Hauer > --- > arch/arm/boards/pcm051/Makefile | 2 +- > arch/arm/boards/pcm051/board.c| 149 > ++ > arch/arm/boards/pcm051/mux.c | 65 --- > arch/arm/boards/pcm051/mux.h | 4 - > arch/arm/configs/pcm051_defconfig | 26 -- > arch/arm/configs/pcm051_mlo_defconfig | 8 +- > 6 files changed, 32 insertions(+), 222 deletions(-) > delete mode 100644 arch/arm/boards/pcm051/mux.c > delete mode 100644 arch/arm/boards/pcm051/mux.h > > ... > diff --git a/arch/arm/configs/pcm051_defconfig > b/arch/arm/configs/pcm051_defconfig > index 97e0940..e55ac47 100644 > --- a/arch/arm/configs/pcm051_defconfig > +++ b/arch/arm/configs/pcm051_defconfig > @@ -1,16 +1,21 @@ > +CONFIG_BUILTIN_DTB=y > +CONFIG_BUILTIN_DTB_NAME="am335x-phytec-phycore" > CONFIG_ARCH_OMAP=y > -CONFIG_ARCH_AM33XX=y > CONFIG_BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO=y > CONFIG_MACH_PCM051=y > -CONFIG_OMAP_UART1=y > -CONFIG_AEABI=y > +CONFIG_THUMB2_BAREBOX=y Is there a reason to use thumb2 now? Jan > CONFIG_ARM_BOARD_APPEND_ATAG=y > CONFIG_CMD_ARM_MMUINFO=y > CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y > CONFIG_ARM_UNWIND=y > +CONFIG_PBL_IMAGE=y > +CONFIG_PBL_RELOCATABLE=y > CONFIG_MMU=y > -CONFIG_TEXT_BASE=0x8f00 > -CONFIG_MALLOC_SIZE=0x200 > +CONFIG_TEXT_BASE=0x0 > +CONFIG_MALLOC_SIZE=0x0 > +CONFIG_MALLOC_TLSF=y > +CONFIG_KALLSYMS=y > +CONFIG_RELOCATABLE=y > CONFIG_PROMPT="barebox@pcm051>" > CONFIG_LONGHELP=y > CONFIG_HUSH_FANCY_PROMPT=y > @@ -21,9 +26,6 @@ CONFIG_MENU=y > CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y > CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/pcm051/env" > CONFIG_DEBUG_INFO=y > -CONFIG_ENABLE_FLASH_NOISE=y > -CONFIG_ENABLE_PARTITION_NOISE=y > -CONFIG_ENABLE_DEVICE_NOISE=y > CONFIG_CMD_EDIT=y > CONFIG_CMD_SLEEP=y > CONFIG_CMD_SAVEENV=y > @@ -44,6 +46,7 @@ CONFIG_CMD_UBIFORMAT=y > CONFIG_CMD_BOOTM_SHOW_TYPE=y > CONFIG_CMD_UIMAGE=y > CONFIG_CMD_BOOTZ=y > +# CONFIG_CMD_BOOTU is not set > CONFIG_CMD_RESET=y > CONFIG_CMD_GO=y > CONFIG_CMD_BAREBOX_UPDATE=y > @@ -57,6 +60,8 @@ CONFIG_NET=y > CONFIG_NET_DHCP=y > CONFIG_NET_NFS=y > CONFIG_NET_PING=y > +CONFIG_OFDEVICE=y > +CONFIG_OF_BAREBOX_DRIVERS=y > CONFIG_DRIVER_SERIAL_NS16550=y > CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y > CONFIG_DRIVER_NET_CPSW=y > @@ -67,13 +72,16 @@ CONFIG_MTD=y > CONFIG_MTD_M25P80=y > CONFIG_NAND=y > CONFIG_NAND_OMAP_GPMC=y > -CONFIG_UBI=y > +CONFIG_MTD_UBI=y > CONFIG_USB=y > CONFIG_MCI=y > CONFIG_MCI_STARTUP=y > CONFIG_MCI_OMAP_HSMMC=y > CONFIG_EEPROM_AT24=y > CONFIG_GPIO_GENERIC_PLATFORM=y > +CONFIG_PINCTRL=y > +CONFIG_PINCTRL_SINGLE=y > +CONFIG_BUS_OMAP_GPMC=y > CONFIG_FS_TFTP=y > CONFIG_FS_NFS=y > CONFIG_FS_FAT=y > diff --git a/arch/arm/configs/pcm051_mlo_defconfig > b/arch/arm/configs/pcm051_mlo_defconfig > index ea65979..4f6a7b1 100644 > --- a/arch/arm/configs/pcm051_mlo_defconfig > +++ b/arch/arm/configs/pcm051_mlo_defconfig > @@ -1,8 +1,8 @@ > +CONFIG_BUILTIN_DTB=y > +CONFIG_BUILTIN_DTB_NAME="am335x-phytec-phycore" > CONFIG_ARCH_OMAP=y > -CONFIG_ARCH_AM33XX=y > CONFIG_OMAP_BUILD_IFT=y > CONFIG_MACH_PCM051=y > -CONFIG_OMAP_UART1=y > CONFIG_THUMB2_BAREBOX=y > # CONFIG_CMD_ARM_CPUINFO is not set > # CONFIG_MEMINFO is not set > @@ -17,6 +17,7 @@ CONFIG_SHELL_NONE=y > # CONFIG_TIMESTAMP is not set > CONFIG_CONSOLE_SIMPLE=y > # CONFIG_DEFAULT_ENVIRONMENT is not set > +CONFIG_OFDEVICE=y > CONFIG_DRIVER_SERIAL_NS16550=y > CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y > CONFIG_DRIVER_SPI_OMAP3=y > @@ -27,6 +28,9 @@ CONFIG_NAND_OMAP_GPMC=y > CONFIG_MCI=y > CONFIG_MCI_STARTUP=y > CONFIG_MCI_OMAP_HSMMC=y > +CONFIG_PINCTRL=y > +CONFIG_PINCTRL_SINGLE=y > +CONFIG_BUS_OMAP_GPMC=y > # CONFIG_FS_RAMFS is not set > # CONFIG_FS_DEVFS is not set > CONFIG_FS_FAT=y ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: How to debug Ethernet connectivity
Ok, then my problem is slightly more clear, that /dev/phy0 does not exist. I do define a struct fec_platform_data with xcv_type=PHY_INTERFACE_MODE_MII and register it via imx27_add_fec(). Now I need to find out why it fails to register the device. On Fri, Dec 6, 2013 at 1:43 PM, Alexander Aring wrote: > On Fri, Dec 06, 2013 at 01:39:25PM +0100, Sascha Hauer wrote: >> On Fri, Dec 06, 2013 at 01:18:52PM +0100, Atilla Filiz wrote: >> > Sorry, figured it out. Just most verbose output is funny as well: >> > :/ miitool -vvv /dev/mc13xxx >> >> Don't know what miitool does in this case, but mc13xxx is not your phy, >> it's your PMIC. >> > > oh, doesn't realize that :D. So reading zeros can make sense in some > offset. :-) > > - Alex -- Atilla Filiz ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] scripts: add arch/x86/lib/barebox.lds to gitignore
On Tue, Dec 10, 2013 at 03:42:53PM +0800, Kevin Du Huanpeng wrote: > I want to say "thank you" to Alex, :) you are welcome - Alex ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox