mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] OMAP: Move bootsource functions
@ 2013-03-26 14:23 Teresa Gámez
  2013-03-26 14:23 ` [RFC PATCH 2/2] OMAP: Add option to use enviroment from MMC Teresa Gámez
  0 siblings, 1 reply; 4+ messages in thread
From: Teresa Gámez @ 2013-03-26 14:23 UTC (permalink / raw)
  To: barebox

The bootsource functions are not specific to the first stage
bootloader. They may also be used for detecting the
bootsource to decide where to load the enviroment from.

Also clean up includes in board files.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/boards/beagle/board.c            |    1 -
 arch/arm/boards/beaglebone/board.c        |    1 -
 arch/arm/boards/panda/board.c             |    2 +-
 arch/arm/boards/pcm049/board.c            |    1 -
 arch/arm/boards/phycard-a-l1/pca-a-l1.c   |    1 -
 arch/arm/boards/phycard-a-xl2/pca-a-xl2.c |    1 -
 arch/arm/mach-omap/Makefile               |    2 +-
 arch/arm/mach-omap/am33xx_generic.c       |    2 +-
 arch/arm/mach-omap/include/mach/generic.h |   16 ++++++++++++++
 arch/arm/mach-omap/include/mach/xload.h   |   16 --------------
 arch/arm/mach-omap/omap3_generic.c        |    2 +-
 arch/arm/mach-omap/omap4_generic.c        |    2 +-
 arch/arm/mach-omap/omap4_rom_usb.c        |    2 +-
 arch/arm/mach-omap/omap_generic.c         |   32 +++++++++++++++++++++++++++++
 arch/arm/mach-omap/xload.c                |   13 +----------
 15 files changed, 55 insertions(+), 39 deletions(-)
 delete mode 100644 arch/arm/mach-omap/include/mach/xload.h
 create mode 100644 arch/arm/mach-omap/omap_generic.c

diff --git a/arch/arm/boards/beagle/board.c b/arch/arm/boards/beagle/board.c
index bed4651..972c05e 100644
--- a/arch/arm/boards/beagle/board.c
+++ b/arch/arm/boards/beagle/board.c
@@ -62,7 +62,6 @@
 #include <i2c/i2c.h>
 #include <linux/err.h>
 #include <usb/ehci.h>
-#include <mach/xload.h>
 
 #ifdef CONFIG_DRIVER_SERIAL_NS16550
 
diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c
index e4b8b0a..56e69a2 100644
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -45,7 +45,6 @@
 #include <linux/err.h>
 #include <linux/phy.h>
 #include <usb/ehci.h>
-#include <mach/xload.h>
 #include <mach/am33xx-devices.h>
 #include <mach/am33xx-mux.h>
 #include <mach/wdt.h>
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index f1fbd5e..2518d3a 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -20,7 +20,7 @@
 #include <asm/mmu.h>
 #include <mach/gpio.h>
 #include <envfs.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
 #include <led.h>
diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c
index 680539a..b0d689b 100644
--- a/arch/arm/boards/pcm049/board.c
+++ b/arch/arm/boards/pcm049/board.c
@@ -36,7 +36,6 @@
 #include <mach/gpio.h>
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
-#include <mach/xload.h>
 #include <i2c/i2c.h>
 
 static int pcm049_console_init(void)
diff --git a/arch/arm/boards/phycard-a-l1/pca-a-l1.c b/arch/arm/boards/phycard-a-l1/pca-a-l1.c
index 234d689..7cf6ae8 100644
--- a/arch/arm/boards/phycard-a-l1/pca-a-l1.c
+++ b/arch/arm/boards/phycard-a-l1/pca-a-l1.c
@@ -54,7 +54,6 @@
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
 #include <mach/omap_hsmmc.h>
-#include <mach/xload.h>
 #include <mach/sdrc.h>
 #include <mach/omap3-silicon.h>
 #include <mach/sys_info.h>
diff --git a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c
index be7060f..8f79d98 100644
--- a/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c
+++ b/arch/arm/boards/phycard-a-xl2/pca-a-xl2.c
@@ -35,7 +35,6 @@
 #include <mach/gpio.h>
 #include <mach/gpmc.h>
 #include <mach/gpmc_nand.h>
-#include <mach/xload.h>
 #include <mach/omap_hsmmc.h>
 #include <mach/omap4-devices.h>
 #include <i2c/i2c.h>
diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index 38786b2..d9e00f7 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -15,7 +15,7 @@
 # GNU General Public License for more details.
 #
 #
-obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o
+obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o
 pbl-$(CONFIG_ARCH_OMAP) += syslib.o
 obj-$(CONFIG_OMAP_CLOCK_SOURCE_S32K) += s32k_clksource.o
 obj-$(CONFIG_OMAP_CLOCK_SOURCE_DMTIMER0) += dmtimer0.o
diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index d3014c2..059c55e 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -24,7 +24,7 @@
 #include <mach/am33xx-silicon.h>
 #include <mach/am33xx-clock.h>
 #include <mach/sys_info.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
 #include <mach/am33xx-generic.h>
 
 void __noreturn reset_cpu(unsigned long addr)
diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h
index c801a06..edc4f1d 100644
--- a/arch/arm/mach-omap/include/mach/generic.h
+++ b/arch/arm/mach-omap/include/mach/generic.h
@@ -1,3 +1,5 @@
+#ifndef _MACH_GENERIC_H
+#define _MACH_GENERIC_H
 
 /* I2C controller revisions */
 #define OMAP_I2C_REV_2			0x20
@@ -24,3 +26,17 @@
 #else
 #define cpu_is_omap4xxx()	(0)
 #endif
+
+enum omap_boot_src {
+	OMAP_BOOTSRC_UNKNOWN,
+	OMAP_BOOTSRC_MMC1,
+	OMAP_BOOTSRC_NAND,
+	OMAP_BOOTSRC_SPI1,
+	OMAP_BOOTSRC_USB1,
+};
+
+enum omap_boot_src am33xx_bootsrc(void);
+enum omap_boot_src omap3_bootsrc(void);
+enum omap_boot_src omap4_bootsrc(void);
+
+#endif
diff --git a/arch/arm/mach-omap/include/mach/xload.h b/arch/arm/mach-omap/include/mach/xload.h
deleted file mode 100644
index d632735..0000000
--- a/arch/arm/mach-omap/include/mach/xload.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _MACH_XLOAD_H
-#define _MACH_XLOAD_H
-
-enum omap_boot_src {
-	OMAP_BOOTSRC_UNKNOWN,
-	OMAP_BOOTSRC_MMC1,
-	OMAP_BOOTSRC_NAND,
-	OMAP_BOOTSRC_SPI1,
-	OMAP_BOOTSRC_USB1,
-};
-
-enum omap_boot_src am33xx_bootsrc(void);
-enum omap_boot_src omap3_bootsrc(void);
-enum omap_boot_src omap4_bootsrc(void);
-
-#endif /* _MACH_XLOAD_H */
diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index a21a938..10e03ae 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -40,7 +40,7 @@
 #include <mach/wdt.h>
 #include <mach/sys_info.h>
 #include <mach/syslib.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
 
 /**
  * @brief Reset the CPU
diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
index 2a09eb6..e1edffa 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -5,7 +5,7 @@
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-mux.h>
 #include <mach/syslib.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
 #include <mach/gpmc.h>
 #include <mach/gpio.h>
 #include <mach/omap4_rom_usb.h>
diff --git a/arch/arm/mach-omap/omap4_rom_usb.c b/arch/arm/mach-omap/omap4_rom_usb.c
index 48d6433..7825be3 100644
--- a/arch/arm/mach-omap/omap4_rom_usb.c
+++ b/arch/arm/mach-omap/omap4_rom_usb.c
@@ -33,7 +33,7 @@
 #include <common.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4_rom_usb.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
 #include <init.h>
 
 static struct omap4_usbboot omap4_usbboot_pdata;
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
new file mode 100644
index 0000000..f2fd1d3
--- /dev/null
+++ b/arch/arm/mach-omap/omap_generic.c
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2013 Teresa Gámez, Phytec Messtechnik GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#include <common.h>
+#include <envfs.h>
+#include <init.h>
+#include <io.h>
+#include <fs.h>
+#include <linux/stat.h>
+#include <mach/generic.h>
+
+enum omap_boot_src omap_bootsrc(void)
+{
+#if defined(CONFIG_ARCH_OMAP3)
+	return omap3_bootsrc();
+#elif defined(CONFIG_ARCH_OMAP4)
+	return omap4_bootsrc();
+#elif defined(CONFIG_ARCH_AM33XX)
+	return am33xx_bootsrc();
+#endif
+}
diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index 41533a9..72aa379 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -6,7 +6,7 @@
 #include <linux/mtd/mtd.h>
 #include <fs.h>
 #include <fcntl.h>
-#include <mach/xload.h>
+#include <mach/generic.h>
 #include <sizes.h>
 #include <filetype.h>
 
@@ -158,17 +158,6 @@ static void *omap4_xload_boot_usb(void){
 	return buf;
 }
 
-enum omap_boot_src omap_bootsrc(void)
-{
-#if defined(CONFIG_ARCH_OMAP3)
-	return omap3_bootsrc();
-#elif defined(CONFIG_ARCH_OMAP4)
-	return omap4_bootsrc();
-#elif defined(CONFIG_ARCH_AM33XX)
-	return am33xx_bootsrc();
-#endif
-}
-
 /*
  * Replaces the default shell in xload configuration
  */
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC PATCH 2/2] OMAP: Add option to use enviroment from MMC
  2013-03-26 14:23 [RFC PATCH 1/2] OMAP: Move bootsource functions Teresa Gámez
@ 2013-03-26 14:23 ` Teresa Gámez
  2013-03-26 20:17   ` Alexander Aring
  0 siblings, 1 reply; 4+ messages in thread
From: Teresa Gámez @ 2013-03-26 14:23 UTC (permalink / raw)
  To: barebox

Make loading enviroment from MMC generic for all OMAP.

Tested on AM335x, OMAP4.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Tested-by: Jan Weitzel <j.weitzel@phytec.de>
---
 arch/arm/boards/panda/board.c             |   30 ---------------------------
 arch/arm/mach-omap/include/mach/generic.h |    1 +
 arch/arm/mach-omap/omap_generic.c         |   32 +++++++++++++++++++++++++++++
 3 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index 2518d3a..d1f9a5e 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -1,12 +1,10 @@
 #include <common.h>
 #include <console.h>
 #include <init.h>
-#include <fs.h>
 #include <driver.h>
 #include <io.h>
 #include <ns16550.h>
 #include <asm/armlinux.h>
-#include <linux/stat.h>
 #include <generated/mach-types.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-devices.h>
@@ -20,7 +18,6 @@
 #include <asm/mmu.h>
 #include <mach/gpio.h>
 #include <envfs.h>
-#include <mach/generic.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
 #include <led.h>
@@ -164,30 +161,3 @@ static int panda_devices_init(void)
 	return 0;
 }
 device_initcall(panda_devices_init);
-
-#ifdef CONFIG_DEFAULT_ENVIRONMENT
-static int panda_env_init(void)
-{
-	struct stat s;
-	char *diskdev = "/dev/disk0.0";
-	int ret;
-
-	ret = stat(diskdev, &s);
-	if (ret) {
-		printf("no %s. using default env\n", diskdev);
-		return 0;
-	}
-
-	mkdir ("/boot", 0666);
-	ret = mount(diskdev, "fat", "/boot");
-	if (ret) {
-		printf("failed to mount %s\n", diskdev);
-		return 0;
-	}
-
-	default_environment_path = "/boot/bareboxenv";
-
-	return 0;
-}
-late_initcall(panda_env_init);
-#endif
diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h
index edc4f1d..7455404 100644
--- a/arch/arm/mach-omap/include/mach/generic.h
+++ b/arch/arm/mach-omap/include/mach/generic.h
@@ -35,6 +35,7 @@ enum omap_boot_src {
 	OMAP_BOOTSRC_USB1,
 };
 
+enum omap_boot_src omap_bootsrc(void);
 enum omap_boot_src am33xx_bootsrc(void);
 enum omap_boot_src omap3_bootsrc(void);
 enum omap_boot_src omap4_bootsrc(void);
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
index f2fd1d3..5882794 100644
--- a/arch/arm/mach-omap/omap_generic.c
+++ b/arch/arm/mach-omap/omap_generic.c
@@ -30,3 +30,35 @@ enum omap_boot_src omap_bootsrc(void)
 	return am33xx_bootsrc();
 #endif
 }
+
+#if defined(CONFIG_DEFAULT_ENVIRONMENT) && defined(CONFIG_MCI_STARTUP)
+static int omap_env_init(void)
+{
+	struct stat s;
+	char *diskdev = "/dev/disk0.0";
+	int ret;
+
+	if (omap_bootsrc() != OMAP_BOOTSRC_MMC1)
+		return 0;
+
+	ret = stat(diskdev, &s);
+	if (ret) {
+		printf("no %s. using default env\n", diskdev);
+		return 0;
+	}
+
+	mkdir("/boot", 0666);
+	ret = mount(diskdev, "fat", "/boot");
+	if (ret) {
+		printf("failed to mount %s\n", diskdev);
+		return 0;
+	}
+
+	printf("Loading enviroment from MMC\n");
+
+	default_environment_path = "/boot/bareboxenv";
+
+	return 0;
+}
+late_initcall(omap_env_init);
+#endif
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH 2/2] OMAP: Add option to use enviroment from MMC
  2013-03-26 14:23 ` [RFC PATCH 2/2] OMAP: Add option to use enviroment from MMC Teresa Gámez
