diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-12-08 14:53:58 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-12-08 14:53:58 +0100 |
commit | 1e5b933b5d2538ea0ffeb86537c3996348ef9c64 (patch) | |
tree | ff4819225733f8e142b9ba2f00bc73c06ffc84b9 /arch | |
parent | 4b579fea5d22566f48ac84b2546cf4282c64b777 (diff) | |
parent | 4d6e582c7f927e812ceb19917d4c8633057852a8 (diff) | |
download | barebox-1e5b933b5d2538ea0ffeb86537c3996348ef9c64.tar.gz barebox-1e5b933b5d2538ea0ffeb86537c3996348ef9c64.tar.xz |
Merge branch 'for-next/am335x'
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boards/phytec-phyflex-am335x/board.c | 10 | ||||
-rw-r--r-- | arch/arm/configs/am335x_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/configs/am335x_mlo_defconfig | 4 | ||||
-rw-r--r-- | arch/arm/dts/am335x-phytec-phycore-som.dtsi | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap/Kconfig | 9 | ||||
-rw-r--r-- | arch/arm/mach-omap/xload.c | 46 |
6 files changed, 57 insertions, 14 deletions
diff --git a/arch/arm/boards/phytec-phyflex-am335x/board.c b/arch/arm/boards/phytec-phyflex-am335x/board.c index cf7dd2e936..f265e52f3a 100644 --- a/arch/arm/boards/phytec-phyflex-am335x/board.c +++ b/arch/arm/boards/phytec-phyflex-am335x/board.c @@ -32,21 +32,11 @@ #include <mach/am33xx-silicon.h> #include <mach/bbu.h> -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 a682fe4711..e9bc1ba309 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 diff --git a/arch/arm/configs/am335x_mlo_defconfig b/arch/arm/configs/am335x_mlo_defconfig index d691570ffe..9734da60c7 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_NAND_OMAP_GPMC=y 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 f1bcb8ba35..7e099a21ab 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 f9b5ec338f..0996ed9a06 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -118,6 +118,15 @@ 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 "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 e9d7bbb2e9..8d9d84c85c 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -11,6 +11,7 @@ #include <sizes.h> #include <malloc.h> #include <filetype.h> +#include <xymodem.h> #include <mach/generic.h> 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, |