Skip to contentSkip to conversation

ARM: OMAP3: Add NAND support

PATCH Superseded dirk.behme at googlemail.com 4 participants 19 messages Nov 2, 2008 – Nov 10, 2008 1 message not in the archive

Subsystems (5)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 7/13 ARM: OMAP3: Add NAND support

Subject: [PATCH 07/13 v5] ARM: OMAP3: Add NAND support

From: Dirk Behme <[email protected]>

Add NAND support

---

Changes in version v5:

- Fix typos GPMC_NAND_HW_ECC_LAYOUT. By Nishanth Menon.
- Additional clean up as proposed by Scott Wood
- Convert readx/writex to use base + offset scheme as proposed by Scott Wood

Changes in version v4:

- Incorporate further review results from Scott Wood.
- Further sets of cleanup, making the logic generic, rename of files, better handling of ecc switch by Nishanth Menon.

Changes in version v3:

- Fix/update NAND driver and seperate it into an own patch as proposed by Scott Wood

 drivers/mtd/nand/Makefile              |    1 
 drivers/mtd/nand/omap_gpmc.c           |  339 +++++++++++++++++++++++++++++++++
 include/asm-arm/arch-omap3/omap_gpmc.h |   84 ++++++++
 3 files changed, 424 insertions(+)
drivers/mtd/nand/Makefile +1 -0
Index: u-boot-main/drivers/mtd/nand/Makefile
===================================================================
@@ -38,6 +38,7 @@ endif
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
+COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 endif
 
 COBJS	:= $(COBJS-y)
include/asm-arm/arch-omap3/omap_gpmc.h new file +84 -0

84 lines not on this page · raw message

drivers/mtd/nand/omap_gpmc.c new file +339 -0

339 lines not on this page · raw message

#1 lore raw

PATCH v5 8/13 ARM: OMAP3: Add MMC support

Subject: [PATCH 08/13 v5] ARM: OMAP3: Add MMC support

From: Dirk Behme <[email protected]>

Add MMC support

---

Changes in v2:

- Move MMC driver to drivers/mmc/ as suggested by Haavard Skinnemoen. Thanks!

---
 drivers/mmc/Makefile                      |    3 
 drivers/mmc/omap3_mmc.c                   |  557 ++++++++++++++++++++++++++++++
 include/asm-arm/arch-omap3/mmc.h          |  235 ++++++++++++
 include/asm-arm/arch-omap3/mmc_host_def.h |  166 ++++++++
 4 files changed, 961 insertions(+)
include/asm-arm/arch-omap3/mmc.h new file +235 -0
Index: u-boot-arm/include/asm-arm/arch-omap3/mmc.h
===================================================================
@@ -0,0 +1,235 @@
+/*
+ * (C) Copyright 2008
+ * Texas Instruments, <www.ti.com>
+ * Syed Mohammed Khasim <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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's version 2 of
+ * the License.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef MMC_H
+#define MMC_H
+
+#include "mmc_host_def.h"
+
+/* Responses */
+#define RSP_TYPE_NONE	(RSP_TYPE_NORSP   | CCCE_NOCHECK | CICE_NOCHECK)
+#define RSP_TYPE_R1	(RSP_TYPE_LGHT48  | CCCE_CHECK   | CICE_CHECK)
+#define RSP_TYPE_R1B	(RSP_TYPE_LGHT48B | CCCE_CHECK   | CICE_CHECK)
+#define RSP_TYPE_R2	(RSP_TYPE_LGHT136 | CCCE_CHECK   | CICE_NOCHECK)
+#define RSP_TYPE_R3	(RSP_TYPE_LGHT48  | CCCE_NOCHECK | CICE_NOCHECK)
+#define RSP_TYPE_R4	(RSP_TYPE_LGHT48  | CCCE_NOCHECK | CICE_NOCHECK)
+#define RSP_TYPE_R5	(RSP_TYPE_LGHT48  | CCCE_CHECK   | CICE_CHECK)
+#define RSP_TYPE_R6	(RSP_TYPE_LGHT48  | CCCE_CHECK   | CICE_CHECK)
+#define RSP_TYPE_R7	(RSP_TYPE_LGHT48  | CCCE_CHECK   | CICE_CHECK)
+
+/* All supported commands */
+#define MMC_CMD0	(INDEX(0)  | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD1	(INDEX(1)  | RSP_TYPE_R3   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD2	(INDEX(2)  | RSP_TYPE_R2   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD3	(INDEX(3)  | RSP_TYPE_R1   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_SDCMD3	(INDEX(3)  | RSP_TYPE_R6   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD4	(INDEX(4)  | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD6	(INDEX(6)  | RSP_TYPE_R1B  | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD7_SELECT	(INDEX(7)  | RSP_TYPE_R1B  | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD7_DESELECT (INDEX(7)| RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD8	(INDEX(8)  | RSP_TYPE_R1   | DP_DATA    | DDIR_READ)
+#define MMC_SDCMD8	(INDEX(8)  | RSP_TYPE_R7   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD9	(INDEX(9)  | RSP_TYPE_R2   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD12	(INDEX(12) | RSP_TYPE_R1B  | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD13	(INDEX(13) | RSP_TYPE_R1   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD15	(INDEX(15) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD16	(INDEX(16) | RSP_TYPE_R1   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_CMD17	(INDEX(17) | RSP_TYPE_R1   | DP_DATA    | DDIR_READ)
+#define MMC_CMD24	(INDEX(24) | RSP_TYPE_R1   | DP_DATA    | DDIR_WRITE)
+#define MMC_ACMD6	(INDEX(6)  | RSP_TYPE_R1   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_ACMD41	(INDEX(41) | RSP_TYPE_R3   | DP_NO_DATA | DDIR_WRITE)
+#define MMC_ACMD51	(INDEX(51) | RSP_TYPE_R1   | DP_DATA    | DDIR_READ)
+#define MMC_CMD55	(INDEX(55) | RSP_TYPE_R1   | DP_NO_DATA | DDIR_WRITE)
+
+#define MMC_AC_CMD_RCA_MASK	(unsigned int)(0xFFFF << 16)
+#define MMC_BC_CMD_DSR_MASK	(unsigned int)(0xFFFF << 16)
+#define MMC_DSR_DEFAULT		(0x0404)
+#define SD_CMD8_CHECK_PATTERN	(0xAA)
+#define SD_CMD8_2_7_3_6_V_RANGE	(0x01 << 8)
+
+/* Clock Configurations and Macros */
+
+#define MMC_CLOCK_REFERENCE		(96)
+#define MMC_RELATIVE_CARD_ADDRESS	(0x1234)
+#define MMC_INIT_SEQ_CLK		(MMC_CLOCK_REFERENCE * 1000 / 80)
+#define MMC_400kHz_CLK			(MMC_CLOCK_REFERENCE * 1000 / 400)
+#define CLKDR(r, f, u)			((((r)*100) / ((f)*(u))) + 1)
+#define CLKD(f, u)			(CLKDR(MMC_CLOCK_REFERENCE, f, u))
+
+#define MMC_OCR_REG_ACCESS_MODE_MASK	(0x3 << 29)
+#define MMC_OCR_REG_ACCESS_MODE_BYTE 	(0x0 << 29)
+#define MMC_OCR_REG_ACCESS_MODE_SECTOR	(0x2 << 29)
+
+#define MMC_OCR_REG_HOST_CAPACITY_SUPPORT_MASK		(0x1 << 30)
+#define MMC_OCR_REG_HOST_CAPACITY_SUPPORT_BYTE		(0x0 << 30)
+#define MMC_OCR_REG_HOST_CAPACITY_SUPPORT_SECTOR	(0x1 << 30)
+
+#define MMC_SD2_CSD_C_SIZE_LSB_MASK	(0xFFFF)
+#define MMC_SD2_CSD_C_SIZE_MSB_MASK	(0x003F)
+#define MMC_SD2_CSD_C_SIZE_MSB_OFFSET	(16)
+#define MMC_CSD_C_SIZE_LSB_MASK		(0x0003)
+#define MMC_CSD_C_SIZE_MSB_MASK		(0x03FF)
+#define MMC_CSD_C_SIZE_MSB_OFFSET	(2)
+
+#define MMC_CSD_TRAN_SPEED_UNIT_MASK	(0x07 << 0)
+#define MMC_CSD_TRAN_SPEED_FACTOR_MASK	(0x0F << 3)
+#define MMC_CSD_TRAN_SPEED_UNIT_100MHZ	(0x3 << 0)
+#define MMC_CSD_TRAN_SPEED_FACTOR_1_0	(0x01 << 3)
+#define MMC_CSD_TRAN_SPEED_FACTOR_8_0	(0x0F << 3)
+
+typedef struct {
+	unsigned not_used:1;
+	unsigned crc:7;
+	unsigned ecc:2;
+	unsigned file_format:2;
+	unsigned tmp_write_protect:1;
+	unsigned perm_write_protect:1;
+	unsigned copy:1;
+	unsigned file_format_grp:1;
+	unsigned content_prot_app:1;
+	unsigned reserved_1:4;
+	unsigned write_bl_partial:1;
+	unsigned write_bl_len:4;
+	unsigned r2w_factor:3;
+	unsigned default_ecc:2;
+	unsigned wp_grp_enable:1;
+	unsigned wp_grp_size:5;
+	unsigned erase_grp_mult:5;
+	unsigned erase_grp_size:5;
+	unsigned c_size_mult:3;
+	unsigned vdd_w_curr_max:3;
+	unsigned vdd_w_curr_min:3;
+	unsigned vdd_r_curr_max:3;
+	unsigned vdd_r_curr_min:3;
+	unsigned c_size_lsb:2;
+	unsigned c_size_msb:10;
+	unsigned reserved_2:2;
+	unsigned dsr_imp:1;
+	unsigned read_blk_misalign:1;
+	unsigned write_blk_misalign:1;
+	unsigned read_bl_partial:1;
+	unsigned read_bl_len:4;
+	unsigned ccc:12;
+	unsigned tran_speed:8;
+	unsigned nsac:8;
+	unsigned taac:8;
+	unsigned reserved_3:2;
+	unsigned spec_vers:4;
+	unsigned csd_structure:2;
+} mmc_csd_reg_t;
+
+/* csd for sd2.0 */
+typedef struct {
+	unsigned not_used:1;
+	unsigned crc:7;
+	unsigned reserved_1:2;
+	unsigned file_format:2;
+	unsigned tmp_write_protect:1;
+	unsigned perm_write_protect:1;
+	unsigned copy:1;
+	unsigned file_format_grp:1;
+	unsigned reserved_2:5;
+	unsigned write_bl_partial:1;
+	unsigned write_bl_len:4;
+	unsigned r2w_factor:3;
+	unsigned reserved_3:2;
+	unsigned wp_grp_enable:1;
+	unsigned wp_grp_size:7;
+	unsigned sector_size:7;
+	unsigned erase_blk_len:1;
+	unsigned reserved_4:1;
+	unsigned c_size_lsb:16;
+	unsigned c_size_msb:6;
+	unsigned reserved_5:6;
+	unsigned dsr_imp:1;
+	unsigned read_blk_misalign:1;
+	unsigned write_blk_misalign:1;
+	unsigned read_bl_partial:1;
+	unsigned read_bl_len:4;
+	unsigned ccc:12;
+	unsigned tran_speed:8;
+	unsigned nsac:8;
+	unsigned taac:8;
+	unsigned reserved_6:6;
+	unsigned csd_structure:2;
+} mmc_sd2_csd_reg_t;
+
+/* extended csd - 512 bytes long */
+typedef struct {
+	unsigned char reserved_1[181];
+	unsigned char erasedmemorycontent;
+	unsigned char reserved_2;
+	unsigned char buswidthmode;
+	unsigned char reserved_3;
+	unsigned char highspeedinterfacetiming;
+	unsigned char reserved_4;
+	unsigned char powerclass;
+	unsigned char reserved_5;
+	unsigned char commandsetrevision;
+	unsigned char reserved_6;
+	unsigned char commandset;
+	unsigned char extendedcsdrevision;
+	unsigned char reserved_7;
+	unsigned char csdstructureversion;
+	unsigned char reserved_8;
+	unsigned char cardtype;
+	unsigned char reserved_9[3];
+	unsigned char powerclass_52mhz_1_95v;
+	unsigned char powerclass_26mhz_1_95v;
+	unsigned char powerclass_52mhz_3_6v;
+	unsigned char powerclass_26mhz_3_6v;
+	unsigned char reserved_10;
+	unsigned char minreadperf_4b_26mhz;
+	unsigned char minwriteperf_4b_26mhz;
+	unsigned char minreadperf_8b_26mhz_4b_52mhz;
+	unsigned char minwriteperf_8b_26mhz_4b_52mhz;
+	unsigned char minreadperf_8b_52mhz;
+	unsigned char minwriteperf_8b_52mhz;
+	unsigned char reserved_11;
+	unsigned int sectorcount;
+	unsigned char reserved_12[288];
+	unsigned char supportedcommandsets;
+	unsigned char reserved_13[7];
+} mmc_extended_csd_reg_t;
+
+/* mmc sd responce */
+typedef struct {
+	unsigned int ocr;
+} mmc_resp_r3;
+
+typedef struct {
+	unsigned short cardstatus;
+	unsigned short newpublishedrca;
+} mmc_resp_r6;
+
+extern mmc_card_data mmc_dev;
+
+unsigned char mmc_lowlevel_init(void);
+unsigned char mmc_send_command(unsigned int cmd, unsigned int arg,
+			       unsigned int *response);
+unsigned char mmc_setup_clock(unsigned int iclk, unsigned short clkd);
+unsigned char mmc_set_opendrain(unsigned char state);
+unsigned char mmc_read_data(unsigned int *output_buf);
+
+#endif /* MMC_H */
include/asm-arm/arch-omap3/mmc_host_def.h new file +166 -0