@ 2013-03-26 20:17   ` Alexander Aring
  2013-03-27  8:10     ` Teresa Gamez
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Aring @ 2013-03-26 20:17 UTC (permalink / raw)
  To: Teresa Gámez; +Cc: barebox

Hi,

On Tue, Mar 26, 2013 at 03:23:16PM +0100, Teresa Gámez wrote:
> Make loading enviroment from MMC generic for all OMAP.
> 
> Tested on AM335x, OMAP4.
>
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> Tested-by: Jan Weitzel <j.weitzel@phytec.de>
> ---
>  arch/arm/boards/panda/board.c             |   30 ---------------------------
>  arch/arm/mach-omap/include/mach/generic.h |    1 +
>  arch/arm/mach-omap/omap_generic.c         |   32 +++++++++++++++++++++++++++++
>  3 files changed, 33 insertions(+), 30 deletions(-)
> 
> diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
> index 2518d3a..d1f9a5e 100644
> --- a/arch/arm/boards/panda/board.c
> +++ b/arch/arm/boards/panda/board.c
> @@ -1,12 +1,10 @@
>  #include <common.h>
>  #include <console.h>
>  #include <init.h>
> -#include <fs.h>
>  #include <driver.h>
>  #include <io.h>
>  #include <ns16550.h>
>  #include <asm/armlinux.h>
> -#include <linux/stat.h>
>  #include <generated/mach-types.h>
>  #include <mach/omap4-silicon.h>
>  #include <mach/omap4-devices.h>
> @@ -20,7 +18,6 @@
>  #include <asm/mmu.h>
>  #include <mach/gpio.h>
>  #include <envfs.h>
> -#include <mach/generic.h>
>  #include <i2c/i2c.h>
>  #include <gpio.h>
>  #include <led.h>
> @@ -164,30 +161,3 @@ static int panda_devices_init(void)
>  	return 0;
>  }
>  device_initcall(panda_devices_init);
> -
> -#ifdef CONFIG_DEFAULT_ENVIRONMENT
> -static int panda_env_init(void)
> -{
> -	struct stat s;
> -	char *diskdev = "/dev/disk0.0";
> -	int ret;
> -
> -	ret = stat(diskdev, &s);
> -	if (ret) {
> -		printf("no %s. using default env\n", diskdev);
> -		return 0;
> -	}
> -
> -	mkdir ("/boot", 0666);
> -	ret = mount(diskdev, "fat", "/boot");
> -	if (ret) {
> -		printf("failed to mount %s\n", diskdev);
> -		return 0;
> -	}
> -
> -	default_environment_path = "/boot/bareboxenv";
> -
> -	return 0;
> -}
> -late_initcall(panda_env_init);
> -#endif

