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); 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_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 diff --git a/arch/arm/configs/am335x_mlo_defconfig b/arch/arm/configs/am335x_mlo_defconfig index d691570..9734da6 100644 --- a/arch/arm/configs/am335x_mlo_defconfig +++ b/arch/arm/configs/am335x_mlo_defconfig @@ -1,12 +1,12 @@ CONFIG_ARCH_OMAP=y CONFIG_OMAP_BUILD_IFT=y +CONFIG_OMAP_SERIALBOOT=y CONFIG_OMAP_MULTI_BOARDS=y CONFIG_MACH_AFI_GF=y CONFIG_MACH_BEAGLEBONE=y CONFIG_MACH_PCM051=y CONFIG_MACH_PFLA03=y CONFIG_THUMB2_BAREBOX=y -# CONFIG_CMD_ARM_CPUINFO is not set # CONFIG_MEMINFO is not set CONFIG_MMU=y CONFIG_TEXT_BASE=0x0 @@ -37,10 +37,8 @@ CONFIG_MCI=y # CONFIG_MCI_WRITE is not set 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 CONFIG_FS_FAT_LFN=y diff --git a/arch/arm/dts/am335x-phytec-phycore-som.dtsi b/arch/arm/dts/am335x-phytec-phycore-som.dtsi index f1bcb8b..7e099a2 100644 --- a/arch/arm/dts/am335x-phytec-phycore-som.dtsi +++ b/arch/arm/dts/am335x-phytec-phycore-som.dtsi @@ -75,7 +75,6 @@ 0x18 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */ 0x1c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */ 0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */ - 0x74 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */ 0x7c (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */ 0x90 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */ 0x94 (PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */ diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index f9b5ec3..0996ed9 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -118,6 +118,15 @@ You need the utility program omap4_usbboot to boot from USB. Please read omap4_usb_booting.txt for more information. +config OMAP_SERIALBOOT + bool "enable booting from serial" + select XYMODEM + select FS_RAMFS + depends on ARCH_AM33XX && SHELL_NONE + help + Say Y here if you want to load the 2nd stage barebox.bin with + xmodem after booting from serial line. + 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 @@ 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 @@ 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,