Skip to contentSkip to conversation

am335x: NOR support

PATCH Superseded Tom Rini 3 participants 18 messages Jul 18, 2013 – Aug 13, 2013 Arm (32-bit)

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

v4 cover am335x: NOR support

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

The big changes in v4 are:
- Apply again to master which includes a few non-trivial updates, so the linker script got re-synced.
- After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Signature · 1 line
Tom
author
#1 lore raw

PATCH v4 1/8 am335x_evm: Drop useless CONFIG_ENV_IS_NOWHERE

We always set a CONFIG_ENV_IS_...somewhere... so drop the initial define of NOWHERE.

---
 include/configs/am335x_evm.h |    4 ----
 1 file changed, 4 deletions(-)
include/configs/am335x_evm.h +0 -4
index 0f12c75..ea8669a 100644
@@ -306,8 +306,6 @@
 #define CONFIG_ENV_OVERWRITE		1
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
-#define CONFIG_ENV_IS_NOWHERE
-
 /* Defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_FRAMEWORK
@@ -467,7 +465,6 @@
  * 0x442000 - 0x800000 : Userland
  */
 #if defined(CONFIG_SPI_BOOT)
-# undef CONFIG_ENV_IS_NOWHERE
 # define CONFIG_ENV_IS_IN_SPI_FLASH
 # define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
 # define CONFIG_ENV_OFFSET		(892 << 10) /* 892 KiB in */
@@ -515,7 +512,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND
 							   devices */
 #if !defined(CONFIG_SPI_BOOT)
-#undef CONFIG_ENV_IS_NOWHERE
 #define CONFIG_ENV_IS_IN_NAND
 #define CONFIG_ENV_OFFSET		0x260000 /* environment starts here */
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH v4 2/8 am335x_evm: Update SPI_BOOT support, add MTDPARTS info

In reply to Tom Rini

- Style cleanup (# define -> #define)
- Due to ROM issues, redudant loading isn't feasible, so drop.
- Given extra space, increase max size of U-Boot to 512KiB
- Correct env size to match usage (we had not re-defined ENV_SIZE).
- Given extra space, keep env size as 128KiB, add redundant environment.

---
Changes in v2:
- Correct physmap -> m25p80 in mtdparts (Peter K).
- Style fixups, drop redundant SPL space, add redundant environment.

---
 include/configs/am335x_evm.h |   33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)
include/configs/am335x_evm.h +19 -14
index ea8669a..cc2da92 100644
@@ -367,7 +367,7 @@
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_BUS		0
 #define CONFIG_SPL_SPI_CS		0
-#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x80000
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
 #define CONFIG_SPL_MUSB_NEW_SUPPORT
 #define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/am33xx/u-boot-spl.lds"
 
@@ -453,22 +453,27 @@
 #endif
 
 /*
- * Default to using SPI for environment, etc.  We have multiple copies
- * of SPL as the ROM will check these locations.
- * 0x0 - 0x20000 : First copy of SPL
- * 0x20000 - 0x40000 : Second copy of SPL
- * 0x40000 - 0x60000 : Third copy of SPL
- * 0x60000 - 0x80000 : Fourth copy of SPL
- * 0x80000 - 0xDF000 : U-Boot
- * 0xDF000 - 0xE0000 : U-Boot Environment
- * 0xE0000 - 0x442000 : Linux Kernel
+ * Default to using SPI for environment, etc.
+ * 0x000000 - 0x020000 : SPL (128KiB)
+ * 0x020000 - 0x0A0000 : U-Boot (512KiB)
+ * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB)
+ * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB)
+ * 0x0E0000 - 0x442000 : Linux Kernel
  * 0x442000 - 0x800000 : Userland
  */
 #if defined(CONFIG_SPI_BOOT)
-# define CONFIG_ENV_IS_IN_SPI_FLASH
-# define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
-# define CONFIG_ENV_OFFSET		(892 << 10) /* 892 KiB in */
-# define CONFIG_ENV_SECT_SIZE		(4 << 10) /* 4 KB sectors */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_ENV_SECT_SIZE		(4 << 10) /* 4 KB sectors */
+#define CONFIG_ENV_OFFSET		(768 << 10) /* 768 KiB in */
+#define CONFIG_ENV_OFFSET_REDUND	(896 << 10) /* 896 KiB in */
+#define CONFIG_CMD_MTDPARTS
+#define MTDIDS_DEFAULT			"nor0=m25p80-flash.0"
+#define MTDPARTS_DEFAULT		"mtdparts=m25p80-flash.0:128k(SPL)," \
+					"512k(u-boot),128k(u-boot-env1)," \
+					"128k(u-boot-env2),3464k(kernel)," \
+					"-(rootfs)"
 #endif /* SPI support */
 
 /* Unsupported features */
Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH v4 3/8 am335x_evm: Only set CONFIG_NAND when !CONFIG_SPI_BOOT

In reply to Tom Rini

Due to hardware design the board supported by the am335x_evm config cannot have both NAND and SPI (or NOR) enabled at the same time due to conflicts. Disable the NAND SW stack when we know we can't have it present.

---
Changes in v4:
- Rework location, and note that when merged this should be dropped in favor of Justin Waters' approach in his series
Changes in v2:
- Reword commit message

---
 include/configs/am335x_evm.h |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
include/configs/am335x_evm.h +8 -3
index cc2da92..c00a97f 100644
@@ -42,6 +42,10 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE       64
 
+#if !defined(CONFIG_SPI_BOOT)
+#define CONFIG_NAND
+#endif
+
 /* commands to include */
 #include <config_cmd_default.h>
 
@@ -231,7 +235,9 @@
 /* USB Device Firmware Update support */
 #define CONFIG_DFU_FUNCTION
 #define CONFIG_DFU_MMC
+#ifdef CONFIG_NAND
 #define CONFIG_DFU_NAND
+#endif
 #define CONFIG_CMD_DFU
 #define DFU_ALT_INFO_MMC \
 	"boot part 0 1;" \
@@ -372,11 +378,13 @@
 #define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/am33xx/u-boot-spl.lds"
 
 #define CONFIG_SPL_BOARD_INIT
+#ifdef CONFIG_NAND
 #define CONFIG_SPL_NAND_AM33XX_BCH
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
+#endif
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
 					 CONFIG_SYS_NAND_PAGE_SIZE)