There is a second env_init in beaglebone:

late_initcall(beaglebone_env_init); in 
arch/arm/boards/beaglebone/board.c

I think you need to remove this too. Otherwise this will be called twice.

> diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h
> index edc4f1d..7455404 100644
> --- a/arch/arm/mach-omap/include/mach/generic.h
> +++ b/arch/arm/mach-omap/include/mach/generic.h
> @@ -35,6 +35,7 @@ enum omap_boot_src {
>  	OMAP_BOOTSRC_USB1,
>  };
>  
> +enum omap_boot_src omap_bootsrc(void);
>  enum omap_boot_src am33xx_bootsrc(void);
>  enum omap_boot_src omap3_bootsrc(void);
>  enum omap_boot_src omap4_bootsrc(void);
> diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
> index f2fd1d3..5882794 100644
> --- a/arch/arm/mach-omap/omap_generic.c
> +++ b/arch/arm/mach-omap/omap_generic.c
> @@ -30,3 +30,35 @@ enum omap_boot_src omap_bootsrc(void)
>  	return am33xx_bootsrc();
>  #endif
>  }
> +
> +#if defined(CONFIG_DEFAULT_ENVIRONMENT) && defined(CONFIG_MCI_STARTUP)
> +static int omap_env_init(void)
> +{
> +	struct stat s;
> +	char *diskdev = "/dev/disk0.0";
> +	int ret;
> +
> +	if (omap_bootsrc() != OMAP_BOOTSRC_MMC1)
> +		return 0;
> +
> +	ret = stat(diskdev, &s);
> +	if (ret) {
> +		printf("no %s. using default env\n", diskdev);
> +		return 0;
> +	}
> +
> +	mkdir("/boot", 0666);
> +	ret = mount(diskdev, "fat", "/boot");
> +	if (ret) {
> +		printf("failed to mount %s\n", diskdev);
> +		return 0;
> +	}
> +
> +	printf("Loading enviroment from MMC\n");

s/enviroment/environment
> +
> +	default_environment_path = "/boot/bareboxenv";
> +
> +	return 0;
> +}
> +late_initcall(omap_env_init);
> +#endif

