From ef339cc2b68e4cbef3f9376a45315e1b974bbd8d Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Mon, 9 Feb 2009 15:53:31 +0100 Subject: Added nomadik.h header Signed-off-by: Alessandro Rubini Acked-by: Andrea Gallo --- include/configs/nmdk8815.h | 24 ++---------------------- include/nomadik.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 include/nomadik.h (limited to 'include') diff --git a/include/configs/nmdk8815.h b/include/configs/nmdk8815.h index 01de08f..a370f6c 100644 --- a/include/configs/nmdk8815.h +++ b/include/configs/nmdk8815.h @@ -25,6 +25,8 @@ #ifndef __CONFIG_H #define __CONFIG_H +#include + #define CONFIG_ARM926EJS #define CONFIG_NOMADIK #define CONFIG_NOMADIK_8815 @@ -163,26 +165,4 @@ #define CONFIG_SYS_MAX_FLASH_SECT 512 #define CONFIG_SYS_MAX_FLASH_BANKS 1 -/* base addresses of our peripherals */ -#define NOMADIK_SRC_BASE 0x101E0000 /* System and Reset Cnt */ -#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */ -#define NOMADIK_MPMC_BASE 0x10110000 /* SDRAM Controller */ -#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC Controller */ -#define NOMADIK_1NAND_BASE 0x30000000 -#define NOMADIK_GPIO0_BASE 0x101E4000 -#define NOMADIK_GPIO1_BASE 0x101E5000 -#define NOMADIK_GPIO2_BASE 0x101E6000 -#define NOMADIK_GPIO3_BASE 0x101E7000 -#define NOMADIK_CPLD_BASE 0x36000000 -#define NOMADIK_UART0_BASE 0x101FD000 -#define NOMADIK_UART1_BASE 0x101FB000 -#define NOMADIK_UART2_BASE 0x101F2000 - -#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */ -#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */ - -#define NOMADIK_RTC_BASE 0x101E8000 -#define NOMADIK_ETH0_BASE 0x36800300 -#define NOMADIK_CPLD_UART_BASE 0x36480000 - #endif /* __CONFIG_H */ diff --git a/include/nomadik.h b/include/nomadik.h new file mode 100644 index 0000000..d9405fd --- /dev/null +++ b/include/nomadik.h @@ -0,0 +1,39 @@ +/* Collection of constants used to access Nomadik registers */ + +#ifndef __NOMADIK_H__ +#define __NOMADIK_H__ + +/* Base addresses of our peripherals */ +#define NOMADIK_SRC_BASE 0x101E0000 /* System and Reset Cnt */ +#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */ +#define NOMADIK_MPMC_BASE 0x10110000 /* SDRAM Controller */ +#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC Controller */ +#define NOMADIK_1NAND_BASE 0x30000000 +#define NOMADIK_GPIO0_BASE 0x101E4000 +#define NOMADIK_GPIO1_BASE 0x101E5000 +#define NOMADIK_GPIO2_BASE 0x101E6000 +#define NOMADIK_GPIO3_BASE 0x101E7000 +#define NOMADIK_CPLD_BASE 0x36000000 +#define NOMADIK_UART0_BASE 0x101FD000 +#define NOMADIK_UART1_BASE 0x101FB000 +#define NOMADIK_UART2_BASE 0x101F2000 + +#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */ +#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */ + +#define NOMADIK_RTC_BASE 0x101E8000 +#define NOMADIK_ETH0_BASE 0x36800300 +#define NOMADIK_CPLD_UART_BASE 0x36480000 + +/* Chip select registers ("Flexible Static Memory Controller") */ + +#define REG_FSMC_BCR0 (NOMADIK_FSMC_BASE + 0x00) +#define REG_FSMC_BTR0 (NOMADIK_FSMC_BASE + 0x04) +#define REG_FSMC_BCR1 (NOMADIK_FSMC_BASE + 0x08) +#define REG_FSMC_BTR1 (NOMADIK_FSMC_BASE + 0x0c) +#define REG_FSMC_PCR0 (NOMADIK_FSMC_BASE + 0x40) +#define REG_FSMC_PMEM0 (NOMADIK_FSMC_BASE + 0x48) +#define REG_FSMC_PATT0 (NOMADIK_FSMC_BASE + 0x4c) +#define REG_FSMC_ECCR0 (NOMADIK_FSMC_BASE + 0x54) + +#endif /* __NOMADIK_H__ */ -- cgit v1.1 From 0d8c6eab2481046e9446264bfe9402bb98ddf433 Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Mon, 9 Feb 2009 15:53:31 +0100 Subject: Nand driver for Nomadik SoC This driver implements the ECC algorithm described in the CPU data sheet and uses the OOB layout chosen in already-released development systems (shipped with a custom-made u-boot 1.3.1). Signed-off-by: Alessandro Rubini Acked-by: Andrea Gallo --- include/configs/nmdk8815.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/configs/nmdk8815.h b/include/configs/nmdk8815.h index a370f6c..0df989f 100644 --- a/include/configs/nmdk8815.h +++ b/include/configs/nmdk8815.h @@ -39,10 +39,14 @@ #include #define CONFIG_CMD_PING #define CONFIG_CMD_DHCP -/* At this point there is no flash driver, so remove some commands */ -#undef CONFIG_CMD_ENV +/* There is no NOR flash, so undefine these commands */ #undef CONFIG_CMD_FLASH #undef CONFIG_CMD_IMLS +#define CONFIG_SYS_NO_FLASH +/* There is NAND storage */ +#define CONFIG_NAND_NOMADIK +#define CONFIG_CMD_NAND +#define CONFIG_CMD_JFFS2 /* user interface */ #define CONFIG_SYS_LONGHELP @@ -120,9 +124,7 @@ #define CONFIG_MTD_ONENAND_VERIFY_WRITE #define CONFIG_SYS_ONENAND_BASE 0x30000000 #define CONFIG_SYS_MAX_NAND_DEVICE 1 -#define CONFIG_SYS_NAND_BASE 0x40000000 - -#define CONFIG_SYS_NO_FLASH +#define CONFIG_SYS_NAND_BASE 0x40000000 /* SMPS0n */ #ifdef CONFIG_BOOT_ONENAND @@ -152,15 +154,11 @@ # define CONFIG_JFFS2_PART_OFFSET 0x00280000 # define CONFIG_ENV_IS_IN_NAND -# define CONFIG_ENV_SIZE 0x20000 /*128 Kb*/ +# define CONFIG_ENV_SIZE 0x20000 /* 128 Kb - one sector */ # define CONFIG_ENV_OFFSET (0x8000000 - CONFIG_ENV_SIZE) #endif /* CONFIG_BOOT_ONENAND */ -/* Temporarily, until we have no driver, env is not in nand */ -#undef CONFIG_ENV_IS_IN_NAND -#define CONFIG_ENV_IS_NOWHERE - /* this is needed to make hello_world.c and other stuff happy */ #define CONFIG_SYS_MAX_FLASH_SECT 512 #define CONFIG_SYS_MAX_FLASH_BANKS 1 -- cgit v1.1 From d3be1bcae7a8207e0a79ffd035d0e90f80378295 Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Mon, 9 Feb 2009 15:53:33 +0100 Subject: Enable Ethernet for Nomadik 8815 Evaluation Kit This trivially enables Ethernet support in the debug board by setting up the proper chip select. Signed-off-by: Alessandro Rubini Acked-by: Andrea Gallo --- include/configs/nmdk8815.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/configs/nmdk8815.h b/include/configs/nmdk8815.h index 0df989f..b37352e 100644 --- a/include/configs/nmdk8815.h +++ b/include/configs/nmdk8815.h @@ -37,8 +37,11 @@ /* commands */ #include + +#define CONFIG_CMD_NET #define CONFIG_CMD_PING #define CONFIG_CMD_DHCP +#define CONFIG_CMD_NFS /* There is no NOR flash, so undefine these commands */ #undef CONFIG_CMD_FLASH #undef CONFIG_CMD_IMLS -- cgit v1.1 From 4f5728987f4f9f7845688482aa2b7f2127768165 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sun, 22 Feb 2009 15:49:28 +0100 Subject: arm: add uart dcc support Serial driver via the EmbeddedICE macrocell's DCC channel using co-processor 14. It does include a timeout to ensure that the system does not totally freeze when there is nothing connected to read. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- include/devices.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/devices.h b/include/devices.h index 84c4514..3a9881b 100644 --- a/include/devices.h +++ b/include/devices.h @@ -98,6 +98,9 @@ struct list_head* device_get_list(void); device_t* device_get_by_name(char* name); device_t* device_clone(device_t *dev); +#ifdef CONFIG_ARM_DCC_MULTI +int drv_arm_dcc_init(void); +#endif #ifdef CONFIG_LCD int drv_lcd_init (void); #endif -- cgit v1.1 From 2579019b8248e5f166e60e37065766efc8a49dbc Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sun, 22 Feb 2009 17:08:41 +0100 Subject: nmdk8815: fix onenand support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- include/configs/nmdk8815.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/nmdk8815.h b/include/configs/nmdk8815.h index b37352e..543780d 100644 --- a/include/configs/nmdk8815.h +++ b/include/configs/nmdk8815.h @@ -48,7 +48,6 @@ #define CONFIG_SYS_NO_FLASH /* There is NAND storage */ #define CONFIG_NAND_NOMADIK -#define CONFIG_CMD_NAND #define CONFIG_CMD_JFFS2 /* user interface */ @@ -131,7 +130,7 @@ #ifdef CONFIG_BOOT_ONENAND -# undef CONFIG_CMD_NAND /* Temporary: nand and onenand can't coexist */ +# define CONFIG_CMD_ONENAND /* Temporary: nand and onenand can't coexist */ /* Partition Size Start * XloaderTOC + X-Loader 256KB 0x00000000 * Memory init function 256KB 0x00040000 @@ -149,7 +148,7 @@ #else /* ! CONFIG_BOOT_ONENAND */ -# undef CONFIG_CMD_ONENAND /* Temporary: nand and onenand can't coexist */ +# define CONFIG_CMD_NAND /* Temporary: nand and onenand can't coexist */ # define CONFIG_JFFS2_DEV "nand0" # define CONFIG_JFFS2_NAND 1 /* For the jffs2 support*/ -- cgit v1.1 From f956fd0338f4990793a10f767929ba4963665261 Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Thu, 12 Feb 2009 18:55:41 +0100 Subject: OMAP3: Beagle: Add board revision detection With BeagleBoard revision C some HW changes are introduced (e.g. PinMUX) which might need different software handling. For this, GPIO pin 171 (GPIO module 6, offset 11) can be used to check for board revision. If this pin is low, we have a rev C board. Else it must be a revision Ax or Bx board. To handle board differences you can call function beagle_get_revision(). E.g.: if (beagle_get_revision()) { /* do special revision C stuff here */ } Signed-off-by: Dirk Behme --- include/asm-arm/arch-omap3/omap3.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-arm/arch-omap3/omap3.h b/include/asm-arm/arch-omap3/omap3.h index 7473656..0ddbd66 100644 --- a/include/asm-arm/arch-omap3/omap3.h +++ b/include/asm-arm/arch-omap3/omap3.h @@ -97,7 +97,8 @@ typedef struct s32ktimer { typedef struct gpio { unsigned char res1[0x34]; unsigned int oe; /* 0x34 */ - unsigned char res2[0x58]; + unsigned int datain; /* 0x38 */ + unsigned char res2[0x54]; unsigned int cleardataout; /* 0x90 */ unsigned int setdataout; /* 0x94 */ } gpio_t; -- cgit v1.1 From 6530a8bf8a0274b9419141e4c2c5a235cce5380f Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Thu, 12 Feb 2009 18:55:42 +0100 Subject: OMAP3: Add OMAP3 auto detection This patch adds OMAP3 cpu type auto detection based on OMAP3 register and removes hardcoded values. Signed-off-by: Steve Sakoman Signed-off-by: Dirk Behme --- include/asm-arm/arch-omap3/cpu.h | 20 ++++++++++++++++++++ include/asm-arm/arch-omap3/sys_proto.h | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-arm/arch-omap3/cpu.h b/include/asm-arm/arch-omap3/cpu.h index 69c0b36..5b344f8 100644 --- a/include/asm-arm/arch-omap3/cpu.h +++ b/include/asm-arm/arch-omap3/cpu.h @@ -35,11 +35,31 @@ typedef struct ctrl { unsigned short gpmc_nwe; /* 0xC4 */ unsigned char res2[0x22A]; unsigned int status; /* 0x2F0 */ + unsigned int gpstatus; /* 0x2F4 */ + unsigned char res3[0x08]; + unsigned int rpubkey_0; /* 0x300 */ + unsigned int rpubkey_1; /* 0x304 */ + unsigned int rpubkey_2; /* 0x308 */ + unsigned int rpubkey_3; /* 0x30C */ + unsigned int rpubkey_4; /* 0x310 */ + unsigned char res4[0x04]; + unsigned int randkey_0; /* 0x318 */ + unsigned int randkey_1; /* 0x31C */ + unsigned int randkey_2; /* 0x320 */ + unsigned int randkey_3; /* 0x324 */ + unsigned char res5[0x124]; + unsigned int ctrl_omap_stat; /* 0x44C */ } ctrl_t; #else /* __ASSEMBLY__ */ #define CONTROL_STATUS 0x2F0 #endif /* __ASSEMBLY__ */ +/* cpu type */ +#define OMAP3503 0x5c00 +#define OMAP3515 0x1c00 +#define OMAP3525 0x4c00 +#define OMAP3530 0x0c00 + /* device type */ #define DEVICE_MASK (0x7 << 8) #define SYSBOOT_MASK 0x1F diff --git a/include/asm-arm/arch-omap3/sys_proto.h b/include/asm-arm/arch-omap3/sys_proto.h index 4c624e8..ab3e168 100644 --- a/include/asm-arm/arch-omap3/sys_proto.h +++ b/include/asm-arm/arch-omap3/sys_proto.h @@ -25,7 +25,6 @@ typedef struct { u32 board_type_v1; u32 board_type_v2; u32 mtype; - char *cpu_string; char *board_string; char *nand_string; } omap3_sysinfo; -- cgit v1.1 From aba45c85b22f8c57fc2fedba8e948e06c2e2f5b3 Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Fri, 20 Feb 2009 17:51:28 +0100 Subject: OMAP3: Clean up MMC code Clean up OMAP3 MMC code: * Convert register access to struct & readx/writex style * Replace hardcode values by macros * Remove macro defined twice Signed-off-by: Dirk Behme --- include/asm-arm/arch-omap3/mmc_host_def.h | 64 ++++++++++++++++++++----------- include/asm-arm/arch-omap3/omap3.h | 3 ++ 2 files changed, 44 insertions(+), 23 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-omap3/mmc_host_def.h b/include/asm-arm/arch-omap3/mmc_host_def.h index dfb376a..aa751c9 100644 --- a/include/asm-arm/arch-omap3/mmc_host_def.h +++ b/include/asm-arm/arch-omap3/mmc_host_def.h @@ -25,30 +25,50 @@ #ifndef MMC_HOST_DEF_H #define MMC_HOST_DEF_H +/* T2 Register definitions */ +#define T2_BASE 0x48002000 + +typedef struct t2 { + unsigned char res1[0x274]; + unsigned int devconf0; /* 0x274 */ + unsigned char res2[0x2A8]; + unsigned int pbias_lite; /* 0x520 */ +} t2_t; + +#define MMCSDIO1ADPCLKISEL (1 << 24) + +#define PBIASLITEPWRDNZ0 (1 << 1) +#define PBIASSPEEDCTRL0 (1 << 2) +#define PBIASLITEPWRDNZ1 (1 << 9) + /* * 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) -#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) +#define OMAP_HSMMC_BASE 0x4809C000 -/* T2 Register definitions */ -#define CONTROL_DEV_CONF0 (*(unsigned int *) 0x48002274) -#define CONTROL_PBIAS_LITE (*(unsigned int *) 0x48002520) +typedef struct hsmmc { + unsigned char res1[0x10]; + unsigned int sysconfig; /* 0x10 */ + unsigned int sysstatus; /* 0x14 */ + unsigned char res2[0x14]; + unsigned int con; /* 0x2C */ + unsigned char res3[0xD4]; + unsigned int blk; /* 0x104 */ + unsigned int arg; /* 0x108 */ + unsigned int cmd; /* 0x10C */ + unsigned int rsp10; /* 0x110 */ + unsigned int rsp32; /* 0x114 */ + unsigned int rsp54; /* 0x118 */ + unsigned int rsp76; /* 0x11C */ + unsigned int data; /* 0x120 */ + unsigned int pstate; /* 0x124 */ + unsigned int hctl; /* 0x128 */ + unsigned int sysctl; /* 0x12C */ + unsigned int stat; /* 0x130 */ + unsigned int ie; /* 0x134 */ + unsigned char res4[0x8]; + unsigned int capa; /* 0x140 */ +} hsmmc_t; /* * OMAP HS MMC Bit definitions @@ -159,8 +179,6 @@ typedef struct { } mmc_card_data; #define mmc_reg_out(addr, mask, val)\ - (addr) = (((addr)) & (~(mask))) | ((val) & (mask)); -#define mmc_reg_out(addr, mask, val)\ - (addr) = (((addr)) & (~(mask))) | ((val) & (mask)); + writel((readl(addr) & (~(mask))) | ((val) & (mask)), (addr)) #endif /* MMC_HOST_DEF_H */ diff --git a/include/asm-arm/arch-omap3/omap3.h b/include/asm-arm/arch-omap3/omap3.h index 0ddbd66..02e36d7 100644 --- a/include/asm-arm/arch-omap3/omap3.h +++ b/include/asm-arm/arch-omap3/omap3.h @@ -203,6 +203,8 @@ typedef struct gpio { #define VAUX2_DEDICATED 0x79 #define VAUX3_DEV_GRP 0x7A #define VAUX3_DEDICATED 0x7D +#define VMMC1_DEV_GRP 0x82 +#define VMMC1_DEDICATED 0x85 #define VPLL2_DEV_GRP 0x8E #define VPLL2_DEDICATED 0x91 #define VDAC_DEV_GRP 0x96 @@ -215,5 +217,6 @@ typedef struct gpio { #define VAUX3_VSEL_28 0x03 #define VPLL2_VSEL_18 0x05 #define VDAC_VSEL_18 0x03 +#define VMMC1_VSEL_30 0x02 #endif -- cgit v1.1