166 lines not on this page · raw message

drivers/mmc/omap3_mmc.c new file +557 -0

557 lines not on this page · raw message

drivers/mmc/Makefile +3 -0
Index: u-boot-arm/drivers/mmc/Makefile
===================================================================
@@ -26,6 +26,9 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)libmmc.a
 
 COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o
+COBJS-$(CONFIG_OMAP3_BEAGLE) += omap3_mmc.o
+COBJS-$(CONFIG_OMAP3_EVM) += omap3_mmc.o
+COBJS-$(CONFIG_OVERO) += omap3_mmc.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
#4 lore raw

PATCH v5 9/13 ARM: OMAP3: Add I2C support

Subject: [PATCH 09/13 v5] ARM: OMAP3: Add I2C support

From: Dirk Behme <[email protected]>

Add I2C support

---
Changes in version v5:

- Split functional changes and coding style clean up as proposed by Jean-Christophe PLAGNIOL-VILLARD.

Changes in version v2:

- Remove SMC911X network init as proposed by Ben Warren. Thanks!

 drivers/i2c/Makefile       |    1 +
 drivers/i2c/omap24xx_i2c.c |   24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
drivers/i2c/Makefile +1 -0
Index: u-boot-main/drivers/i2c/Makefile
===================================================================
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 
drivers/i2c/omap24xx_i2c.c +24 -0
Index: u-boot-main/drivers/i2c/omap24xx_i2c.c
===================================================================
@@ -25,6 +25,8 @@
 #include <asm/arch/i2c.h>
 #include <asm/io.h>
 
+#define inb(a) __raw_readb(a)
+#define outb(a, v) __raw_writeb(a, v)
 #define inw(a) __raw_readw(a)
 #define outw(a,v) __raw_writew(a,v)
 