The part in beaglebone/board.c checks for build in environment:
IS_ENABLED(CONFIG_OMAP_BUILD_IFT)

Maybe you can add this here, too. But remember to disable
CONFIG_OMAP_BUILD_IFT to use a mmc environment.

But maybe you can drop this here, because you check on
CONFIG_MCI_STARTUP.

Alex

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH 2/2] OMAP: Add option to use enviroment from MMC
  2013-03-26 20:17   ` Alexander Aring
@ 2013-03-27  8:10     ` Teresa Gamez
  0 siblings, 0 replies; 4+ messages in thread
From: Teresa Gamez @ 2013-03-27  8:10 UTC (permalink / raw)
  To: barebox

Am 26.03.2013 21:17, schrieb Alexander Aring:

> Hi,
>
> On Tue, Mar 26, 2013 at 03:23:16PM +0100, Teresa Gámez wrote:
>> Make loading enviroment from MMC generic for all OMAP.
>>
>> Tested on AM335x, OMAP4.
>>
>> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
>> Tested-by: Jan Weitzel <j.weitzel@phytec.de>
>> ---
>>   arch/arm/boards/panda/board.c             |   30 ---------------------------
>>   arch/arm/mach-omap/include/mach/generic.h |    1 +
>>   arch/arm/mach-omap/omap_generic.c         |   32 +++++++++++++++++++++++++++++
>>   3 files changed, 33 insertions(+), 30 deletions(-)
>>
>> diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
>> index 2518d3a..d1f9a5e 100644
>> --- a/arch/arm/boards/panda/board.c
>> +++ b/arch/arm/boards/panda/board.c
>> @@ -1,12 +1,10 @@
>>   #include <common.h>
>>   #include <console.h>
>>   #include <init.h>
>> -#include <fs.h>
>>   #include <driver.h>
>>   #include <io.h>
>>   #include <ns16550.h>
>>   #include <asm/armlinux.h>
>> -#include <linux/stat.h>
>>   #include <generated/mach-types.h>
>>   #include <mach/omap4-silicon.h>
>>   #include <mach/omap4-devices.h>
>> @@ -20,7 +18,6 @@
>>   #include <asm/mmu.h>
>>   #include <mach/gpio.h>
>>   #include <envfs.h>
>> -#include <mach/generic.h>
>>   #include <i2c/i2c.h>
>>   #include <gpio.h>
>>   #include <led.h>
>> @@ -164,30 +161,3 @@ static int panda_devices_init(void)
>>   	return 0;
>>   }
>>   device_initcall(panda_devices_init);
>> -
>> -#ifdef CONFIG_DEFAULT_ENVIRONMENT
>> -static int panda_env_init(void)
>> -{
>> -	struct stat s;
>> -	char *diskdev = "/dev/disk0.0";
>> -	int ret;
>> -
>> -	ret = stat(diskdev, &s);
>> -	if (ret) {
>> -		printf("no %s. using default env\n", diskdev);
>> -		return 0;
>> -	}
>> -
>> -	mkdir ("/boot", 0666);
>> -	ret = mount(diskdev, "fat", "/boot");
>> -	if (ret) {
>> -		printf("failed to mount %s\n", diskdev);
>> -		return 0;
>> -	}
>> -
>> -	default_environment_path = "/boot/bareboxenv";
>> -
>> -	return 0;
>> -}
>> -late_initcall(panda_env_init);
>> -#endif
> There is a second env_init in beaglebone:
>
> late_initcall(beaglebone_env_init); in
> arch/arm/boards/beaglebone/board.c
>
> I think you need to remove this too. Otherwise this will be called twice.