@@ -497,7 +505,6 @@
 #define CONFIG_PHY_ADDR			0
 #define CONFIG_PHY_SMSC
 
-#define CONFIG_NAND
 /* NAND support */
 #ifdef CONFIG_NAND
 #define CONFIG_CMD_NAND
@@ -516,11 +523,9 @@
 							/* CS0 */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND
 							   devices */
-#if !defined(CONFIG_SPI_BOOT)
 #define CONFIG_ENV_IS_IN_NAND
 #define CONFIG_ENV_OFFSET		0x260000 /* environment starts here */
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
 #endif
-#endif
 
 #endif	/* ! __CONFIG_AM335X_EVM_H */
Signature · 1 line
1.7.9.5
author
#4 lore raw

PATCH v4 4/8 am335x_evm: Rework board_is_foo() checks

In reply to Tom Rini

We rework the various board_is_foo() checks to take a pointer to struct am335x_baseboard_id rather than using a local copy in board.c. This allows us to make use of the same checks in mux.c as well as fixing problems when this code could be running from read-only memory.

---
Changes in v2:
- Fix checkpatch warnings

---
 board/ti/am335x/board.c |   80 ++++++++++++++++-------------------------------
 board/ti/am335x/board.h |   31 ++++++++++++++++++
 board/ti/am335x/mux.c   |   10 +++---
 3 files changed, 63 insertions(+), 58 deletions(-)
board/ti/am335x/board.c +27 -53
index fdbe26c..a645d30 100644
@@ -48,43 +48,10 @@ static struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
 
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
-static struct am335x_baseboard_id __attribute__((section (".data"))) header;
-
-static inline int board_is_bone(void)
-{
-	return !strncmp(header.name, "A335BONE", HDR_NAME_LEN);
-}
-
-static inline int board_is_bone_lt(void)
-{
-	return !strncmp(header.name, "A335BNLT", HDR_NAME_LEN);
-}
-
-static inline int board_is_evm_sk(void)
-{
-	return !strncmp("A335X_SK", header.name, HDR_NAME_LEN);
-}
-
-static inline int board_is_idk(void)
-{
-	return !strncmp(header.config, "SKU#02", 6);
-}
-
-static int __maybe_unused board_is_gp_evm(void)
-{
-	return !strncmp("A33515BB", header.name, 8);
-}
-
-int board_is_evm_15_or_later(void)
-{
-	return (!strncmp("A33515BB", header.name, 8) &&
-		strncmp("1.5", header.version, 3) <= 0);
-}
-
 /*
  * Read header information from EEPROM into global structure.
  */
-static int read_eeprom(void)
+static int read_eeprom(struct am335x_baseboard_id *header)
 {
 	/* Check if baseboard eeprom is available */
 	if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) {
@@ -94,28 +61,28 @@ static int read_eeprom(void)
 	}
 
 	/* read the eeprom using i2c */
-	if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, (uchar *)&header,
-							sizeof(header))) {
+	if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, (uchar *)header,
+		     sizeof(struct am335x_baseboard_id))) {
 		puts("Could not read the EEPROM; something fundamentally"
 			" wrong on the I2C bus.\n");
 		return -EIO;
 	}
 
-	if (header.magic != 0xEE3355AA) {
+	if (header->magic != 0xEE3355AA) {
 		/*
 		 * read the eeprom using i2c again,
 		 * but use only a 1 byte address
 		 */
-		if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 1,
-					(uchar *)&header, sizeof(header))) {
+		if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 1, (uchar *)header,
+			     sizeof(struct am335x_baseboard_id))) {
 			puts("Could not read the EEPROM; something "
 				"fundamentally wrong on the I2C bus.\n");
 			return -EIO;
 		}
 
-		if (header.magic != 0xEE3355AA) {
+		if (header->magic != 0xEE3355AA) {
 			printf("Incorrect magic number (0x%x) in EEPROM\n",
-					header.magic);
+					header->magic);
 			return -EINVAL;
 		}
 	}