@@ -112,7 +114,11 @@ static int i2c_read_byte (u8 devaddr, u8
 
 		status = wait_for_pin ();
 		if (status & I2C_STAT_RRDY) {
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
+			*value = inb(I2C_DATA);
+#else
 			*value = inw (I2C_DATA);
+#endif
 			udelay (20000);
 		} else {
 			i2c_error = 1;
@@ -153,8 +159,22 @@ static int i2c_write_byte (u8 devaddr, u
 	status = wait_for_pin ();
 
 	if (status & I2C_STAT_XRDY) {
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
+		/* send out 1 byte */
+		outb(regoffset, I2C_DATA);
+		outw(I2C_STAT_XRDY, I2C_STAT);
+		status = wait_for_pin();
+		if ((status & I2C_STAT_XRDY)) {
+			/* send out next 1 byte */
+			outb(value, I2C_DATA);
+			outw(I2C_STAT_XRDY, I2C_STAT);
+		} else {
+			i2c_error = 1;
+		}
+#else
 		/* send out two bytes */
 		outw ((value << 8) + regoffset, I2C_DATA);
+#endif
 		/* must have enough delay to allow BB bit to go low */
 		udelay (50000);
 		if (inw (I2C_STAT) & I2C_STAT_NACK) {
@@ -191,7 +211,11 @@ static void flush_fifo(void)
 	while(1){
 		stat = inw(I2C_STAT);
 		if(stat == I2C_STAT_RRDY){
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
+			inb(I2C_DATA);
+#else
 			inw(I2C_DATA);
+#endif
 			outw(I2C_STAT_RRDY,I2C_STAT);
 			udelay(1000);
 		}else
#8 lore raw

PATCH v5 10/13 ARM: OMAP3: Add BeagleBoard

Subject: [PATCH 10/13 v5] ARM: OMAP3: Add BeagleBoard

From: Dirk Behme <[email protected]>

Add BeagleBoard

---

Changes in version v5:

- Update Makefile style and replace hardcoded values by macros as proposed by Jean-Christophe PLAGNIOL-VILLARD.
- Add BeagleBoard to MAINTAINERS and MAKEALL

Changes in version v2:

- Rebase against u-boot-arm.git next (CFG vs. CONFIG changes)

 MAINTAINERS                   |    4 
 MAKEALL                       |    1 
 Makefile                      |    7 
 board/omap3/beagle/Makefile   |   49 +++++
 board/omap3/beagle/beagle.c   |  107 +++++++++++
 board/omap3/beagle/beagle.h   |  375 ++++++++++++++++++++++++++++++++++++++++++
 board/omap3/beagle/config.mk  |   17 +
 board/omap3/beagle/u-boot.lds |   63 +++++++
 8 files changed, 623 insertions(+)
board/omap3/beagle/Makefile new file +49 -0
Index: u-boot-main/board/omap3/beagle/Makefile
===================================================================
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	:= beagle.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+	rm -f $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
\ No newline at end of file
board/omap3/beagle/beagle.c new file +107 -0

107 lines not on this page · raw message

board/omap3/beagle/config.mk new file +17 -0
Index: u-boot-main/board/omap3/beagle/config.mk
===================================================================
@@ -0,0 +1,17 @@
+#
+# (C) Copyright 2006
+# Texas Instruments, <www.ti.com>
+#
+# Begale Board uses OMAP3 (ARM-CortexA8) cpu
+# see http://www.ti.com/ for more information on Texas Instruments
+#
+# Physical Address:
+# 8000'0000 (bank0)
+# A000/0000 (bank1)
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+
+# For use with external or internal boots.
+TEXT_BASE = 0x80e80000
+
+
board/omap3/beagle/u-boot.lds new file +63 -0

63 lines not on this page · raw message

Makefile +7 -0
Index: u-boot-main/Makefile
===================================================================
@@ -2753,6 +2753,13 @@ SMN42_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292
 
 #########################################################################
+## ARM CORTEX Systems
+#########################################################################
+
+omap3_beagle_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 beagle omap3 omap3
+
+#########################################################################
 ## XScale Systems
 #########################################################################
 
MAKEALL +1 -0
Index: u-boot-main/MAKEALL
===================================================================
@@ -506,6 +506,7 @@ LIST_ARM9="			\
 	davinci_schmoogie	\
 	davinci_sffsdr		\
 	davinci_sonata		\
+	omap3_beagle		\
 "
 
 #########################################################################
MAINTAINERS +4 -0
Index: u-boot-main/MAINTAINERS
===================================================================
@@ -477,6 +477,10 @@ Rowel Atienza <[email protected]>
 
 	armadillo	ARM720T
 
+Dirk Behme <[email protected]>
+
+	omap3_beagle	ARM CORTEX-A8 (OMAP3xx SoC)
+
 Rishi Bhattacharya <[email protected]>
 
 	omap5912osk	ARM926EJS
board/omap3/beagle/beagle.h new file +375 -0

375 lines not on this page · raw message

#10 lore raw

PATCH v5 11/13 ARM: OMAP3: Add EVM board

Subject: [PATCH 11/13 v5] ARM: OMAP3: Add EVM board

From: Dirk Behme <[email protected]>

Add EVM board

---

Changes in version v5:

- Update Makefile style and replace hardcoded values by macros as proposed by Jean-Christophe PLAGNIOL-VILLARD.
- Add EVM to MAINTAINERS and MAKEALL

Changes in version v2:

- Rebase against u-boot-arm.git next (CFG vs. CONFIG changes)

 MAINTAINERS                |    4 
 MAKEALL                    |    1 
 Makefile                   |    3 
 board/omap3/evm/Makefile   |   49 +++++
 board/omap3/evm/config.mk  |   17 +
 board/omap3/evm/evm.c      |  189 +++++++++++++++++++++
 board/omap3/evm/evm.h      |  390 +++++++++++++++++++++++++++++++++++++++++++++
 board/omap3/evm/u-boot.lds |   63 +++++++
 8 files changed, 716 insertions(+)
board/omap3/evm/Makefile new file +49 -0
Index: u-boot-main/board/omap3/evm/Makefile
===================================================================
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	:= evm.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+	rm -f $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
\ No newline at end of file
board/omap3/evm/config.mk new file +17 -0
Index: u-boot-main/board/omap3/evm/config.mk
===================================================================
@@ -0,0 +1,17 @@
+#
+# (C) Copyright 2006
+# Texas Instruments, <www.ti.com>
+#
+# Begale Board uses OMAP3 (ARM-CortexA8) cpu
+# see http://www.ti.com/ for more information on Texas Instruments
+#
+# Physical Address:
+# 8000'0000 (bank0)
+# A000/0000 (bank1)
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+
+# For use with external or internal boots.
+TEXT_BASE = 0x80e80000
+
+
board/omap3/evm/evm.c new file +189 -0

189 lines not on this page · raw message

board/omap3/evm/u-boot.lds new file +63 -0

63 lines not on this page · raw message

Makefile +3 -0
Index: u-boot-main/Makefile
===================================================================
@@ -2759,6 +2759,9 @@ SMN42_config	:	unconfig
 omap3_beagle_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 beagle omap3 omap3
 
+omap3_evm_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 evm omap3 omap3
+
 #########################################################################
 ## XScale Systems
 #########################################################################
MAINTAINERS +4 -0
Index: u-boot-main/MAINTAINERS
===================================================================
@@ -548,6 +548,10 @@ Guennadi Liakhovetski <g.liakhovetski at gm
 	mx31ads		i.MX31
 	SMDK6400	S3C6400
 
+Nishanth Menon <[email protected]>
+
+	omap3_evm	ARM CORTEX-A8 (OMAP3xx SoC)
+
 David M?ller <[email protected]>
 
 	smdk2410	ARM920T
MAKEALL +1 -0
Index: u-boot-main/MAKEALL
===================================================================
@@ -507,6 +507,7 @@ LIST_ARM9="			\
 	davinci_sffsdr		\
 	davinci_sonata		\
 	omap3_beagle		\
+	omap3_evm		\
 "
 
 #########################################################################
board/omap3/evm/evm.h new file +390 -0

390 lines not on this page · raw message

#15 lore raw

PATCH v5 12/13 ARM: OMAP3: Add Overo board

Subject: [PATCH 12/13 v5] ARM: OMAP3: Add Overo board

From: Dirk Behme <[email protected]>

Add Overo board

---

Changes in version v5:

- Update Makefile style and replace hardcoded values by macros as proposed by Jean-Christophe PLAGNIOL-VILLARD.
- Add Overo to MAINTAINERS and MAKEALL

Changes in version v2:

- Rebase against u-boot-arm.git next (CFG vs. CONFIG changes)

 MAINTAINERS                  |    4 
 MAKEALL                      |    1 
 Makefile                     |    3 
 board/omap3/overo/Makefile   |   49 +++++
 board/omap3/overo/config.mk  |   12 +
 board/omap3/overo/overo.c    |  113 ++++++++++++
 board/omap3/overo/overo.h    |  375 +++++++++++++++++++++++++++++++++++++++++++
 board/omap3/overo/u-boot.lds |   63 +++++++
 8 files changed, 620 insertions(+)
board/omap3/overo/Makefile new file +49 -0
Index: u-boot-main/board/omap3/overo/Makefile
===================================================================
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	:= overo.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+	rm -f $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
\ No newline at end of file
board/omap3/overo/config.mk new file +12 -0
Index: u-boot-main/board/omap3/overo/config.mk
===================================================================
@@ -0,0 +1,12 @@
+# Overo uses OMAP3 (ARM-CortexA8) cpu
+#
+# Physical Address:
+# 8000'0000 (bank0)
+# A000/0000 (bank1)
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+
+# For use with external or internal boots.
+TEXT_BASE = 0x80e80000
+
+
board/omap3/overo/overo.c new file +113 -0

113 lines not on this page · raw message

board/omap3/overo/u-boot.lds new file +63 -0

63 lines not on this page · raw message

Makefile +3 -0
Index: u-boot-main/Makefile
===================================================================
@@ -2762,6 +2762,9 @@ omap3_beagle_config :	unconfig
 omap3_evm_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 evm omap3 omap3
 
+omap3_overo_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 overo omap3 omap3
+
 #########################################################################
 ## XScale Systems
 #########################################################################
MAINTAINERS +4 -0
Index: u-boot-main/MAINTAINERS
===================================================================
@@ -589,6 +589,10 @@ Stefan Roese <[email protected]>
 	pdnb3		xscale
 	scpu		xscale
 
+Steve Sakoman <[email protected]>
+
+	omap3_overo	ARM CORTEX-A8 (OMAP3xx SoC)
+
 Robert Schwebel <[email protected]>
 
 	csb226		xscale
MAKEALL +1 -0
Index: u-boot-main/MAKEALL
===================================================================
@@ -508,6 +508,7 @@ LIST_ARM9="			\
 	davinci_sonata		\
 	omap3_beagle		\
 	omap3_evm		\
+	omap3_overo		\
 "
 
 #########################################################################
board/omap3/overo/overo.h new file +375 -0

375 lines not on this page · raw message

#18 lore raw

PATCH v5 13/13 ARM: OMAP3: Add Beagle, EVM and Overo configuration and README

From: Dirk Behme <[email protected]>

Add Beagle, EVM and Overo configuration and README

---
 doc/README.omap3               |   94 +++++++++++
 include/configs/omap3_beagle.h |  289 ++++++++++++++++++++++++++++++++++++
 include/configs/omap3_evm.h    |  322 +++++++++++++++++++++++++++++++++++++++++
 include/configs/omap3_overo.h  |  280 +++++++++++++++++++++++++++++++++++
 4 files changed, 985 insertions(+)
include/configs/omap3_beagle.h new file +289 -0
Index: u-boot-main/include/configs/omap3_beagle.h
===================================================================
@@ -0,0 +1,289 @@
+/*
+ * (C) Copyright 2006-2008
+ * Texas Instruments.
+ * Richard Woodruff <[email protected]>
+ * Syed Mohammed Khasim <[email protected]>
+ *
+ * Configuration settings for the TI OMAP3530 Beagle board.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+#include <asm/sizes.h>
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_ARMCORTEXA8	1	/* This is an ARM V7 CPU core */
+#define CONFIG_OMAP		1	/* in a TI OMAP core */
+#define CONFIG_OMAP34XX		1	/* which is a 34XX */
+#define CONFIG_OMAP3430		1	/* which is in a 3430 */
+#define CONFIG_OMAP3_BEAGLE	1	/* working with BEAGLE */
+#define CONFIG_DOS_PARTITION	1
+
+#include <asm/arch/cpu.h>	/* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+/* Clock Defines */
+#define V_OSCK                   26000000	/* Clock output from T2 */
+#define V_SCLK                   (V_OSCK >> 1)
+
+#undef CONFIG_USE_IRQ		/* no support for IRQs */
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_CMDLINE_TAG       1	/* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS 1
+#define CONFIG_INITRD_TAG        1
+#define CONFIG_REVISION_TAG      1
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE          SZ_128K /* Total Size Environment Sector */
+#define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + SZ_128K)
+#define CONFIG_SYS_GBL_DATA_SIZE        128	 /* bytes reserved for initial data */
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * NS16550 Configuration
+ */
+#define V_NS16550_CLK            (48000000)	/* 48MHz (APLL96/2) */
+
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE     (-4)
+#define CONFIG_SYS_NS16550_CLK          V_NS16550_CLK
+
+/*
+ * select serial console configuration
+ */
+#define CONFIG_CONS_INDEX        3
+#define CONFIG_SYS_NS16550_COM3         OMAP34XX_UART3
+#define CONFIG_SERIAL3           3	/* UART3 on Beagle Rev 2 */
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_BAUDRATE          115200
+#define CONFIG_SYS_BAUDRATE_TABLE       {4800, 9600, 19200, 38400, 57600, 115200}
+#define CONFIG_MMC		1
+#define CONFIG_SYS_MMC_BASE		0xF0000000
+#define CONFIG_DOS_PARTITION	1
+
+/* commands to include */
+
+#define CONFIG_CMD_EXT2		/* EXT2 Support			*/
+#define CONFIG_CMD_FAT		/* FAT support			*/
+#define CONFIG_CMD_JFFS2	/* JFFS2 Support		*/
+
+#define CONFIG_CMD_I2C		/* I2C serial bus support	*/
+#define CONFIG_CMD_MMC		/* MMC support			*/
+#define CONFIG_CMD_NAND		/* NAND support			*/
+
+#define CONFIG_CMD_AUTOSCRIPT	/* autoscript support		*/
+#define CONFIG_CMD_BDI		/* bdinfo			*/
+#define CONFIG_CMD_BOOTD	/* bootd			*/
+#define CONFIG_CMD_CONSOLE	/* coninfo			*/
+#define CONFIG_CMD_ECHO		/* echo arguments		*/
+#define CONFIG_CMD_ENV		/* saveenv			*/
+#define CONFIG_CMD_ITEST	/* Integer (and string) test	*/
+#define CONFIG_CMD_LOADB	/* loadb			*/
+#define CONFIG_CMD_MEMORY	/* md mm nm mw cp cmp crc base loop mtest */
+#define CONFIG_CMD_MISC		/* misc functions like sleep etc*/
+#define CONFIG_CMD_RUN		/* run command in env variable	*/
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_SYS_I2C_SPEED            100000
+#define CONFIG_SYS_I2C_SLAVE            1
+#define CONFIG_SYS_I2C_BUS              0
+#define CONFIG_SYS_I2C_BUS_SELECT       1
+#define CONFIG_DRIVER_OMAP34XX_I2C 1
+
+/*
+ *  Board NAND Info.
+ */
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_SYS_NAND_ADDR NAND_BASE	/* physical address to access nand */
+#define CONFIG_SYS_NAND_BASE NAND_BASE	/* physical address to access nand at CS0 */
+#define GPMC_NAND_ECC_LP_x16_LAYOUT 1
+
+#define CONFIG_SYS_MAX_NAND_DEVICE      1	/* Max number of NAND devices */
+#define SECTORSIZE               512
+
+#define NAND_ALLOW_ERASE_ALL
+#define ADDR_COLUMN              1
+#define ADDR_PAGE                2
+#define ADDR_COLUMN_PAGE         3
+
+#define NAND_ChipID_UNKNOWN      0x00
+#define NAND_MAX_FLOORS          1
+#define NAND_MAX_CHIPS           1
+#define NAND_NO_RB               1
+#define CONFIG_SYS_NAND_WP
+
+#define CONFIG_JFFS2_NAND
+/* nand device jffs2 lives on */
+#define CONFIG_JFFS2_DEV		"nand0"
+/* start of jffs2 partition */
+#define CONFIG_JFFS2_PART_OFFSET	0x680000
+#define CONFIG_JFFS2_PART_SIZE 	0xf980000	/* size of jffs2 partition */
+
+/* Environment information */
+#define CONFIG_BOOTDELAY         10
+
+#define CONFIG_BOOTCOMMAND "nand read 80200000 280000 400000 ; bootm 80200000"
+
+#define CONFIG_BOOTARGS "setenv bootargs console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2"
+
+#define CONFIG_NETMASK           255.255.254.0
+#define CONFIG_BOOTFILE          "uImage"
+#define CONFIG_AUTO_COMPLETE     1
+/*
+ * Miscellaneous configurable options
+ */
+#define V_PROMPT                 "OMAP3 beagleboard.org # "
+
+#define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_PROMPT               V_PROMPT
+#define CONFIG_SYS_CBSIZE               256	/* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE               (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT)+16)
+#define CONFIG_SYS_MAXARGS              16	/* max number of command args */
+#define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE	/* Boot Argument Buffer Size */
+
+#define CONFIG_SYS_MEMTEST_START        (OMAP34XX_SDRC_CS0)	/* memtest works on */
+#define CONFIG_SYS_MEMTEST_END          (OMAP34XX_SDRC_CS0 + 0x01F00000) /* 31MB */
+
+#undef	CONFIG_SYS_CLKS_IN_HZ		/* everything, incl board info, in Hz */
+
+#define CONFIG_SYS_LOAD_ADDR            (OMAP34XX_SDRC_CS0) /* default load address */
+
+/* 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
+ * 32KHz clk, or from external sig. This rate is divided by a local divisor.
+ */
+#define V_PVT                    7
+
+#define CONFIG_SYS_TIMERBASE            OMAP34XX_GPT2
+#define CONFIG_SYS_PVT                  V_PVT	/* 2^(pvt+1) */
+#define CONFIG_SYS_HZ                   ((V_SCLK) / (2 << CONFIG_SYS_PVT))
+
+/*-----------------------------------------------------------------------
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE	SZ_128K	/* regular stack */
+#ifdef CONFIG_USE_IRQ
+#define CONFIG_STACKSIZE_IRQ	SZ_4K	/* IRQ stack */
+#define CONFIG_STACKSIZE_FIQ	SZ_4K	/* FIQ stack */
+#endif
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
+#define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
+#define PHYS_SDRAM_1_SIZE	SZ_32M	/* at least 32 meg */
+#define PHYS_SDRAM_2		OMAP34XX_SDRC_CS1
+
+/* SDRAM Bank Allocation method */
+#define SDRC_R_B_C		1
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+
+/* **** PISMO SUPPORT *** */
+
+/* Configure the PISMO */
+#define PISMO1_NOR_SIZE_SDPV2	GPMC_SIZE_128M
+#define PISMO1_NOR_SIZE		GPMC_SIZE_64M
+
+#define PISMO1_NAND_SIZE	GPMC_SIZE_128M
+#define PISMO1_ONEN_SIZE	GPMC_SIZE_128M
+#define DBG_MPDB_SIZE		GPMC_SIZE_16M
+#define PISMO2_SIZE		0
+
+#define CONFIG_SYS_MAX_FLASH_SECT	(520)	/* max number of sectors on one chip */
+#define CONFIG_SYS_MAX_FLASH_BANKS      2	/* max number of flash banks */
+#define CONFIG_SYS_MONITOR_LEN		SZ_256K	/* Reserve 2 sectors */
+
+#define PHYS_FLASH_SIZE_SDPV2	SZ_128M
+#define PHYS_FLASH_SIZE		SZ_32M
+
+#define CONFIG_SYS_FLASH_BASE		boot_flash_base
+#define PHYS_FLASH_SECT_SIZE	boot_flash_sec
+/* Dummy declaration of flash banks to get compilation right */
+#define CONFIG_SYS_FLASH_BANKS_LIST	{0, 0}
+
+#define CONFIG_SYS_MONITOR_BASE	CONFIG_SYS_FLASH_BASE	/* Monitor at start of flash */
+#define CONFIG_SYS_ONENAND_BASE	ONENAND_MAP
+
+#define CONFIG_ENV_IS_IN_NAND	1
+#define ONENAND_ENV_OFFSET	0x260000	/* environment starts here  */
+#define SMNAND_ENV_OFFSET	0x260000	/* environment starts here  */
+
+#define CONFIG_SYS_ENV_SECT_SIZE	boot_flash_sec
+#define CONFIG_ENV_OFFSET	boot_flash_off
+#define CONFIG_ENV_ADDR		SMNAND_ENV_OFFSET
+
+/*-----------------------------------------------------------------------
+ * CFI FLASH driver setup
+ */
+/* timeout values are in ticks */
+#define CONFIG_SYS_FLASH_ERASE_TOUT	(100 * CONFIG_SYS_HZ)	/* Timeout for Flash Erase */
+#define CONFIG_SYS_FLASH_WRITE_TOUT	(100 * CONFIG_SYS_HZ)	/* Timeout for Flash Write */
+
+/* Flash banks JFFS2 should use */
+#define CONFIG_SYS_MAX_MTD_BANKS	(CONFIG_SYS_MAX_FLASH_BANKS + CONFIG_SYS_MAX_NAND_DEVICE)
+#define CONFIG_SYS_JFFS2_MEM_NAND
+#define CONFIG_SYS_JFFS2_FIRST_BANK	CONFIG_SYS_MAX_FLASH_BANKS	/* use flash_info[2] */
+#define CONFIG_SYS_JFFS2_NUM_BANKS	1
+
+#define ENV_IS_VARIABLE		1
+
+#ifndef __ASSEMBLY__
+extern unsigned int *nand_cs_base;
+extern unsigned int boot_flash_base;
+extern volatile unsigned int boot_flash_env_addr;
+extern unsigned int boot_flash_off;
+extern unsigned int boot_flash_sec;
+extern unsigned int boot_flash_type;
+#endif
+
+
+#define WRITE_NAND_COMMAND(d, adr)\
+		       writel(d, (nand_cs_base + OFFS(GPMC_NAND_CMD)))
+#define WRITE_NAND_ADDRESS(d, adr)\
+		       writel(d, (nand_cs_base + OFFS(GPMC_NAND_ADR)))
+#define WRITE_NAND(d, adr) writew(d, (nand_cs_base + OFFS(GPMC_NAND_DAT)))
+#define READ_NAND(adr) readl((nand_cs_base + OFFS(GPMC_NAND_DAT)))
+
+/* Other NAND Access APIs */
+#define NAND_WP_OFF() do {readl(GPMC_CONFIG_REG) |= GPMC_CONFIG_WP; } while (0)
+#define NAND_WP_ON() do {readl(GPMC_CONFIG_REG) &= ~GPMC_CONFIG_WP; } while (0)
+#define NAND_DISABLE_CE(nand)
+#define NAND_ENABLE_CE(nand)
+#define NAND_WAIT_READY(nand)	udelay(10)
+
+#endif				/* __CONFIG_H */
include/configs/omap3_evm.h new file +322 -0

322 lines not on this page · raw message

include/configs/omap3_overo.h new file +280 -0

280 lines not on this page · raw message

doc/README.omap3 new file +94 -0

95 lines not on this page · raw message

#2 lore raw

PATCH v5 8/13 ARM: OMAP3: Add MMC support

In reply to dirk.behme at googlemail.com

Hi,

drivers/mmc/Makefile include $(TOPDIR)/config.mk · line 32

Quoted 13 lines

+}
Index: u-boot-arm/drivers/mmc/Makefile
===================================================================

drivers/mmc/Makefile +3 -0
@@ -26,6 +26,9 @@ include $(TOPDIR)/config.mk
 LIB    := $(obj)libmmc.a
 
 COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o
+COBJS-$(CONFIG_OMAP3_BEAGLE) += omap3_mmc.o
+COBJS-$(CONFIG_OMAP3_EVM) += omap3_mmc.o
+COBJS-$(CONFIG_OVERO) += omap3_mmc.o
 

How about to integrate CONFIG_OMAP3_MMC instead of board one?

Thank you,
Kyungmin Park

#5 lore raw

PATCH v5 9/13 ARM: OMAP3: Add I2C support

In reply to dirk.behme at googlemail.com
Quoted 38 lines · dirk.behme at googlemail.com

Subject: [PATCH 09/13 v5] ARM: OMAP3: Add I2C support

From: Dirk Behme <[email protected]>

Add I2C support

---
Changes in version v5:

- Split functional changes and coding style clean up as proposed by Jean-Christophe PLAGNIOL-VILLARD.

Changes in version v2:

- Remove SMC911X network init as proposed by Ben Warren. Thanks!

 drivers/i2c/Makefile       |    1 +
 drivers/i2c/omap24xx_i2c.c |   24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

Index: u-boot-main/drivers/i2c/Makefile
===================================================================

drivers/i2c/Makefile +1 -0
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 

Index: u-boot-main/drivers/i2c/omap24xx_i2c.c
===================================================================

drivers/i2c/omap24xx_i2c.c line 31

Quoted 7 lines
drivers/i2c/omap24xx_i2c.c +2 -0
@@ -25,6 +25,8 @@
 #include <asm/arch/i2c.h>
 #include <asm/io.h>
 
+#define inb(a) __raw_readb(a)
+#define outb(a, v) __raw_writeb(a, v)
 #define inw(a) __raw_readw(a)
 #define outw(a,v) __raw_writew(a,v)

This 4 macro is supposed to be defined in io.h

drivers/i2c/omap24xx_i2c.c static int i2c_read_byte (u8 devaddr, u8 · line 118

Quoted 7 lines
drivers/i2c/omap24xx_i2c.c +2 -0
@@ -112,7 +114,11 @@ static int i2c_read_byte (u8 devaddr, u8
 
 		status = wait_for_pin ();
 		if (status & I2C_STAT_RRDY) {
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
+			*value = inb(I2C_DATA);

please respect the file style, add a space before '(' and so on

drivers/i2c/omap24xx_i2c.c static int i2c_read_byte (u8 devaddr, u8 · line 122

Quoted 4 lines
drivers/i2c/omap24xx_i2c.c +2 -0
+#else
 			*value = inw (I2C_DATA);
+#endif
 			udelay (20000);

Best Regards,
J.

author
#6 lore raw

PATCH v5 9/13 ARM: OMAP3: Add I2C support

Quoted 43 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 41 lines · dirk.behme at googlemail.com

Subject: [PATCH 09/13 v5] ARM: OMAP3: Add I2C support

From: Dirk Behme <[email protected]>

Add I2C support

---
Changes in version v5:

- Split functional changes and coding style clean up as proposed by Jean-Christophe PLAGNIOL-VILLARD.

Changes in version v2:

- Remove SMC911X network init as proposed by Ben Warren. Thanks!

drivers/i2c/Makefile | 1 +
drivers/i2c/omap24xx_i2c.c | 24 ++++++++++++++++++++++++

2 files changed, 25 insertions(+)

Index: u-boot-main/drivers/i2c/Makefile
===================================================================

drivers/i2c/Makefile +0 -0
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o

COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o +COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o

Index: u-boot-main/drivers/i2c/omap24xx_i2c.c
===================================================================

drivers/i2c/omap24xx_i2c.c +0 -0
@@ -25,6 +25,8 @@
 #include <asm/arch/i2c.h>
 #include <asm/io.h>
 
Quoted 6 lines

drivers/i2c/omap24xx_i2c.c line 31

Quoted 4 lines
drivers/i2c/omap24xx_i2c.c +2 -0
+#define inb(a) __raw_readb(a)
+#define outb(a, v) __raw_writeb(a, v)
 #define inw(a) __raw_readw(a)
 #define outw(a,v) __raw_writew(a,v)

This 4 macro is supposed to be defined in io.h

Even if I have to touch a global/common file for this?

Quoted 10 lines

drivers/i2c/omap24xx_i2c.c static int i2c_read_byte (u8 devaddr, u8 · line 118

Quoted 7 lines
drivers/i2c/omap24xx_i2c.c +2 -0
@@ -112,7 +114,11 @@ static int i2c_read_byte (u8 devaddr, u8
 
 		status = wait_for_pin ();
 		if (status & I2C_STAT_RRDY) {
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
+			*value = inb(I2C_DATA);

please respect the file style, add a space before '(' and so on

You prefer file style over global coding style? As I understand it "inb(" is global coding style, and I tried to be in sync with global coding style at least with code I add.

Quoted 8 lines

drivers/i2c/omap24xx_i2c.c static int i2c_read_byte (u8 devaddr, u8 · line 122

Quoted 4 lines
drivers/i2c/omap24xx_i2c.c +2 -0
+#else
 			*value = inw (I2C_DATA);
+#endif
 			udelay (20000);

Best Regards,
J.

#7 lore raw

PATCH v5 9/13 ARM: OMAP3: Add I2C support

Dear Dirk Behme,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 7 lines
Quoted 5 lines
drivers/i2c/omap24xx_i2c.c +2 -0
+#define inb(a) __raw_readb(a)
+#define outb(a, v) __raw_writeb(a, v)

#define inw(a) __raw_readw(a)
#define outw(a,v) __raw_writew(a,v)

This 4 macro is supposed to be defined in io.h

Even if I have to touch a global/common file for this?

If they are missing in io.h, this should be fixed, indeed.

Quoted 11 lines
Quoted 7 lines

drivers/i2c/omap24xx_i2c.c static int i2c_read_byte (u8 devaddr, u8 · line 118

Quoted 4 lines
		status = wait_for_pin ();
		if (status & I2C_STAT_RRDY) {
drivers/i2c/omap24xx_i2c.c +2 -0
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
+			*value = inb(I2C_DATA);

please respect the file style, add a space before '(' and so on

You prefer file style over global coding style? As I understand it "inb(" is global coding style, and I tried to be in sync with global coding style at least with code I add.

It is more important to use a consistent style in a single source file, indeed.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It seems intuitively obvious to me, which  means  that  it  might  be
wrong.                                                 -- Chris Torek
#3 lore raw

PATCH v5 8/13 ARM: OMAP3: Add MMC support

In reply to dirk.behme at googlemail.com
Quoted 4 lines · dirk.behme at googlemail.com

Subject: [PATCH 08/13 v5] ARM: OMAP3: Add MMC support

From: Dirk Behme <[email protected]>

+

Quoted 14 lines
include/asm-arm/arch-omap3/mmc_host_def.h new file +14 -0
+/*
+ * OMAP HSMMC register definitions
+ */
+#define OMAP_HSMMC_SYSCONFIG		(*(unsigned int *) 0x4809C010)
+#define OMAP_HSMMC_SYSSTATUS		(*(unsigned int *) 0x4809C014)
+#define OMAP_HSMMC_CON			(*(unsigned int *) 0x4809C02C)
+#define OMAP_HSMMC_BLK			(*(unsigned int *) 0x4809C104)
+#define OMAP_HSMMC_ARG			(*(unsigned int *) 0x4809C108)
+#define OMAP_HSMMC_CMD			(*(unsigned int *) 0x4809C10C)
+#define OMAP_HSMMC_RSP10		(*(unsigned int *) 0x4809C110)
+#define OMAP_HSMMC_RSP32		(*(unsigned int *) 0x4809C114)
+#define OMAP_HSMMC_RSP54		(*(unsigned int *) 0x4809C118)
+#define OMAP_HSMMC_RSP76		(*(unsigned int *) 0x4809C11C)
+#define OMAP_HSMMC_DATA			(*(unsigned int *) 0x4809C120)

include/asm-arm/arch-omap3/mmc_host_def.h line 51

Quoted 10 lines
include/asm-arm/arch-omap3/mmc_host_def.h new file +10 -0
+#define OMAP_HSMMC_PSTATE		(*(unsigned int *) 0x4809C124)
+#define OMAP_HSMMC_HCTL			(*(unsigned int *) 0x4809C128)
+#define OMAP_HSMMC_SYSCTL		(*(unsigned int *) 0x4809C12C)
+#define OMAP_HSMMC_STAT			(*(unsigned int *) 0x4809C130)
+#define OMAP_HSMMC_IE			(*(unsigned int *) 0x4809C134)
+#define OMAP_HSMMC_CAPA			(*(unsigned int *) 0x4809C140)
+
+/* T2 Register definitions */
+#define CONTROL_DEV_CONF0		(*(unsigned int *) 0x48002274)
+#define CONTROL_PBIAS_LITE		(*(unsigned int *) 0x48002520)

please just define the register and as we agree use readx/writex

please note that their is a new MMC Framework in progress please take a look

Andy, Haavard please comment.

Best Regards,
J.

#9 lore raw

PATCH v5 10/13 ARM: OMAP3: Add BeagleBoard

In reply to dirk.behme at googlemail.com
Quoted 37 lines

+ * Description: Early hardware init.
+ *****************************************************************************/

board/omap3/beagle/beagle.c new file +35 -0
+int board_init(void)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+
+	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+	/* board id for Linux */
+	gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;
+	/* boot param addr */
+	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+	return 0;
+}
+
+/******************************************************************************
+ * Routine: misc_init_r
+ * Description: Init ethernet (done here so udelay works)
+ *****************************************************************************/
+int misc_init_r(void)
+{
+
+	unsigned char byte;
+
+#ifdef CONFIG_DRIVER_OMAP34XX_I2C
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+	/* set vaux3 to 2.8V */
+	byte = 0x20;
+	i2c_write(0x4B, 0x7A, 1, &byte, 1);
+	byte = 0x03;
+	i2c_write(0x4B, 0x7D, 1, &byte, 1);
+
+	/* set vpll2 to 1.8V */
+	byte = 0xE0;
+	i2c_write(0x4B, 0x8E, 1, &byte, 1);
+	byte = 0x05;

board/omap3/beagle/beagle.c line 88

Quoted 10 lines
board/omap3/beagle/beagle.c new file +10 -0
+	i2c_write(0x4B, 0x91, 1, &byte, 1);
+
+	/* set VDAC to 1.8V */
+	byte = 0x20;
+	i2c_write(0x4B, 0x96, 1, &byte, 1);
+	byte = 0x03;
+	i2c_write(0x4B, 0x99, 1, &byte, 1);
+
+	byte = 0x33;
+	i2c_write(0x4A, 0xEE, 1, &byte, 1);

please a comment to explain what you do by I2C

Best Reagers,
J.

#11 lore raw

PATCH v5 11/13 ARM: OMAP3: Add EVM board

In reply to dirk.behme at googlemail.com
Quoted 19 lines
board/omap3/evm/evm.c new file +19 -0
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+
+#if defined(CONFIG_CMD_NET)
+	setup_net_chip();
+#endif
+
+	return 0;
+}
+
+/******************************************************************************
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *              hardware. Many pins need to be moved from protect to primary
+ *              mode.
+ *****************************************************************************/
+void set_muxconf_regs(void)
+{
+	MUX_EVM();

board/omap3/evm/evm.c line 92

Quoted 10 lines
board/omap3/evm/evm.c new file +10 -0
+}
+
+/******************************************************************************
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *              Ethernet hardware. Pin Muxing for the SMC9118 is initialized
+ *              here.
+ *****************************************************************************/
+static int setup_net_chip(void)
+{

in this function please add some blank line to make the code more readable

Quoted 31 lines
board/omap3/evm/evm.c new file +31 -0
+	int i = 0;
+
+	/* Configure GPMC registers */
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0150)) = 0x00001000;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0154)) = 0x001e1e01;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0158)) = 0x00080300;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x015C)) = 0x1c091c09;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0160)) = 0x04181f1f;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0164)) = 0x00000FCF;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0168)) = 0x00000f6c;
+
+	/* Configure PIN MUX registers */
+	/* Enable GPMC Pin Mux Registers */
+	/* Enable GPMC_CLK Pin in CONTROL_PADCONF_gpmc_ncs7 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xBC)) |= 0x00180000;
+	/* Enable CS5 Pin in CONTROL_PADCONF_gpmc_ncs5 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) |= 0x00000018;
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) &= 0xFFFFFFF8;
+	/* Enable offmode for nwe in CONTROL_PADCONF_GPMC_NWE register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00000F00;
+	/* En off mode for noe and ale in CONTROL_PADCONF_GPMC_NADV_ALE reg */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC0)) |= 0x0E000E00;
+	/* Enable gpmc_nbe0_cle in CONTROL_PADCONF_GPMC_NWE register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00180000;
+
+	/* Enable gpmc_nbe1 in CONTROL_PADCONF_GPMC_NBE1 register and
+	configuring the mux mode to 0 */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) |= 0x00000018;
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) &= 0xFFFFFFF8;
+	/* Enable d15 in CONTROL_PADCONF_GPMC_D15 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xAC)) |= 0x00000018;

board/omap3/evm/evm.c line 133

Quoted 10 lines
board/omap3/evm/evm.c new file +10 -0
+	/* Enable d14 - d13 in CONTROL_PADCONF_GPMC_D13 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA8)) |= 0x00180018;
+	/* Enable d12 - d11 in CONTROL_PADCONF_GPMC_D11 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA4)) |= 0x00180018;
+	/* Enable d10 - d9 in CONTROL_PADCONF_GPMC_D9 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA0)) |= 0x00180018;
+	/* Enable d8 - d7 in CONTROL_PADCONF_GPMC_D7 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x9C)) |= 0x00180018;
+	/* Enable d6 - d5 in CONTROL_PADCONF_GPMC_D5 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x98)) |= 0x00180018;

Best Regards,
J.

#16 lore raw

PATCH v5 12/13 ARM: OMAP3: Add Overo board

In reply to dirk.behme at googlemail.com

+

Quoted 28 lines
board/omap3/overo/overo.c new file +28 -0
+/******************************************************************************
+ * Routine: misc_init_r
+ * Description: Init ethernet (done here so udelay works)
+ *****************************************************************************/
+int misc_init_r(void)
+{
+
+	unsigned char byte;
+
+#ifdef CONFIG_DRIVER_OMAP34XX_I2C
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+	/* set vaux2 to 2.8V */
+	byte = 0x20;
+	i2c_write(0x4B, 0x76, 1, &byte, 1);
+	byte = 0x09;
+	i2c_write(0x4B, 0x79, 1, &byte, 1);
+
+	/* set vaux3 to 2.8V */
+	byte = 0x20;
+	i2c_write(0x4B, 0x7A, 1, &byte, 1);
+	byte = 0x03;
+	i2c_write(0x4B, 0x7D, 1, &byte, 1);
+
+	/* set vpll2 to 1.8V */
+	byte = 0xE0;
+	i2c_write(0x4B, 0x8E, 1, &byte, 1);
+	byte = 0x05;

board/omap3/overo/overo.c line 93

Quoted 10 lines
board/omap3/overo/overo.c new file +10 -0
+	i2c_write(0x4B, 0x91, 1, &byte, 1);
+
+	/* set VDAC to 1.8V */
+	byte = 0x20;
+	i2c_write(0x4B, 0x96, 1, &byte, 1);
+	byte = 0x03;
+	i2c_write(0x4B, 0x99, 1, &byte, 1);
+
+	byte = 0x33;
+	i2c_write(0x4A, 0xEE, 1, &byte, 1);

as beagle board please add a comment a comment to explain what you do on I2C

board/omap3/overo/overo.c line 101

Quoted 8 lines
board/omap3/overo/overo.c new file +8 -0
+
+	*((uint *) 0x49058034) = 0xFFFFFAF9;
+	*((uint *) 0x49056034) = 0x0F9F0FFF;
+	*((uint *) 0x49058094) = 0x00000506;
+	*((uint *) 0x49056094) = 0xF060F000;
+
+	return 0;
+}