Oh, missed that one....

>
>> diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h
>> index edc4f1d..7455404 100644
>> --- a/arch/arm/mach-omap/include/mach/generic.h
>> +++ b/arch/arm/mach-omap/include/mach/generic.h
>> @@ -35,6 +35,7 @@ enum omap_boot_src {
>>   	OMAP_BOOTSRC_USB1,
>>   };
>>   
>> +enum omap_boot_src omap_bootsrc(void);
>>   enum omap_boot_src am33xx_bootsrc(void);
>>   enum omap_boot_src omap3_bootsrc(void);
>>   enum omap_boot_src omap4_bootsrc(void);
>> diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
>> index f2fd1d3..5882794 100644
>> --- a/arch/arm/mach-omap/omap_generic.c
>> +++ b/arch/arm/mach-omap/omap_generic.c
>> @@ -30,3 +30,35 @@ enum omap_boot_src omap_bootsrc(void)
>>   	return am33xx_bootsrc();
>>   #endif
>>   }
>> +
>> +#if defined(CONFIG_DEFAULT_ENVIRONMENT) && defined(CONFIG_MCI_STARTUP)
>> +static int omap_env_init(void)
>> +{
>> +	struct stat s;
>> +	char *diskdev = "/dev/disk0.0";
>> +	int ret;
>> +
>> +	if (omap_bootsrc() != OMAP_BOOTSRC_MMC1)
>> +		return 0;
>> +
>> +	ret = stat(diskdev, &s);
>> +	if (ret) {
>> +		printf("no %s. using default env\n", diskdev);
>> +		return 0;
>> +	}
>> +
>> +	mkdir("/boot", 0666);
>> +	ret = mount(diskdev, "fat", "/boot");
>> +	if (ret) {
>> +		printf("failed to mount %s\n", diskdev);
>> +		return 0;
>> +	}
>> +
>> +	printf("Loading enviroment from MMC\n");
> s/enviroment/environment
>> +
>> +	default_environment_path = "/boot/bareboxenv";
>> +
>> +	return 0;
>> +}
>> +late_initcall(omap_env_init);
>> +#endif
> The part in beaglebone/board.c checks for build in environment:
> IS_ENABLED(CONFIG_OMAP_BUILD_IFT)
>
> Maybe you can add this here, too. But remember to disable
> CONFIG_OMAP_BUILD_IFT to use a mmc environment.
>
> But maybe you can drop this here, because you check on
> CONFIG_MCI_STARTUP.

Is this used for the am335x_beaglebone_mlo_large_defconfig?

Teresa

> Alex


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-27  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 14:23 [RFC PATCH 1/2] OMAP: Move bootsource functions Teresa Gámez
2013-03-26 14:23 ` [RFC PATCH 2/2] OMAP: Add option to use enviroment from MMC Teresa Gámez
2013-03-26 20:17   ` Alexander Aring
2013-03-27  8:10     ` Teresa Gamez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox