Skip to contentSkip to conversation

da850: provide davinci_enable_uart0

PATCH New Eric Bénard 2 participants 3 messages Apr 22, 2013 – Apr 29, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 da850: provide davinci_enable_uart0

this is needed to bring UART0 out of reset but this function currently only exists for dm644x/355/365/646x when da850 (at least am1808 also need it).

---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c | 8 ++++++++
 arch/arm/include/asm/arch-davinci/hardware.h    | 2 ++
 2 files changed, 10 insertions(+)
arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c +8 -0
index ff2e2e3..127beb8 100644
@@ -32,6 +32,14 @@
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/pll_defs.h>
 
+void davinci_enable_uart0(void)
+{
+	lpsc_on(DAVINCI_LPSC_UART0);
+
+	/* Bringup UART0 out of reset */
+	REG(UART0_PWREMU_MGMT) = 0x00006001;
+}
+
 #if defined(CONFIG_SYS_DA850_PLL_INIT)
 void da850_waitloop(unsigned long loopcnt)
 {
arch/arm/include/asm/arch-davinci/hardware.h +2 -0
index 6eed6c9..a9017e4 100644
@@ -346,6 +346,8 @@ void davinci_errata_workarounds(void);
 #define PSC_PSC0_MODULE_ID_CNT		16
 #define PSC_PSC1_MODULE_ID_CNT		32
 
+#define UART0_PWREMU_MGMT		(0x01c42030)
+
 struct davinci_psc_regs {
 	dv_reg	revid;
 	dv_reg	rsvd0[71];
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 2/2 davinci: handle CONFIG_SYS_CLE_MASK and CONFIG_SYS_ALE_MASK

these variables are curently defined in several config files but the driver doesn't use them and defaults to hardcoded values in nand_defs.h

It's interesting to be able to change this hardcoded valude when the hardware is not using the default adress signals to drive ALE and CLE and two configuration defines already exist for this purpose so use them.

---
 arch/arm/include/asm/arch-davinci/nand_defs.h | 9 +++++++++
 include/configs/da830evm.h                    | 4 ++--
 include/configs/da850evm.h                    | 4 ++--
 include/configs/enbw_cmc.h                    | 4 ++--
 include/configs/tnetv107x_evm.h               | 4 ++--
 5 files changed, 17 insertions(+), 8 deletions(-)
arch/arm/include/asm/arch-davinci/nand_defs.h +9 -0
index 10f3a39..4a30813 100644
@@ -36,6 +36,15 @@
 #define	MASK_ALE	0x08
 #endif
 
+#ifdef CONFIG_SYS_NAND_MASK_CLE
+#undef MASK_CLE
+#define MASK_CLE CONFIG_SYS_NAND_MASK_CLE
+#endif
+#ifdef CONFIG_SYS_NAND_MASK_ALE
+#undef MASK_ALE
+#define MASK_ALE CONFIG_SYS_NAND_MASK_ALE
+#endif
+
 #define NAND_READ_START		0x00
 #define NAND_READ_END		0x30
 #define NAND_STATUS		0x70
include/configs/da830evm.h +2 -2
index f7ac256..198892b 100644
@@ -109,8 +109,8 @@
 #define CONFIG_SYS_NAND_CS		3
 #define CONFIG_SYS_NAND_BASE		DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
 #define CONFIG_SYS_NAND_PAGE_2K
-#define CONFIG_SYS_CLE_MASK		0x10
-#define CONFIG_SYS_ALE_MASK		0x8
+#define CONFIG_SYS_NAND_MASK_CLE		0x10
+#define CONFIG_SYS_NAND_MASK_ALE		0x8
 #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
 #endif
 
include/configs/da850evm.h +2 -2
index 583568d..c420967 100644
@@ -199,8 +199,8 @@
 #define	CONFIG_SYS_NAND_PAGE_2K
 #define CONFIG_SYS_NAND_CS		3
 #define CONFIG_SYS_NAND_BASE		DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
-#define CONFIG_SYS_CLE_MASK		0x10
-#define CONFIG_SYS_ALE_MASK		0x8
+#define CONFIG_SYS_NAND_MASK_CLE		0x10
+#define CONFIG_SYS_NAND_MASK_ALE		0x8
 #undef CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
 #define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
include/configs/enbw_cmc.h +2 -2
index 2d63b67..97bc972 100644
@@ -118,8 +118,8 @@
 #define CONFIG_SYS_NAND_PAGE_2K
 #define CONFIG_SYS_NAND_CS		3
 #define CONFIG_SYS_NAND_BASE		DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
-#define CONFIG_SYS_CLE_MASK		0x10
-#define CONFIG_SYS_ALE_MASK		0x8
+#define CONFIG_SYS_NAND_MASK_CLE		0x10
+#define CONFIG_SYS_NAND_MASK_ALE		0x8
 #undef CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
 
include/configs/tnetv107x_evm.h +2 -2
index d6371fc..cabc06e 100644
@@ -82,8 +82,8 @@
 #define CONFIG_SYS_NAND_CS		2
 #define CONFIG_SYS_NAND_USE_FLASH_BBT
 #define CONFIG_SYS_NAND_BASE		TNETV107X_ASYNC_EMIF_DATA_CE0_BASE
-#define CONFIG_SYS_CLE_MASK		0x10
-#define CONFIG_SYS_ALE_MASK		0x8
+#define CONFIG_SYS_NAND_MASK_CLE		0x10
+#define CONFIG_SYS_NAND_MASK_ALE		0x8
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_MTD_PARTITIONS
 #define CONFIG_CMD_MTDPARTS
Signature · 1 line
1.7.11.7
#2 lore raw

PATCH 1/2 da850: provide davinci_enable_uart0

In reply to Eric Bénard
Quoted 5 lines · Eric B??nard

this is needed to bring UART0 out of reset but this function currently only exists for dm644x/355/365/646x when da850 (at least am1808 also need it).

Along with 2/2, 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/20130429/8b3a116c/attachment.pgp>