Best Regards,
J.

#19 lore raw

PATCH v5 13/13 ARM: OMAP3: Add Beagle, EVM and Overo configuration and README

In reply to dirk.behme at googlemail.com
Quoted 54 lines · dirk.behme at googlemail.com

From: Dirk Behme <[email protected]>

Add Beagle, EVM and Overo configuration and README

---
 doc/README.omap3               |   94 +++++++++++
 include/configs/omap3_beagle.h |  289 ++++++++++++++++++++++++++++++++++++
 include/configs/omap3_evm.h    |  322 +++++++++++++++++++++++++++++++++++++++++
 include/configs/omap3_overo.h  |  280 +++++++++++++++++++++++++++++++++++
 4 files changed, 985 insertions(+)

Index: u-boot-main/include/configs/omap3_beagle.h
===================================================================

include/configs/omap3_beagle.h new file +36 -0
@@ -0,0 +1,289 @@
+/*
+ * (C) Copyright 2006-2008
+ * Texas Instruments.
+ * Richard Woodruff <[email protected]>
+ * Syed Mohammed Khasim <[email protected]>
+ *
+ * Configuration settings for the TI OMAP3530 Beagle board.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+#include <asm/sizes.h>
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_ARMCORTEXA8	1	/* This is an ARM V7 CPU core */
+#define CONFIG_OMAP		1	/* in a TI OMAP core */

include/configs/omap3_beagle.h line 46

Quoted 10 lines
include/configs/omap3_beagle.h new file +10 -0
+#define CONFIG_OMAP34XX		1	/* which is a 34XX */
+#define CONFIG_OMAP3430		1	/* which is in a 3430 */
+#define CONFIG_OMAP3_BEAGLE	1	/* working with BEAGLE */
+#define CONFIG_DOS_PARTITION	1
+
+#include <asm/arch/cpu.h>	/* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+/* Clock Defines */
+#define V_OSCK                   26000000	/* Clock output from T2 */
		 ^^^^^^^^^^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 47

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define V_SCLK                   (V_OSCK >> 1)
		 ^^^^^^^^^^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 52

Quoted 5 lines
include/configs/omap3_beagle.h new file +5 -0
+
+#undef CONFIG_USE_IRQ		/* no support for IRQs */
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_CMDLINE_TAG       1	/* enable passing of ATAGs */
			     ^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 54

Quoted 2 lines
include/configs/omap3_beagle.h new file +2 -0
+#define CONFIG_SETUP_MEMORY_TAGS 1
+#define CONFIG_INITRD_TAG        1
			    ^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 55

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define CONFIG_REVISION_TAG      1
			      ^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 60

Quoted 5 lines
include/configs/omap3_beagle.h new file +5 -0
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE          SZ_128K /* Total Size Environment Sector */
			  ^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 61

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + SZ_128K)
				^^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 62

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define CONFIG_SYS_GBL_DATA_SIZE        128	 /* bytes reserved for initial data */
				   ^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 71