@@ -289,12 +256,14 @@ int spl_start_uboot(void)
  */
 void s_init(void)
 {
+#ifdef CONFIG_SPL_BUILD
+	struct am335x_baseboard_id header;
+
 	/*
 	 * Save the boot parameters passed from romcode.
 	 * We cannot delay the saving further than this,
 	 * to prevent overwrites.
 	 */
-#ifdef CONFIG_SPL_BUILD
 	save_omap_boot_params();
 #endif
 
@@ -343,11 +312,11 @@ void s_init(void)
 	/* Initalize the board header */
 	enable_i2c0_pin_mux();
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-	if (read_eeprom() < 0)
+	if (read_eeprom(&header) < 0)
 		puts("Could not get board ID.\n");
 
 	enable_board_pin_mux(&header);
-	if (board_is_evm_sk()) {
+	if (board_is_evm_sk(&header)) {
 		/*
 		 * EVM SK 1.2A and later use gpio0_7 to enable DDR3.
 		 * This is safe enough to do on older revs.
@@ -356,15 +325,15 @@ void s_init(void)
 		gpio_direction_output(GPIO_DDR_VTT_EN, 1);
 	}
 
-	if (board_is_evm_sk())
+	if (board_is_evm_sk(&header))
 		config_ddr(303, MT41J128MJT125_IOCTRL_VALUE, &ddr3_data,
 			   &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
-	else if (board_is_bone_lt())
+	else if (board_is_bone_lt(&header))
 		config_ddr(400, MT41K256M16HA125E_IOCTRL_VALUE,
 			   &ddr3_beagleblack_data,
 			   &ddr3_beagleblack_cmd_ctrl_data,
 			   &ddr3_beagleblack_emif_reg_data, 0);
-	else if (board_is_evm_15_or_later())
+	else if (board_is_evm_15_or_later(&header))
 		config_ddr(303, MT41J512M8RH125_IOCTRL_VALUE, &ddr3_evm_data,
 			   &ddr3_evm_cmd_ctrl_data, &ddr3_evm_emif_reg_data, 0);
 	else
@@ -378,10 +347,6 @@ void s_init(void)
  */
 int board_init(void)
 {
-	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-	if (read_eeprom() < 0)
-		puts("Could not get board ID.\n");
-
 	gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;
 
 	gpmc_init();
@@ -394,6 +359,10 @@ int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	char safe_string[HDR_NAME_LEN + 1];
+	struct am335x_baseboard_id header;
+
+	if (read_eeprom(&header) < 0)
+		puts("Could not get board ID.\n");
 
 	/* Now set variables based on the header. */
 	strncpy(safe_string, (char *)header.name, sizeof(header.name));
@@ -457,6 +426,7 @@ int board_eth_init(bd_t *bis)
 	int rv, n = 0;
 	uint8_t mac_addr[6];
 	uint32_t mac_hi, mac_lo;
+	__maybe_unused struct am335x_baseboard_id header;
 
 	/* try reading mac address from efuse */
 	mac_lo = readl(&cdev->macid0l);
@@ -478,7 +448,11 @@ int board_eth_init(bd_t *bis)
 	}
 
 #ifdef CONFIG_DRIVER_TI_CPSW
-	if (board_is_bone() || board_is_bone_lt() || board_is_idk()) {
+	if (read_eeprom(&header) < 0)
+		puts("Could not get board ID.\n");
+
+	if (board_is_bone(&header) || board_is_bone_lt(&header) ||
+	    board_is_idk(&header)) {
 		writel(MII_MODE_ENABLE, &cdev->miisel);
 		cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
 				PHY_INTERFACE_MODE_MII;
@@ -507,7 +481,7 @@ int board_eth_init(bd_t *bis)
 #define AR8051_DEBUG_RGMII_CLK_DLY_REG	0x5
 #define AR8051_RGMII_TX_CLK_DLY		0x100
 
-	if (board_is_evm_sk() || board_is_gp_evm()) {
+	if (board_is_evm_sk(&header) || board_is_gp_evm(&header)) {
 		const char *devname;
 		devname = miiphy_get_current_dev();
 
board/ti/am335x/board.h +31 -0
index 48e112e..36ccaec 100644
@@ -37,6 +37,37 @@ struct am335x_baseboard_id {
 	char mac_addr[HDR_NO_OF_MAC_ADDR][HDR_ETH_ALEN];
 };
 
+static inline int board_is_bone(struct am335x_baseboard_id *header)
+{
+	return !strncmp(header->name, "A335BONE", HDR_NAME_LEN);
+}
+
+static inline int board_is_bone_lt(struct am335x_baseboard_id *header)
+{
+	return !strncmp(header->name, "A335BNLT", HDR_NAME_LEN);
+}
+
+static inline int board_is_evm_sk(struct am335x_baseboard_id *header)
+{
+	return !strncmp("A335X_SK", header->name, HDR_NAME_LEN);
+}
+
+static inline int board_is_idk(struct am335x_baseboard_id *header)
+{
+	return !strncmp(header->config, "SKU#02", 6);
+}
+
+static inline int board_is_gp_evm(struct am335x_baseboard_id *header)
+{
+	return !strncmp("A33515BB", header->name, HDR_NAME_LEN);
+}
+
+static inline int board_is_evm_15_or_later(struct am335x_baseboard_id *header)
+{
+	return (board_is_gp_evm(header) &&
+		strncmp("1.5", header->version, 3) <= 0);
+}
+
 /*
  * We have three pin mux functions that must exist.  We must be able to enable
  * uart0, for initial output and i2c0 to read the main EEPROM.  We then have a
board/ti/am335x/mux.c +5 -5
index 0283708..2e09d98 100644
@@ -262,13 +262,13 @@ static unsigned short detect_daughter_board_profile(void)
 void enable_board_pin_mux(struct am335x_baseboard_id *header)
 {
 	/* Do board-specific muxes. */
-	if (!strncmp(header->name, "A335BONE", HDR_NAME_LEN)) {
+	if (board_is_bone(header)) {
 		/* Beaglebone pinmux */
 		configure_module_pin_mux(i2c1_pin_mux);
 		configure_module_pin_mux(mii1_pin_mux);
 		configure_module_pin_mux(mmc0_pin_mux);
 		configure_module_pin_mux(mmc1_pin_mux);
-	} else if (!strncmp(header->config, "SKU#01", 6)) {
+	} else if (board_is_gp_evm(header)) {
 		/* General Purpose EVM */
 		unsigned short profile = detect_daughter_board_profile();
 		configure_module_pin_mux(rgmii1_pin_mux);
@@ -283,7 +283,7 @@ void enable_board_pin_mux(struct am335x_baseboard_id *header)
 			configure_module_pin_mux(mmc1_pin_mux);
 			configure_module_pin_mux(spi0_pin_mux);
 		}
-	} else if (!strncmp(header->config, "SKU#02", 6)) {
+	} else if (board_is_idk(header)) {
 		/*
 		 * Industrial Motor Control (IDK)
 		 * note: IDK console is on UART3 by default.
@@ -292,13 +292,13 @@ void enable_board_pin_mux(struct am335x_baseboard_id *header)
 		 */
 		configure_module_pin_mux(mii1_pin_mux);
 		configure_module_pin_mux(mmc0_no_cd_pin_mux);
-	} else if (!strncmp(header->name, "A335X_SK", HDR_NAME_LEN)) {
+	} else if (board_is_evm_sk(header)) {
 		/* Starter Kit EVM */
 		configure_module_pin_mux(i2c1_pin_mux);
 		configure_module_pin_mux(gpio0_7_pin_mux);
 		configure_module_pin_mux(rgmii1_pin_mux);
 		configure_module_pin_mux(mmc0_pin_mux_sk_evm);
-	} else if (!strncmp(header->name, "A335BNLT", HDR_NAME_LEN)) {
+	} else if (board_is_bone_lt(header)) {
 		/* Beaglebone LT pinmux */
 		configure_module_pin_mux(i2c1_pin_mux);
 		configure_module_pin_mux(mii1_pin_mux);
Signature · 1 line
1.7.9.5
author
#5 lore raw

PATCH v4 5/8 am33xx: Correct gpmc_cfg->irqstatus/enable

In reply to Tom Rini

Based on our usage of the GPMC, either with NOR or NAND we do not need to be setting the irqstatus or irqenable bits and should clear them like we have historically.

---
 arch/arm/cpu/armv7/am33xx/mem.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/am33xx/mem.c +2 -2
index 45f5426..160edd8 100644
@@ -77,8 +77,8 @@ void gpmc_init(void)
 
 	/* global settings */
 	writel(0x00000008, &gpmc_cfg->sysconfig);
-	writel(0x00000100, &gpmc_cfg->irqstatus);
-	writel(0x00000100, &gpmc_cfg->irqenable);
+	writel(0x00000000, &gpmc_cfg->irqstatus);
+	writel(0x00000000, &gpmc_cfg->irqenable);
 	writel(0x00000012, &gpmc_cfg->config);
 	/*
 	 * Disable the GPMC0 config set by ROM code
Signature · 1 line
1.7.9.5
author
#6 lore raw

PATCH v4 6/8 am335x_evm: Add support for the NOR module on the memory cape

In reply to Tom Rini

From: Steve Kipisz <[email protected]>

This patch adds support for the NOR module that attaches to the memory cape for a Beaglebone board. This does not add booting support; only support so that you can boot from SD/MMC and see the NOR module so that it can be programmed.

[trini: Clean up config changes slightly]

---
Changes in v4:
- Split clearing of gpmc_cfg->irqstatus/irqenable into a separate patch Changes in v3:
- Reword comment in <asm/arch-am33xx/mem.h> to explain why STNOR values belong in here.
Changes in v2:
- Move GPMC config portion into board.c

---
 arch/arm/cpu/armv7/am33xx/mem.c        |    4 +++
 arch/arm/include/asm/arch-am33xx/mem.h |    9 ++++++
 board/ti/am335x/board.c                |   13 ++++++++
 board/ti/am335x/mux.c                  |   53 ++++++++++++++++++++++++++++++++
 boards.cfg                             |    1 +
 include/configs/am335x_evm.h           |   28 +++++++++++++++++
 6 files changed, 108 insertions(+)
arch/arm/cpu/armv7/am33xx/mem.c +4 -0
index 160edd8..ea44f87 100644
@@ -79,7 +79,11 @@ void gpmc_init(void)
 	writel(0x00000008, &gpmc_cfg->sysconfig);
 	writel(0x00000000, &gpmc_cfg->irqstatus);
 	writel(0x00000000, &gpmc_cfg->irqenable);
+#ifdef CONFIG_NOR
+	writel(0x00000200, &gpmc_cfg->config);
+#else
 	writel(0x00000012, &gpmc_cfg->config);
+#endif
 	/*
 	 * Disable the GPMC0 config set by ROM code
 	 */
arch/arm/include/asm/arch-am33xx/mem.h +9 -0
index c3bf74e..9ece266 100644
@@ -46,6 +46,7 @@
  *
  * Currently valid part Names are (PART):
  * M_NAND - Micron NAND
+ * STNOR - STMicrolelctronics M29W128GL
  */
 #define GPMC_SIZE_256M		0x0
 #define GPMC_SIZE_128M		0x8
@@ -61,6 +62,14 @@
 #define M_NAND_GPMC_CONFIG6	0x16000f80
 #define M_NAND_GPMC_CONFIG7	0x00000008
 
+#define STNOR_GPMC_CONFIG1	0x00001200
+#define STNOR_GPMC_CONFIG2	0x00101000
+#define STNOR_GPMC_CONFIG3	0x00030301
+#define STNOR_GPMC_CONFIG4	0x10041004
+#define STNOR_GPMC_CONFIG5	0x000C1010
+#define STNOR_GPMC_CONFIG6	0x08070280
+#define STNOR_GPMC_CONFIG7	0x00000F48
+
 /* max number of GPMC Chip Selects */
 #define GPMC_MAX_CS		8
 /* max number of GPMC regs */
board/ti/am335x/board.c +13 -0
index a645d30..7bcaa98 100644
@@ -27,6 +27,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/arch/mem.h>
 #include <asm/io.h>
 #include <asm/emif.h>
 #include <asm/gpio.h>
@@ -347,10 +348,22 @@ void s_init(void)
  */
 int board_init(void)
 {
+#ifdef CONFIG_NOR
+	const u32 gpmc_nor[GPMC_MAX_REG] = { STNOR_GPMC_CONFIG1,
+		STNOR_GPMC_CONFIG2, STNOR_GPMC_CONFIG3, STNOR_GPMC_CONFIG4,
+		STNOR_GPMC_CONFIG5, STNOR_GPMC_CONFIG6, STNOR_GPMC_CONFIG7 };
+#endif
+
 	gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;
 
 	gpmc_init();
 
+#ifdef CONFIG_NOR
+	/* Reconfigure CS0 for NOR instead of NAND. */
+	enable_gpmc_cs_config(gpmc_nor, &gpmc_cfg->cs[0],
+			      CONFIG_SYS_FLASH_BASE, GPMC_SIZE_16M);
+#endif
+
 	return 0;
 }
 
board/ti/am335x/mux.c +53 -0

65 lines not on this page · raw message

boards.cfg +1 -0
index 4e556e0..58ed412 100644
@@ -242,6 +242,7 @@ vexpress_ca15_tc2            arm         armv7       vexpress            armltd
 vexpress_ca5x2               arm         armv7       vexpress            armltd
 vexpress_ca9x4               arm         armv7       vexpress            armltd
 am335x_evm                   arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1
+am335x_evm_nor               arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NOR
 am335x_evm_spiboot           arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,SPI_BOOT
 am335x_evm_uart1             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL2,CONS_INDEX=2
 am335x_evm_uart2             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL3,CONS_INDEX=3
include/configs/am335x_evm.h +28 -0
index c00a97f..155f5d9 100644
@@ -528,4 +528,32 @@
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
 #endif
 
+/*
+ * NOR Size = 16 MiB
+ * Number of Sectors/Blocks = 128
+ * Sector Size = 128 KiB
+ * Word length = 16 bits
+ * Default layout:
+ * 0x000000 - 0x07FFFF : U-Boot (512 KiB)
+ * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB)
+ * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB)
+ * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB)
+ * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB)
+ */
+#if defined(CONFIG_NOR)
+#undef CONFIG_SYS_NO_FLASH
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_SYS_MAX_FLASH_SECT	128
+#define CONFIG_SYS_MAX_FLASH_BANKS	1
+#define CONFIG_SYS_FLASH_BASE		(0x08000000)
+#define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
+#define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_CMD_FLASH
+#endif  /* NOR support */
+
 #endif	/* ! __CONFIG_AM335X_EVM_H */
Signature · 1 line
1.7.9.5
author
#7 lore raw

PATCH v4 7/8 am335x_evm: Add support to boot from NOR.

In reply to Tom Rini

From: Steve Kipisz <[email protected]>

NOR requires that s_init be within the first 4KiB of the image so that we can perform the rest of the required pinmuxing to talk with the rest of NOR that we are found on. When NOR_BOOT is set we save our environment in NOR at 512KiB and a redundant copy at 768KiB. We avoid using SPL for this case and u-boot.bin is written directly to the start of NOR.

We enclose the DMM-related parts of arch/arm/cpu/armv7/am33xx/emif4.c with TI81xx checks as at this time U-Boot does not discard unused sections in the main build and this code relies on functions specific to (and only provided in) ti81xx-related code.

---
Changes in v4:
- Rebase to current. Note that the asm statements seemingly conflict with the save_omap_boot_params call, but I don't see why.

Changes in v3:
- Explain TI81xx changes

Changes in v2:
- Reword commit message slightly

---
 arch/arm/cpu/armv7/am33xx/board.c |    2 +-
 arch/arm/cpu/armv7/am33xx/emif4.c |    6 +-
 board/ti/am335x/Makefile          |    2 +-
 board/ti/am335x/board.c           |   33 +++++++++--
 board/ti/am335x/mux.c             |    6 +-
 board/ti/am335x/u-boot.lds        |  117 +++++++++++++++++++++++++++++++++++++
 boards.cfg                        |    1 +
 include/configs/am335x_evm.h      |   26 ++++++++-
 8 files changed, 182 insertions(+), 11 deletions(-)
 create mode 100644 board/ti/am335x/u-boot.lds
arch/arm/cpu/armv7/am33xx/board.c +1 -1
index b935a29..3085292 100644
@@ -150,7 +150,7 @@ int arch_misc_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 void rtc32k_enable(void)
 {
 	struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
arch/arm/cpu/armv7/am33xx/emif4.c +5 -1
index aa84e96..370230b 100644
@@ -43,9 +43,11 @@ void dram_init_banksize(void)
 }
 
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
+#ifdef CONFIG_TI81XX
 static struct dmm_lisa_map_regs *hw_lisa_map_regs =
 				(struct dmm_lisa_map_regs *)DMM_BASE;
+#endif
 static struct vtp_reg *vtpreg[2] = {
 				(struct vtp_reg *)VTP0_CTRL_ADDR,
 				(struct vtp_reg *)VTP1_CTRL_ADDR};
@@ -53,6 +55,7 @@ static struct vtp_reg *vtpreg[2] = {
 static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR;
 #endif
 
+#ifdef CONFIG_TI81XX
 void config_dmm(const struct dmm_lisa_map_regs *regs)
 {
 	enable_dmm_clocks();
@@ -67,6 +70,7 @@ void config_dmm(const struct dmm_lisa_map_regs *regs)
 	writel(regs->dmm_lisa_map_1, &hw_lisa_map_regs->dmm_lisa_map_1);
 	writel(regs->dmm_lisa_map_0, &hw_lisa_map_regs->dmm_lisa_map_0);
 }
+#endif
 
 static void config_vtp(int nr)
 {
board/ti/am335x/Makefile +1 -1
index 67a87a1..1795e3e 100644
@@ -18,7 +18,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-ifdef CONFIG_SPL_BUILD
+ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
 COBJS	:= mux.o
 endif
 
board/ti/am335x/board.c +29 -4
index 7bcaa98..81ab04a 100644
@@ -91,7 +91,7 @@ static int read_eeprom(struct am335x_baseboard_id *header)
 	return 0;
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 static const struct ddr_data ddr2_data = {
 	.datardsratio0 = ((MT47H128M16RT25E_RD_DQS<<30) |
 			  (MT47H128M16RT25E_RD_DQS<<20) |
@@ -257,10 +257,28 @@ int spl_start_uboot(void)
  */
 void s_init(void)
 {
-#ifdef CONFIG_SPL_BUILD
-	struct am335x_baseboard_id header;
+	__maybe_unused struct am335x_baseboard_id header;
 
 	/*
+	 * The ROM will only have set up sufficient pinmux to allow for the
+	 * first 4KiB NOR to be read, we must finish doing what we know of
+	 * the NOR mux in this space in order to continue.
+	 */
+#ifdef CONFIG_NOR_BOOT
+	asm("stmfd      sp!, {r2 - r4}");
+	asm("movw       r4, #0x8A4");
+	asm("movw       r3, #0x44E1");
+	asm("orr        r4, r4, r3, lsl #16");
+	asm("mov        r2, #9");
+	asm("mov        r3, #8");
+	asm("gpmc_mux:  str     r2, [r4], #4");
+	asm("subs       r3, r3, #1");
+	asm("bne        gpmc_mux");
+	asm("ldmfd      sp!, {r2 - r4}");
+#endif
+
+#ifdef CONFIG_SPL_BUILD
+	/*
 	 * Save the boot parameters passed from romcode.
 	 * We cannot delay the saving further than this,
 	 * to prevent overwrites.
@@ -278,7 +296,7 @@ void s_init(void)
 	while (readl(&wdtimer->wdtwwps) != 0x0)
 		;
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 	/* Setup the PLLs and the clocks for the peripherals */
 	pll_init();
 
@@ -306,9 +324,16 @@ void s_init(void)
 
 	uart_soft_reset();
 
+#if defined(CONFIG_NOR_BOOT)
+	/* We want our console now. */
+	gd->baudrate = CONFIG_BAUDRATE;
+	serial_init();
+	gd->have_console = 1;
+#else
 	gd = &gdata;
 
 	preloader_console_init();
+#endif
 
 	/* Initalize the board header */
 	enable_i2c0_pin_mux();
board/ti/am335x/mux.c +4 -2
index 187468e..5b7ed63 100644
@@ -190,7 +190,7 @@ static struct module_pin_mux nand_pin_mux[] = {
 	{-1},
 };
 
-#if defined(CONFIG_NOR)
+#if defined(CONFIG_NOR) && !defined(CONFIG_NOR_BOOT)
 static struct module_pin_mux bone_norcape_pin_mux[] = {
 	{OFFSET(lcd_data0), MODE(1) | PULLUDEN | RXACTIVE},     /* NOR_A0 */
 	{OFFSET(lcd_data1), MODE(1) | PULLUDEN | RXACTIVE},     /* NOR_A1 */
@@ -317,8 +317,10 @@ void enable_board_pin_mux(struct am335x_baseboard_id *header)
 		configure_module_pin_mux(i2c1_pin_mux);
 		configure_module_pin_mux(mii1_pin_mux);
 		configure_module_pin_mux(mmc0_pin_mux);
+#ifndef CONFIG_NOR
 		configure_module_pin_mux(mmc1_pin_mux);
-#if defined(CONFIG_NOR)
+#endif
+#if defined(CONFIG_NOR) && !defined(CONFIG_NOR_BOOT)
 		configure_module_pin_mux(bone_norcape_pin_mux);
 #endif
 	} else if (board_is_gp_evm(header)) {
board/ti/am335x/u-boot.lds new file +117 -0

117 lines not on this page · raw message

boards.cfg +1 -0
index 58ed412..1d72319 100644
@@ -243,6 +243,7 @@ vexpress_ca5x2               arm         armv7       vexpress            armltd
 vexpress_ca9x4               arm         armv7       vexpress            armltd
 am335x_evm                   arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1
 am335x_evm_nor               arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NOR
+am335x_evm_norboot           arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NOR,NOR_BOOT
 am335x_evm_spiboot           arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,SPI_BOOT
 am335x_evm_uart1             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL2,CONS_INDEX=2
 am335x_evm_uart2             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL3,CONS_INDEX=3
include/configs/am335x_evm.h +24 -2
index 155f5d9..2a74a56 100644
@@ -40,9 +40,12 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 
+/* Custom script for NOR */
+#define CONFIG_SYS_LDSCRIPT		"board/ti/am335x/u-boot.lds"
+
 #define CONFIG_SYS_CACHELINE_SIZE       64
 
-#if !defined(CONFIG_SPI_BOOT)
+#if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
 #define CONFIG_NAND
 #endif
 
@@ -312,6 +315,7 @@
 #define CONFIG_ENV_OVERWRITE		1
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
+#ifndef CONFIG_NOR_BOOT
 /* Defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_FRAMEWORK
@@ -385,6 +389,7 @@
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
 #endif
+#endif
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
 					 CONFIG_SYS_NAND_PAGE_SIZE)
@@ -413,14 +418,18 @@
  * header. That is 0x800FFFC0--0x80100000 should not be used for any
  * other needs.
  */
+#ifdef CONFIG_NOR_BOOT
+#define CONFIG_SYS_TEXT_BASE		0x08000000
+#else
 #define CONFIG_SYS_TEXT_BASE		0x80800000
+#endif
 #define CONFIG_SYS_SPL_MALLOC_START	0x80a08000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000
 
 /* Since SPL did pll and ddr initialization for us,
  * we don't need to do it twice.
  */
-#ifndef CONFIG_SPL_BUILD
+#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NOR_BOOT)
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
@@ -552,6 +561,19 @@
 #define CONFIG_SYS_FLASH_BASE		(0x08000000)
 #define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
+#ifdef CONFIG_NOR_BOOT
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_SECT_SIZE		(128 << 10)	/* 128 KiB */
+#define CONFIG_ENV_OFFSET		(512 << 10)	/* 512 KiB */
+#define CONFIG_ENV_OFFSET_REDUND	(768 << 10)	/* 768 KiB */
+#define CONFIG_CMD_MTDPARTS
+#define MTDIDS_DEFAULT			"nor0=physmap-flash.0"
+#define MTDPARTS_DEFAULT		"mtdparts=physmap-flash.0:" \
+					"512k(u-boot)," \
+					"128k(u-boot-env1)," \
+					"128k(u-boot-env2)," \
+					"4m(kernel),-(rootfs)"
+#endif
 #define CONFIG_MTD_DEVICE
 #define CONFIG_CMD_FLASH
 #endif  /* NOR support */
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH v4 7/8 am335x_evm: Add support to boot from NOR.

Hi Tom,

Quoted 3 lines · Tom Rini

Changes in v4:
- Rebase to current. Note that the asm statements seemingly conflict with the save_omap_boot_params call, but I don't see why.

How exactly does the conflict manifest itself?

Amicalement,

Signature · 1 line
Albert.
author
#9 lore raw

PATCH v4 7/8 am335x_evm: Add support to boot from NOR.

Quoted 9 lines · Albert ARIBAUD

Hi Tom,

Quoted 3 lines · Tom Rini

Changes in v4:
- Rebase to current. Note that the asm statements seemingly conflict with the save_omap_boot_params call, but I don't see why.

How exactly does the conflict manifest itself?

What I end up seeing (and I didn't get a debugger attached) was that the i2c init fails (one of the i2c error messages is sent out), so i2c probe fails so we can't init the hardware. And it's left in such a bizarro state that trying to boot again via UART instead for example still fails that way, a power cycle is required to clear things out.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130718/cbade3a9/attachment.pgp>
author
#10 lore raw

PATCH v4 8/8 board/ti/am335x/README: Document NOR programming

In reply to Tom Rini

The Beaglebone White may be populated with a memory cape that has a NOR module. Document how to program it.

---
 board/ti/am335x/README |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
board/ti/am335x/README +23 -0
index 6d45352..67b5246 100644
@@ -38,6 +38,29 @@ U-Boot # nand write 81000000 0 260000
 U-Boot # load mmc 0 ${loadaddr} uImage
 U-Boot # nand write ${loadaddr} kernel 500000
 
+NOR
+===
+
+The Beaglebone White can be equiped with a "memory cape" that in turn can
+have a NOR module plugged into it.  In this case it is then possible to
+program and boot from NOR.  Note that due to how U-Boot is architectured we
+must build a specific version of U-Boot that knows we have NOR flash.  This
+build is named 'am335x_evm_nor'.  Further, we have a 'am335x_evm_norboot'
+build that will assume that the environment is on NOR rather than NAND.  In
+the following example we assume that and SD card has been populated with
+MLO and u-boot.img from a 'am335x_evm_nor' build and also contains the
+'u-boot.bin' from a 'am335x_evm_norboot' build.  When booting from NOR, a
+binary must be written to the start of NOR, with no header or similar
+prepended.  In the following example we use a size of 512KiB (0x80000)
+as that is how much space we set aside before the environment, as per
+the config file.
+
+U-Boot # mmc rescan
+U-Boot # load mmc 0 ${loadaddr} u-boot.bin
+U-Boot # protect off 08000000 +80000
+U-Boot # erase 08000000 +80000
+U-Boot # cp.b ${loadaddr} 08000000 ${filesize}
+
 Falcon Mode
 ===========
 
Signature · 1 line
1.7.9.5
author
#11 lore raw

v4 cover am335x: NOR support

In reply to Tom Rini
Quoted 11 lines · Tom Rini

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

Quoted 6 lines

The big changes in v4 are:
- Apply again to master which includes a few non-trivial updates, so the linker script got re-synced.
- After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130730/992f69de/attachment.pgp>
#12 lore raw

v4 cover am335x: NOR support

Quoted 13 lines · Tom Rini
Quoted 11 lines · Tom Rini

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

Quoted 8 lines
Quoted 6 lines

The big changes in v4 are:
- Apply again to master which includes a few non-trivial updates, so the linker script got re-synced.
- After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Applied to u-boot-ti/master, thanks!

I'm now rebasing our NanoBone code onto the TI uboot code, but I'm coming up with the original issue [1] of having to not check for the R_ARM_RELATIVE relocations again.

If I patch config.mk again, the code all compiles.

I've tested "make am335x_evm_norboot" and that works.

I've attached my custom patchset ... can you tell me what I'm doing wrong ?

[1] http://lists.denx.de/pipermail/u-boot/2013-July/158592.html

Cheers
Mark J.

---
 board/newflow/nanobone/Makefile   |   38 +++++
 board/newflow/nanobone/board.c    |  295 +++++++++++++++++++++++++++++++++++
 board/newflow/nanobone/mux.c      |  195 +++++++++++++++++++++++
 board/newflow/nanobone/u-boot.lds |  110 +++++++++++++
 boards.cfg                        |    2 +
 include/configs/nanobone.h        |  308 +++++++++++++++++++++++++++++++++++++
 6 files changed, 948 insertions(+)
 create mode 100644 board/newflow/nanobone/Makefile
 create mode 100644 board/newflow/nanobone/board.c
 create mode 100644 board/newflow/nanobone/mux.c
 create mode 100644 board/newflow/nanobone/u-boot.lds
 create mode 100644 include/configs/nanobone.h
board/newflow/nanobone/Makefile new file +38 -0
new file mode 100644
index 0000000..3dbeeda
@@ -0,0 +1,38 @@
+#
+# Makefile
+#
+# Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
+COBJS	:= mux.o
+endif
+
+COBJS	+= board.o
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/newflow/nanobone/board.c new file +295 -0

295 lines not on this page · raw message

board/newflow/nanobone/mux.c new file +195 -0

195 lines not on this page · raw message

board/newflow/nanobone/u-boot.lds new file +110 -0

110 lines not on this page · raw message

boards.cfg +2 -0
index 211ed58..1e5ca5d 100644
@@ -252,6 +252,8 @@ am335x_evm_uart4             arm         armv7       am335x              ti
 am335x_evm_uart5             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL6,CONS_INDEX=1,NAND
 am335x_evm_usbspl            arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NAND,SPL_USBETH_SUPPORT
 am335x_boneblack             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,EMMC_BOOT
+nanobone                     arm         armv7       nanobone            newflow        am33xx      nanobone:NOR_BOOT
+nanobone_sdboot              arm         armv7       nanobone            newflow        am33xx      nanobone:SD_BOOT
 ti814x_evm                   arm         armv7       ti814x              ti             am33xx
 pcm051                       arm         armv7       pcm051              phytec         am33xx      pcm051
 sama5d3xek_mmc               arm         armv7       sama5d3xek          atmel          at91        sama5d3xek:SAMA5D3,SYS_USE_MMC
include/configs/nanobone.h new file +308 -0

308 lines not on this page · raw message

--
1.7.9.5

author
#13 lore raw

v4 cover am335x: NOR support

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 21 lines · Mark Jackson
Quoted 20 lines · Tom Rini
Quoted 17 lines · Tom Rini

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

The big changes in v4 are: - Apply again to master which includes a few non-trivial updates, so the linker script got re-synced. - After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Quoted 5 lines
Quoted 1 line

Applied to u-boot-ti/master, thanks!

I'm now rebasing our NanoBone code onto the TI uboot code, but I'm coming up with the original issue [1] of having to not check for the R_ARM_RELATIVE relocations again.

Your linker script is out of sync with arch/arm/cpu/u-boot.lds

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSCkoKAAoJENk4IS6UOR1WS5IP/0is6vnCBc3NtLRkOxCbIwjK oFsx7qzJ/xg+D+56ygI14JVH7zikGk2b70bh05wLog96D/oIk8lFgLj3h3YJSG99 cGlAB3ZxI7VupgILfN0lnJ0Ht6NNqou6p3qfC2lJl6/kl40mVXsPBV93X8b/N2vx eDvP6bE8cjhvtQLlOb6HnDcp5OAkbXqiexM3vfwsVALisCksK67DpFgnrm37w9T6 LVAIMRBAOmf6UHDAEbK0I2FjUb/zG/bO3dsTVl+04H5jeOeVerscQPPYtSLY2vua KaJDOXutw2CnUX4xNh3OWj/bSFz39qt5GnGJ8roNfwClbTjEtt0/7zGuGSPh7qXd CCIGHktpYtvAj2HmQ7U4aSqnF4o/gZDJlZZmNArrvDVn2/5XmdxrUO9tSdiRYMBR ljPLK+VBD7vz96mbfx3QWbL0dBnjzg0jxaOpvEX/N7SomZnb7seu9lTetaDVRJhD xj96lSaZ2BL7SGAW/1h1mt93Bh/emQDhpLI1wNIr0UCRWmdx34enQnBN51A8Al0j E132z4n1zQfj7fAG9nLdAVuuBJsDX5iyHFz3NUuxvREls+yLK5bweXUOwfhUirMd eJqlPaKiAuuoUwsPJHWCr/PS0+pU0AdxZ9dP9s9sGU1Lr+lJNUkqP0KVnb4aZqtA nmrkfKCX6p+R1C/RluK0
=LnpG
-----END PGP SIGNATURE-----

#14 lore raw

v4 cover am335x: NOR support

Quoted 25 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 21 lines · Mark Jackson
Quoted 20 lines · Tom Rini
Quoted 17 lines · Tom Rini

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

The big changes in v4 are: - Apply again to master which includes a few non-trivial updates, so the linker script got re-synced. - After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Applied to u-boot-ti/master, thanks!

I'm now rebasing our NanoBone code onto the TI uboot code, but I'm coming up with the original issue [1] of having to not check for the R_ARM_RELATIVE relocations again.

Your linker script is out of sync with arch/arm/cpu/u-boot.lds

Strange ... since the am335x nor_boot compile appeared to work fine, I just copied the script from board/ti/am335x, and assumed it would work fine for me (with a library path change).

So does this TI file also need updating ?

Either way, my code now compiles.

Cheers.

author
#15 lore raw

v4 cover am335x: NOR support

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 34 lines · Mark Jackson
Quoted 25 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 22 lines · Mark Jackson
Quoted 21 lines · Tom Rini
Quoted 18 lines · Tom Rini

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

The big changes in v4 are: - Apply again to master which includes a few non-trivial updates, so the linker script got re-synced. - After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Applied to u-boot-ti/master, thanks!

I'm now rebasing our NanoBone code onto the TI uboot code, but I'm coming up with the original issue [1] of having to not check for the R_ARM_RELATIVE relocations again.

Your linker script is out of sync with arch/arm/cpu/u-boot.lds

Quoted 7 lines

Strange ... since the am335x nor_boot compile appeared to work fine, I just copied the script from board/ti/am335x, and assumed it would work fine for me (with a library path change).

So does this TI file also need updating ?

Either way, my code now compiles.

I had to re-sync the TI one in this series as well. Double check between what you have working now vs before, there's a few small changes there...

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSCkyQAAoJENk4IS6UOR1WmrUP+wXcDGmf/sWOqB99kvxrMrYz 25rbCBYj1I65ataC9gIqXmPnKOeXLwjWOOIK5Z8fYol6Xzf7gz9E4EiuRQPxs3SO NfgEPueEBZVl52/BjzgicO7X6HPlbizuL7sp+yQbMmfsEAklnVmyGR2vOoG2A8CN 07rHmhej9QwYpVyYpAOfU/u3ZGn55PI9GxJiqVXMTRqb/WSEyv7ie0dRivSSHW4y g3WSemNBNYpvHYbYPDjJ68cDSBXiNlXX6uftQdlXD2wxhP5jP3MXUOcvhlFxXbvZ YFBjN7xAI0XeoK3OQk65z+oq/0JGq8FNk5wIKSWKjP06y4ncp1Xb5adGfoiVJ2HI FGqXRLRjHrQoON8f+90EV+a2YXiQ14/G387tJXSLWVSOzdRuaWbPMyzrOw6CT8qS BhOAsxhLCYyu+So+z9+tO1ZB+Wt8XWI1PS3DsRhw7mx9pGUjtLCjN6Ys10r71DyW 5M6rBaDu5eG3Th6X7ifoUwVJUEygh9YUHnWzAEcMtd1aYcFHsngwM7K3vtaAYv/Y PUlbay0Ars8B2JC2rJPKh5PS+BHpEsItHehdkmptKJCwC2NqR987Mv+IT19PFxJz 6Uf8Jc3tQCmfA5DG0HDVBsWon69EbRTTykpgUqCeKPohp2Ms65nKFnYSV/iDCU7U fuVnxnKZSkkuAtX1CkEl
=hthS
-----END PGP SIGNATURE-----

#16 lore raw

v4 cover am335x: NOR support

Quoted 42 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 38 lines · Mark Jackson
Quoted 25 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 22 lines · Mark Jackson
Quoted 21 lines · Tom Rini
Quoted 18 lines · Tom Rini

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

The big changes in v4 are: - Apply again to master which includes a few non-trivial updates, so the linker script got re-synced. - After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Applied to u-boot-ti/master, thanks!

I'm now rebasing our NanoBone code onto the TI uboot code, but I'm coming up with the original issue [1] of having to not check for the R_ARM_RELATIVE relocations again.

Your linker script is out of sync with arch/arm/cpu/u-boot.lds

Strange ... since the am335x nor_boot compile appeared to work fine, I just copied the script from board/ti/am335x, and assumed it would work fine for me (with a library path change).

Quoted 7 lines
Quoted 3 lines

So does this TI file also need updating ?

Either way, my code now compiles.

I had to re-sync the TI one in this series as well. Double check between what you have working now vs before, there's a few small changes there...

Doh ... I was copying the script from the non-TI branch of uboot !!

:-(

#17 lore raw

v4 cover am335x: NOR support

Quoted 47 lines · Mark Jackson
Quoted 46 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 41 lines · Mark Jackson
Quoted 25 lines · Tom Rini

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Quoted 22 lines · Mark Jackson
Quoted 21 lines · Tom Rini
Quoted 18 lines · Tom Rini

Hey all,

This series adds NOR support to am335x_evm, along with a few generic changes to make gpmc clearer (for per-board things like different NOR chips, etc). This series depends on the last go-round of the am335x falcon mode docs as that adds the README that I add more content to. And while I say this in 3/8, to be clear, I expect to drop 3/8 in favor of Justin Waters' way of doing this instead, I just include this here for completeness and will get it all happy together when I assemble things in u-boot-ti.

The big changes in v4 are: - Apply again to master which includes a few non-trivial updates, so the linker script got re-synced. - After checking what's going on, and testing with NAND again, we can be common with gpmc_cfg->irqstatus/enable, and only set documented bits in gpmc_cfg->config

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Applied to u-boot-ti/master, thanks!

I'm now rebasing our NanoBone code onto the TI uboot code, but I'm coming up with the original issue [1] of having to not check for the R_ARM_RELATIVE relocations again.

Your linker script is out of sync with arch/arm/cpu/u-boot.lds

Strange ... since the am335x nor_boot compile appeared to work fine, I just copied the script from board/ti/am335x, and assumed it would work fine for me (with a library path change).

So does this TI file also need updating ?

Either way, my code now compiles.

Quoted 8 lines
Quoted 3 lines

I had to re-sync the TI one in this series as well. Double check between what you have working now vs before, there's a few small changes there...

Doh ... I was copying the script from the non-TI branch of uboot !!

:-(

Well the code seems to work apart from I get no networking.

We have dual ethernet, so I'll have to do some digging.