From: David Brownell <david-b@pacbell.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH u-boot git] there are non-DM6446 DaVinci chips
Date: Sun, 12 Apr 2009 15:44:23 -0700 [thread overview]
Message-ID: <200904121544.23683.david-b@pacbell.net> (raw)
From: David Brownell <dbrownell@users.sourceforge.net>
Start updating DaVinci board support to reduce dependencies on
dm644x chips and EVM-like boards ... beginning with "psc.c",
which hosts a bunch of those dependencies:
- Pinmux registers and their contents are SoC-specific, and
are also unrelated to the Power and Sleep Controller.
* Declare more of the pinmux registers;
* Move their bitfield decls to a public header;
* Renaming thse bitfields to be clearly SoC-specific.
- Rename the errata workarounds to be clearly SoC-specific.
- Add a CONFIG_SOC_DM6446; use it to prevent some mux goofs.
- Don't include the I2C support if the I2C driver is not enabled.
Plus two minor bugfixes:
- Correct the PSC_MDSTAT mask ... it's six bits, not five.
(Original DM6446 doces said five, FWIW.)
- Correct the PWREMU_MGT mask ... don't set must-be-zero bits.
The simplest always-correct way to handle pinmux is in board_init()
calls; or possibly in SoC-specific device setup code. Currently
these chips don't have such SoC-specific support.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
board/davinci/common/psc.c | 29 ++++++++++++++++-------------
board/davinci/common/psc.h | 2 +-
board/davinci/dvevm/dvevm.c | 2 +-
board/davinci/schmoogie/schmoogie.c | 2 +-
board/davinci/sffsdr/sffsdr.c | 2 +-
board/davinci/sonata/sonata.c | 2 +-
include/asm-arm/arch-davinci/hardware.h | 23 +++++++++++++++++++++--
include/configs/davinci_dvevm.h | 1 +
include/configs/davinci_schmoogie.h | 1 +
include/configs/davinci_sffsdr.h | 1 +
include/configs/davinci_sonata.h | 1 +
11 files changed, 46 insertions(+), 20 deletions(-)
--- a/board/davinci/common/psc.c
+++ b/board/davinci/common/psc.c
@@ -26,13 +26,6 @@
#include <common.h>
#include <asm/arch/hardware.h>
-#define PINMUX0_EMACEN (1 << 31)
-#define PINMUX0_AECS5 (1 << 11)
-#define PINMUX0_AECS4 (1 << 10)
-
-#define PINMUX1_I2C (1 << 7)
-#define PINMUX1_UART1 (1 << 1)
-#define PINMUX1_UART0 (1 << 0)
/*
* The DM6446 includes two separate power domains: "Always On" and "DSP". The
@@ -57,7 +50,7 @@ void lpsc_on(unsigned int id)
while (REG(PSC_PTSTAT) & 0x01);
- if ((*mdstat & 0x1f) == 0x03)
+ if ((*mdstat & 0x3f) == 0x03)
return; /* Already on and enabled */
*mdctl |= 0x03;
@@ -129,10 +122,12 @@ void davinci_enable_uart0(void)
lpsc_on(DAVINCI_LPSC_UART0);
/* Bringup UART0 out of reset */
- REG(UART0_PWREMU_MGMT) = 0x0000e003;
+ REG(UART0_PWREMU_MGMT) = 0x00006001;
+#ifdef CONFIG_SOC_DM6446
/* Enable UART0 MUX lines */
- REG(PINMUX1) |= PINMUX1_UART0;
+ REG(PINMUX1) |= DM644X_PINMUX1_UART0;
+#endif
}
#ifdef CONFIG_DRIVER_TI_EMAC
@@ -145,20 +140,27 @@ void davinci_enable_emac(void)
/* Enable GIO3.3V cells used for EMAC */
REG(VDD3P3V_PWDN) = 0;
+#ifdef CONFIG_SOC_DM6446
/* Enable EMAC. */
- REG(PINMUX0) |= PINMUX0_EMACEN;
+ REG(PINMUX0) |= DM644X_PINMUX0_EMACEN;
+#endif
}
#endif
+#ifdef CONFIG_DRIVER_DAVINCI_I2C
void davinci_enable_i2c(void)
{
lpsc_on(DAVINCI_LPSC_I2C);
+#ifdef CONFIG_SOC_DM6446
/* Enable I2C pin Mux */
- REG(PINMUX1) |= PINMUX1_I2C;
+ REG(PINMUX1) |= DM644X_PINMUX1_I2C;
+#endif
}
+#endif
-void davinci_errata_workarounds(void)
+#ifdef CONFIG_SOC_DM6446
+void dm6446_errata_workarounds(void)
{
/*
* Workaround for TMS320DM6446 errata 1.3.22:
@@ -180,3 +182,4 @@ void davinci_errata_workarounds(void)
*/
REG(VBPR) = 0x20;
}
+#endif
--- a/board/davinci/common/psc.h
+++ b/board/davinci/common/psc.h
@@ -27,6 +27,6 @@ void dsp_on(void);
void davinci_enable_uart0(void);
void davinci_enable_emac(void);
void davinci_enable_i2c(void);
-void davinci_errata_workarounds(void);
+void dm6446_errata_workarounds(void);
#endif /* __PSC_H */
--- a/board/davinci/dvevm/dvevm.c
+++ b/board/davinci/dvevm/dvevm.c
@@ -44,7 +44,7 @@ int board_init(void)
* with pull-up/pull-down resistors) */
REG(PINMUX0) = 0x00000c1f;
- davinci_errata_workarounds();
+ dm6446_errata_workarounds();
/* Power on required peripherals */
lpsc_on(DAVINCI_LPSC_GPIO);
--- a/board/davinci/schmoogie/schmoogie.c
+++ b/board/davinci/schmoogie/schmoogie.c
@@ -44,7 +44,7 @@ int board_init(void)
* with pull-up/pull-down resistors) */
REG(PINMUX0) = 0x00000c1f;
- davinci_errata_workarounds();
+ dm6446_errata_workarounds();
/* Power on required peripherals */
lpsc_on(DAVINCI_LPSC_GPIO);
--- a/board/davinci/sffsdr/sffsdr.c
+++ b/board/davinci/sffsdr/sffsdr.c
@@ -50,7 +50,7 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
- davinci_errata_workarounds();
+ dm6446_errata_workarounds();
/* Power on required peripherals */
lpsc_on(DAVINCI_LPSC_GPIO);
--- a/board/davinci/sonata/sonata.c
+++ b/board/davinci/sonata/sonata.c
@@ -43,7 +43,7 @@ int board_init(void)
* with pull-up/pull-down resistors) */
REG(PINMUX0) = 0x00000c1f;
- davinci_errata_workarounds();
+ dm6446_errata_workarounds();
/* Power on required peripherals */
lpsc_on(DAVINCI_LPSC_GPIO);
--- a/include/asm-arm/arch-davinci/hardware.h
+++ b/include/asm-arm/arch-davinci/hardware.h
@@ -44,6 +44,10 @@ typedef volatile unsigned int * dv_reg_p
/*
* Base register addresses
+ *
+ * NOTE: some of these DM6446-specific addresses DO NOT WORK
+ * on other DaVinci chips. Double check them before you try
+ * using the addresses ... or PSC module identifiers, etc.
*/
#define DAVINCI_DMA_3PCC_BASE (0x01c00000)
#define DAVINCI_DMA_3PTC0_BASE (0x01c10000)
@@ -160,7 +164,22 @@ typedef volatile unsigned int * dv_reg_p
/* Miscellania... */
#define VBPR (0x20000020)
-#define PINMUX0 (0x01c40000)
-#define PINMUX1 (0x01c40004)
+
+/* NOTE: system control modules are *highly* chip-specific, both
+ * as to register content (e.g. for muxing) and which registers exist.
+ */
+#define PINMUX0 0x01c40000
+#define DM644X_PINMUX0_EMACEN (1 << 31)
+#define DM644X_PINMUX0_AECS5 (1 << 11)
+#define DM644X_PINMUX0_AECS4 (1 << 10)
+
+#define PINMUX1 0x01c40004
+#define DM644X_PINMUX1_I2C (1 << 7)
+#define DM644X_PINMUX1_UART1 (1 << 1)
+#define DM644X_PINMUX1_UART0 (1 << 0)
+
+#define PINMUX2 0x01c40008
+#define PINMUX3 0x01c4000c
+#define PINMUX4 0x01c40010
#endif /* __ASM_ARCH_HARDWARE_H */
--- a/include/configs/davinci_dvevm.h
+++ b/include/configs/davinci_dvevm.h
@@ -59,6 +59,7 @@
#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */
#define CONFIG_SYS_HZ_CLOCK 27000000 /* Timer Input clock freq */
#define CONFIG_SYS_HZ 1000
+#define CONFIG_SOC_DM6446
/*====================================================*/
/* EEPROM definitions for Atmel 24C256BN SEEPROM chip */
/* on Sonata/DV_EVM board. No EEPROM on schmoogie. */
--- a/include/configs/davinci_schmoogie.h
+++ b/include/configs/davinci_schmoogie.h
@@ -34,6 +34,7 @@
#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */
#define CONFIG_SYS_HZ_CLOCK 27000000 /* Timer Input clock freq */
#define CONFIG_SYS_HZ 1000
+#define CONFIG_SOC_DM6446
/*=============*/
/* Memory Info */
/*=============*/
--- a/include/configs/davinci_sffsdr.h
+++ b/include/configs/davinci_sffsdr.h
@@ -35,6 +35,7 @@
#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */
#define CONFIG_SYS_HZ_CLOCK 27000000 /* Timer Input clock freq */
#define CONFIG_SYS_HZ 1000
+#define CONFIG_SOC_DM6446
/* EEPROM definitions for Atmel 24LC64 EEPROM chip */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
--- a/include/configs/davinci_sonata.h
+++ b/include/configs/davinci_sonata.h
@@ -59,6 +59,7 @@
#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */
#define CONFIG_SYS_HZ_CLOCK 27000000 /* Timer Input clock freq */
#define CONFIG_SYS_HZ 1000
+#define CONFIG_SOC_DM6446
/*====================================================*/
/* EEPROM definitions for Atmel 24C256BN SEEPROM chip */
/* on Sonata/DV_EVM board. No EEPROM on schmoogie. */
next reply other threads:[~2009-04-12 22:44 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-12 22:44 David Brownell [this message]
2009-04-17 5:44 ` [U-Boot] [PATCH u-boot git] there are non-DM6446 DaVinci chips Jean-Christophe PLAGNIOL-VILLARD
2009-04-17 6:31 ` David Brownell
2009-04-17 7:28 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-18 21:00 ` David Brownell
2009-04-24 16:24 ` Hugo Villeneuve
2009-04-24 19:33 ` David Brownell
2009-04-24 21:45 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-24 22:40 ` David Brownell
2009-04-25 5:17 ` [U-Boot] U-Boot ARM merge strategy, was: " Dirk Behme
2009-04-25 6:27 ` Ben Warren
2009-04-25 7:03 ` David Brownell
2009-04-25 7:18 ` Ben Warren
2009-04-25 8:05 ` David Brownell
2009-04-25 10:48 ` Wolfgang Denk
2009-04-25 11:40 ` Dirk Behme
2009-04-25 12:55 ` [U-Boot] U-Boot ARM merge strategy David Brownell
2009-04-25 13:53 ` Wolfgang Denk
2009-04-25 18:53 ` David Brownell
2009-04-26 21:38 ` Wolfgang Denk
2009-04-27 13:44 ` [U-Boot] U-Boot ARM merge strategy, was: there are non-DM6446 DaVinci chips Jerry Van Baren
2009-04-27 14:00 ` Wolfgang Denk
2009-04-25 10:30 ` Wolfgang Denk
2009-04-25 7:07 ` [U-Boot] U-Boot ARM merge strategy Dirk Behme
2009-04-25 7:42 ` Ben Warren
2009-04-25 10:46 ` Wolfgang Denk
2009-04-25 11:35 ` Dirk Behme
2009-04-25 13:44 ` Wolfgang Denk
2009-04-27 15:47 ` Detlev Zundel
2009-04-27 19:42 ` Wolfgang Denk
2009-04-28 8:32 ` Detlev Zundel
2009-04-28 9:07 ` Wolfgang Denk
2009-04-25 16:13 ` Ben Warren
2009-04-26 5:15 ` Dirk Behme
2009-04-25 10:41 ` Wolfgang Denk
2009-04-25 17:08 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-25 17:30 ` Wolfgang Denk
2009-04-25 18:02 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-25 18:55 ` David Brownell
2009-04-25 6:57 ` [U-Boot] U-Boot ARM merge strategy, was: there are non-DM6446 DaVinci chips David Brownell
2009-04-25 7:11 ` Dirk Behme
2009-04-24 23:46 ` [U-Boot] [PATCH u-boot git] " Ben Warren
2009-04-25 0:36 ` David Brownell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904121544.23683.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.