Quoted 9 lines
include/configs/omap3_beagle.h new file +9 -0
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * NS16550 Configuration
+ */
+#define V_NS16550_CLK            (48000000)	/* 48MHz (APLL96/2) */
			^^^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 75

Quoted 4 lines
include/configs/omap3_beagle.h new file +4 -0
+
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE     (-4)
				      ^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 76

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define CONFIG_SYS_NS16550_CLK          V_NS16550_CLK
				 ^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 81

Quoted 5 lines
include/configs/omap3_beagle.h new file +5 -0
+
+/*
+ * select serial console configuration
+ */
+#define CONFIG_CONS_INDEX        3
			    ^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 82

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define CONFIG_SYS_NS16550_COM3         OMAP34XX_UART3
				  ^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 83

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define CONFIG_SERIAL3           3	/* UART3 on Beagle Rev 2 */
			 ^^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 87

Quoted 4 lines
include/configs/omap3_beagle.h new file +4 -0
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_BAUDRATE          115200
			  ^^^^^^^^^^

whitespace please fix

include/configs/omap3_beagle.h line 88

Quoted 1 line
include/configs/omap3_beagle.h new file +1 -0
+#define CONFIG_SYS_BAUDRATE_TABLE       {4800, 9600, 19200, 38400, 57600, 115200}
				    ^^^^^^^

