diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-09 09:26:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-09 09:26:43 +0200 |
commit | ee2ac17df0a9acdc49dc776668cc693eaebb330e (patch) | |
tree | 12af16949f8ec7ea106bd7c4c090a94ff043364b /arch | |
parent | d47e89a45d8ee57c31e6afcdfcbc1288dcaa27a6 (diff) | |
parent | 0b06cf7edf84f37e8b5fcdee2819cf4f59934593 (diff) | |
download | barebox-ee2ac17df0a9acdc49dc776668cc693eaebb330e.tar.gz barebox-ee2ac17df0a9acdc49dc776668cc693eaebb330e.tar.xz |
Merge branch 'for-next/am33xx'
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/dts/am335x-phytec-phycard-som-mlo.dts | 1 | ||||
-rw-r--r-- | arch/arm/dts/am335x-phytec-phycore-som-mlo.dts | 1 | ||||
-rw-r--r-- | arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts | 1 | ||||
-rw-r--r-- | arch/arm/dts/am33xx-strip.dtsi | 48 | ||||
-rw-r--r-- | arch/arm/mach-omap/Kconfig | 9 | ||||
-rw-r--r-- | arch/arm/mach-omap/am33xx_generic.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap/xload.c | 51 |
7 files changed, 114 insertions, 0 deletions
diff --git a/arch/arm/dts/am335x-phytec-phycard-som-mlo.dts b/arch/arm/dts/am335x-phytec-phycard-som-mlo.dts index 17d9152977..f9ed627120 100644 --- a/arch/arm/dts/am335x-phytec-phycard-som-mlo.dts +++ b/arch/arm/dts/am335x-phytec-phycard-som-mlo.dts @@ -9,6 +9,7 @@ #include "am33xx.dtsi" #include "am335x-phytec-phycard-som.dtsi" +#include "am33xx-strip.dtsi" / { model = "Phytec phyCARD AM335x"; diff --git a/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts b/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts index b08a59e0f5..f70835f8cd 100644 --- a/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts +++ b/arch/arm/dts/am335x-phytec-phycore-som-mlo.dts @@ -9,6 +9,7 @@ #include "am33xx.dtsi" #include "am335x-phytec-phycore-som.dtsi" +#include "am33xx-strip.dtsi" / { model = "Phytec phyCORE AM335x"; diff --git a/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts b/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts index 5294ff5976..736d7ef664 100644 --- a/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts +++ b/arch/arm/dts/am335x-phytec-phyflex-som-mlo.dts @@ -9,6 +9,7 @@ #include "am33xx.dtsi" #include "am335x-phytec-phyflex-som.dtsi" +#include "am33xx-strip.dtsi" / { model = "Phytec phyFLEX AM335x"; diff --git a/arch/arm/dts/am33xx-strip.dtsi b/arch/arm/dts/am33xx-strip.dtsi new file mode 100644 index 0000000000..3dc9a5798a --- /dev/null +++ b/arch/arm/dts/am33xx-strip.dtsi @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2015 PHYTEC Messtechnik GmbH, + * Author: Wadim Egorov <w.egorov@phytec.de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/ { + aliases { + /delete-property/ i2c1; + /delete-property/ i2c2; + /delete-property/ mmc0; + /delete-property/ mmc1; + /delete-property/ mmc2; + /delete-property/ d_can0; + /delete-property/ d_can1; + }; +}; + +/delete-node/ &i2c1; +/delete-node/ &i2c2; +/delete-node/ &mmc2; +/delete-node/ &mmc3; +/delete-node/ &hwspinlock; +/delete-node/ &wdt2; +/delete-node/ &dcan0; +/delete-node/ &dcan1; +/delete-node/ &mailbox; +/delete-node/ &timer1; +/delete-node/ &timer2; +/delete-node/ &timer3; +/delete-node/ &timer4; +/delete-node/ &timer5; +/delete-node/ &timer6; +/delete-node/ &timer7; +/delete-node/ &spi1; +/delete-node/ &epwmss0; +/delete-node/ &epwmss1; +/delete-node/ &epwmss2; +/delete-node/ &lcdc; +/delete-node/ &tscadc; +/delete-node/ &sham; +/delete-node/ &aes; +/delete-node/ &mcasp0; +/delete-node/ &mcasp1; +/delete-node/ &rng; diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index 444ddf8377..bc00d5bf7f 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -110,6 +110,15 @@ config ARCH_TEXT_BASE default 0x80e80000 if MACH_OMAP343xSDP default 0x80e80000 if MACH_BEAGLE +config AM33XX_NET_BOOT + bool "enable AM335x network boot" + select ENVIRONMENT_VARIABLES + select NET_DHCP + select FS_TFTP + select DRIVER_NET_CPSW + default n + depends on ARCH_AM33XX && NET + config OMAP4_USBBOOT bool "enable booting from USB" default n diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c index ee30351fa4..7ce32f01e1 100644 --- a/arch/arm/mach-omap/am33xx_generic.c +++ b/arch/arm/mach-omap/am33xx_generic.c @@ -145,6 +145,9 @@ static int am33xx_bootsource(void) case 0x44: src = BOOTSOURCE_USB; break; + case 0x46: + src = BOOTSOURCE_NET; + break; default: src = BOOTSOURCE_UNKNOWN; } diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index 7c8c350114..85c9120ccf 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -13,6 +13,10 @@ #include <filetype.h> #include <xymodem.h> #include <mach/generic.h> +#include <mach/am33xx-generic.h> +#include <net.h> +#include <environment.h> +#include <dhcp.h> struct omap_barebox_part *barebox_part; @@ -224,6 +228,45 @@ static void *omap_serial_boot(void){ return buf; } +static void *am33xx_net_boot(void) +{ + void *buf = NULL; + int err; + int len; + struct dhcp_req_param dhcp_param; + const char *bootfile; + + am33xx_register_ethaddr(0, 0); + + memset(&dhcp_param, 0, sizeof(struct dhcp_req_param)); + dhcp_param.vendor_id = "am335x barebox-mlo"; + err = dhcp(20, &dhcp_param); + if (err) { + printf("dhcp failed\n"); + return NULL; + } + + err = mount(ip_to_string(net_get_serverip()), "tftp", "/", NULL); + if (err < 0) { + printf("Unable to mount.\n"); + return NULL; + } + + bootfile = getenv("bootfile"); + if (!bootfile) { + printf("bootfile not found.\n"); + return NULL; + } + + buf = read_file(bootfile, &len); + if (!buf) + printf("could not read %s.\n", bootfile); + + umount("/"); + + return buf; +} + /* * Replaces the default shell in xload configuration */ @@ -264,6 +307,14 @@ static __noreturn int omap_xload(void) func = omap_serial_boot(); break; } + case BOOTSOURCE_NET: + if (IS_ENABLED(CONFIG_AM33XX_NET_BOOT)) { + printf("booting from NET\n"); + func = am33xx_net_boot(); + break; + } else { + printf("booting from network not enabled\n"); + } default: printf("unknown boot source. Fall back to nand\n"); func = omap_xload_boot_nand(barebox_part->nand_offset, |