whitespace please fix

Quoted 18 lines
include/configs/omap3_beagle.h new file +18 -0
+#define CONFIG_MMC		1
+#define CONFIG_SYS_MMC_BASE		0xF0000000
+#define CONFIG_DOS_PARTITION	1
+
+/* commands to include */
+
+#define CONFIG_CMD_EXT2		/* EXT2 Support			*/
+#define CONFIG_CMD_FAT		/* FAT support			*/
+#define CONFIG_CMD_JFFS2	/* JFFS2 Support		*/
+
+#define CONFIG_CMD_I2C		/* I2C serial bus support	*/
+#define CONFIG_CMD_MMC		/* MMC support			*/
+#define CONFIG_CMD_NAND		/* NAND support			*/
+
+#define CONFIG_CMD_AUTOSCRIPT	/* autoscript support		*/
+#define CONFIG_CMD_BDI		/* bdinfo			*/
+#define CONFIG_CMD_BOOTD	/* bootd			*/
+#define CONFIG_CMD_CONSOLE	/* coninfo			*/

include/configs/omap3_beagle.h line 116

Quoted 10 lines
include/configs/omap3_beagle.h new file +10 -0
+#define CONFIG_CMD_ECHO		/* echo arguments		*/
+#define CONFIG_CMD_ENV		/* saveenv			*/
+#define CONFIG_CMD_ITEST	/* Integer (and string) test	*/
+#define CONFIG_CMD_LOADB	/* loadb			*/
+#define CONFIG_CMD_MEMORY	/* md mm nm mw cp cmp crc base loop mtest */
+#define CONFIG_CMD_MISC		/* misc functions like sleep etc*/
+#define CONFIG_CMD_RUN		/* run command in env variable	*/
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_SYS_I2C_SPEED            100000
			       ^^^^^^^^^^^^

whitespace please fix
and so on

Quoted 30 lines
include/configs/omap3_beagle.h new file +30 -0
+#define CONFIG_SYS_I2C_SLAVE            1
+#define CONFIG_SYS_I2C_BUS              0
+#define CONFIG_SYS_I2C_BUS_SELECT       1
+#define CONFIG_DRIVER_OMAP34XX_I2C 1
+
+/*
+ *  Board NAND Info.
+ */
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_SYS_NAND_ADDR NAND_BASE	/* physical address to access nand */
+#define CONFIG_SYS_NAND_BASE NAND_BASE	/* physical address to access nand at CS0 */
+#define GPMC_NAND_ECC_LP_x16_LAYOUT 1
+
+#define CONFIG_SYS_MAX_NAND_DEVICE      1	/* Max number of NAND devices */
+#define SECTORSIZE               512
+
+#define NAND_ALLOW_ERASE_ALL
+#define ADDR_COLUMN              1
+#define ADDR_PAGE                2
+#define ADDR_COLUMN_PAGE         3
+
+#define NAND_ChipID_UNKNOWN      0x00
+#define NAND_MAX_FLOORS          1
+#define NAND_MAX_CHIPS           1
+#define NAND_NO_RB               1
+#define CONFIG_SYS_NAND_WP
+
+#define CONFIG_JFFS2_NAND
+/* nand device jffs2 lives on */
+#define CONFIG_JFFS2_DEV		"nand0"

include/configs/omap3_beagle.h line 156

Quoted 10 lines
include/configs/omap3_beagle.h new file +10 -0
+/* start of jffs2 partition */
+#define CONFIG_JFFS2_PART_OFFSET	0x680000
+#define CONFIG_JFFS2_PART_SIZE 	0xf980000	/* size of jffs2 partition */
+
+/* Environment information */
+#define CONFIG_BOOTDELAY         10
+
+#define CONFIG_BOOTCOMMAND "nand read 80200000 280000 400000 ; bootm 80200000"
+
+#define CONFIG_BOOTARGS "setenv bootargs console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2"

too long please split

Quoted 4 lines
include/configs/omap3_beagle.h new file +4 -0
+
+#define CONFIG_NETMASK           255.255.254.0
+#define CONFIG_BOOTFILE          "uImage"
+#define CONFIG_AUTO_COMPLETE     1

include/configs/omap3_beagle.h line 170

Quoted 10 lines
include/configs/omap3_beagle.h new file +10 -0
+/*
+ * Miscellaneous configurable options
+ */
+#define V_PROMPT                 "OMAP3 beagleboard.org # "
+
+#define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_PROMPT               V_PROMPT
+#define CONFIG_SYS_CBSIZE               256	/* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE               (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT)+16)

too long please split

include/configs/omap3_beagle.h line 172

Quoted 2 lines
include/configs/omap3_beagle.h new file +2 -0
+#define CONFIG_SYS_MAXARGS              16	/* max number of command args */
+#define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE	/* Boot Argument Buffer Size */

too long please split
and so on

Best Regards,
J.

#12 lore raw

PATCH v5 11/13 ARM: OMAP3: Add EVM board

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 63 lines · In message <[email protected]> you wrote:
Quoted 19 lines
board/omap3/evm/evm.c new file +19 -0
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+
+#if defined(CONFIG_CMD_NET)
+	setup_net_chip();
+#endif
+
+	return 0;
+}
+
+/******************************************************************************
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *              hardware. Many pins need to be moved from protect to primary
+ *              mode.
+ *****************************************************************************/
+void set_muxconf_regs(void)
+{
+	MUX_EVM();

board/omap3/evm/evm.c line 92

Quoted 10 lines
board/omap3/evm/evm.c new file +10 -0
+}
+
+/******************************************************************************
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *              Ethernet hardware. Pin Muxing for the SMC9118 is initialized
+ *              here.
+ *****************************************************************************/
+static int setup_net_chip(void)
+{

in this function please add some blank line to make the code more readable

Quoted 33 lines
board/omap3/evm/evm.c new file +33 -0
+	int i = 0;
+
+	/* Configure GPMC registers */
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0150)) = 0x00001000;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0154)) = 0x001e1e01;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0158)) = 0x00080300;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x015C)) = 0x1c091c09;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0160)) = 0x04181f1f;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0164)) = 0x00000FCF;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0168)) = 0x00000f6c;
+
+	/* Configure PIN MUX registers */
+	/* Enable GPMC Pin Mux Registers */
+	/* Enable GPMC_CLK Pin in CONTROL_PADCONF_gpmc_ncs7 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xBC)) |= 0x00180000;
+	/* Enable CS5 Pin in CONTROL_PADCONF_gpmc_ncs5 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) |= 0x00000018;
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) &= 0xFFFFFFF8;
+	/* Enable offmode for nwe in CONTROL_PADCONF_GPMC_NWE register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00000F00;
+	/* En off mode for noe and ale in CONTROL_PADCONF_GPMC_NADV_ALE reg */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC0)) |= 0x0E000E00;
+	/* Enable gpmc_nbe0_cle in CONTROL_PADCONF_GPMC_NWE register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00180000;
+
+	/* Enable gpmc_nbe1 in CONTROL_PADCONF_GPMC_NBE1 register and
+	configuring the mux mode to 0 */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) |= 0x00000018;
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) &= 0xFFFFFFF8;
+	/* Enable d15 in CONTROL_PADCONF_GPMC_D15 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xAC)) |= 0x00000018;
+	/* Enable d14 - d13 in CONTROL_PADCONF_GPMC_D13 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA8)) |= 0x00180018;
Quoted 8 lines

board/omap3/evm/evm.c line 133

Quoted 8 lines
board/omap3/evm/evm.c new file +8 -0
+	/* Enable d12 - d11 in CONTROL_PADCONF_GPMC_D11 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA4)) |= 0x00180018;
+	/* Enable d10 - d9 in CONTROL_PADCONF_GPMC_D9 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA0)) |= 0x00180018;
+	/* Enable d8 - d7 in CONTROL_PADCONF_GPMC_D7 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x9C)) |= 0x00180018;
+	/* Enable d6 - d5 in CONTROL_PADCONF_GPMC_D5 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x98)) |= 0x00180018;

And please use accessor functions / macros to access the registers. Access through volatile pointers is considered a Bad Thing (TM).

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The Buddha, the Godhead, resides quite as comfortably in the circuits
of a digital computer or the gears of a cycle transmission as he does
at the top of a mountain or in the petals of a flower.
            - R.  Pirsig, "Zen and the Art of Motorcycle Maintenance"
#17 lore raw

PATCH v5 12/13 ARM: OMAP3: Add Overo board

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 10 lines · In message <[email protected]> you wrote:

+

board/omap3/overo/overo.c line 93

Quoted 2 lines
board/omap3/overo/overo.c new file +2 -0
+	byte = 0x33;
+	i2c_write(0x4A, 0xEE, 1, &byte, 1);

as beagle board please add a comment a comment to explain what you do on I2C

board/omap3/overo/overo.c line 98

Quoted 5 lines
board/omap3/overo/overo.c new file +5 -0
+
+	*((uint *) 0x49058034) = 0xFFFFFAF9;
+	*((uint *) 0x49056034) = 0x0F9F0FFF;
+	*((uint *) 0x49058094) = 0x00000506;
+	*((uint *) 0x49056094) = 0xF060F000;

... and what this black magic does.

And see above about using accessor fuctions / macros for register accesses.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is much easier to suggest solutions when you know nothing
author
#14 lore raw

PATCH v5 11/13 ARM: OMAP3: Add EVM board

In reply to a message not in the archive

Dear Wolfgang,

Quoted 73 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 69 lines · In message <[email protected]> you wrote:
Quoted 19 lines
board/omap3/evm/evm.c new file +19 -0
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+
+#if defined(CONFIG_CMD_NET)
+	setup_net_chip();
+#endif
+
+	return 0;
+}
+
+/******************************************************************************
+ * Routine: set_muxconf_regs
+ * Description: Setting up the configuration Mux registers specific to the
+ *              hardware. Many pins need to be moved from protect to primary
+ *              mode.
+ *****************************************************************************/
+void set_muxconf_regs(void)
+{
+	MUX_EVM();

board/omap3/evm/evm.c line 92

Quoted 10 lines
board/omap3/evm/evm.c new file +10 -0
+}
+
+/******************************************************************************
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *              Ethernet hardware. Pin Muxing for the SMC9118 is initialized
+ *              here.
+ *****************************************************************************/
+static int setup_net_chip(void)
+{

in this function please add some blank line to make the code more readable

Quoted 37 lines
board/omap3/evm/evm.c new file +37 -0
+	int i = 0;
+
+	/* Configure GPMC registers */
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0150)) = 0x00001000;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0154)) = 0x001e1e01;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0158)) = 0x00080300;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x015C)) = 0x1c091c09;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0160)) = 0x04181f1f;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0164)) = 0x00000FCF;
+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0168)) = 0x00000f6c;
+
+	/* Configure PIN MUX registers */
+	/* Enable GPMC Pin Mux Registers */
+	/* Enable GPMC_CLK Pin in CONTROL_PADCONF_gpmc_ncs7 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xBC)) |= 0x00180000;
+	/* Enable CS5 Pin in CONTROL_PADCONF_gpmc_ncs5 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) |= 0x00000018;
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) &= 0xFFFFFFF8;
+	/* Enable offmode for nwe in CONTROL_PADCONF_GPMC_NWE register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00000F00;
+	/* En off mode for noe and ale in CONTROL_PADCONF_GPMC_NADV_ALE reg */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC0)) |= 0x0E000E00;
+	/* Enable gpmc_nbe0_cle in CONTROL_PADCONF_GPMC_NWE register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00180000;
+
+	/* Enable gpmc_nbe1 in CONTROL_PADCONF_GPMC_NBE1 register and
+	configuring the mux mode to 0 */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) |= 0x00000018;
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) &= 0xFFFFFFF8;
+	/* Enable d15 in CONTROL_PADCONF_GPMC_D15 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xAC)) |= 0x00000018;
+	/* Enable d14 - d13 in CONTROL_PADCONF_GPMC_D13 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA8)) |= 0x00180018;
+	/* Enable d12 - d11 in CONTROL_PADCONF_GPMC_D11 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA4)) |= 0x00180018;
+	/* Enable d10 - d9 in CONTROL_PADCONF_GPMC_D9 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA0)) |= 0x00180018;
Quoted 8 lines
Quoted 4 lines

board/omap3/evm/evm.c line 133

Quoted 4 lines
board/omap3/evm/evm.c new file +4 -0
+	/* Enable d8 - d7 in CONTROL_PADCONF_GPMC_D7 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x9C)) |= 0x00180018;
+	/* Enable d6 - d5 in CONTROL_PADCONF_GPMC_D5 register */
+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x98)) |= 0x00180018;

And please use accessor functions / macros to access the registers. Access through volatile pointers is considered a Bad Thing (TM).

Sorry for not mentioning this earlier, but you don't have to comment on

a) readx/writex accessor functions / macros
b) hardcoded values vs. speaking macros

These are known issues of OMAP3 patch set I will fix step by step. Once we send the "final" OMAP3 patch set to the mailing list, if I missed something, then you are welcome to comment on it, though ;)

Thanks for your review and best regards

Dirk