All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's
@ 2013-05-29 11:02 Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 01/12] ARM: DRA7xx: Add control id code for DRA7xx Lokesh Vutla
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

This series update support for DRA7xx family Socs and the data for
DRA752 ES1.0 soc.
This is on top of my recent Misc cleanup series:
http://u-boot.10912.n7.nabble.com/PATCH-0-3-ARM-OMAP4-Misc-Cleanup-tt155877.html

Tested on DRA752 ES1.0, OMAP5432 ES2.0,
MAKEALL for all armv7 board has been verified.

Balaji T K (1):
  mmc: omap_hsmmc: add mmc1 pbias, ldo1

Lokesh Vutla (6):
  ARM: DRA7xx: Add control id code for DRA7xx
  ARM: DRA7xx: power Add support for tps659038 PMIC
  ARM: DRA7xx: clocks: Fixing i2c_init for PMIC
  ARM: DRA7xx: Do not enable srcomp for DRA7xx Soc's
  ARM: DRA7xx: Update pinmux data
  ARM: DRA7xx: clocks: Update PLL values

Nishanth Menon (1):
  ARM: OMAP5: DRA7xx: support class 0 optimized voltages

Sricharan R (4):
  ARM: DRA7xx: Change the Debug UART to UART1
  ARM: DRA7xx: Correct the SYS_CLK to 20MHZ
  ARM: DRA7xx: Correct SRAM END address
  ARM: DRA7xx: EMIF: Change settings required for EVM board

 arch/arm/cpu/armv7/omap-common/clocks-common.c |   86 +++++++++---
 arch/arm/cpu/armv7/omap-common/emif-common.c   |   26 +++-
 arch/arm/cpu/armv7/omap-common/hwinit-common.c |    2 -
 arch/arm/cpu/armv7/omap5/hw_data.c             |  156 ++++++++++++++++------
 arch/arm/cpu/armv7/omap5/hwinit.c              |   22 ++-
 arch/arm/cpu/armv7/omap5/prcm-regs.c           |    2 +
 arch/arm/cpu/armv7/omap5/sdram.c               |  170 ++++++++++++++++++++++--
 arch/arm/include/asm/arch-omap4/clocks.h       |    2 +-
 arch/arm/include/asm/arch-omap4/sys_proto.h    |    1 +
 arch/arm/include/asm/arch-omap5/clocks.h       |   64 ++++++++-
 arch/arm/include/asm/arch-omap5/mux_dra7xx.h   |    7 +-
 arch/arm/include/asm/arch-omap5/omap.h         |   14 +-
 arch/arm/include/asm/arch-omap5/sys_proto.h    |    1 +
 arch/arm/include/asm/emif.h                    |   12 +-
 arch/arm/include/asm/omap_common.h             |   26 +++-
 board/ti/dra7xx/mux_data.h                     |   38 ++++--
 drivers/mmc/omap_hsmmc.c                       |   26 ++--
 drivers/power/palmas.c                         |   25 +++-
 include/configs/dra7xx_evm.h                   |   11 ++
 include/configs/omap5_common.h                 |    9 +-
 include/configs/omap5_uevm.h                   |   13 +-
 include/palmas.h                               |    5 +-
 22 files changed, 582 insertions(+), 136 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 01/12] ARM: DRA7xx: Add control id code for DRA7xx
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 02/12] ARM: DRA7xx: power Add support for tps659038 PMIC Lokesh Vutla
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

The registers that are used for device identification
are changed from OMAP5 to DRA7xx.
Using the correct registers for DRA7xx.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/include/asm/arch-omap5/clocks.h |   11 +++++++++++
 arch/arm/include/asm/arch-omap5/omap.h   |    3 ---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h
index 6673a02..ca75f63 100644
--- a/arch/arm/include/asm/arch-omap5/clocks.h
+++ b/arch/arm/include/asm/arch-omap5/clocks.h
@@ -239,4 +239,15 @@
  * into microsec and passing the value.
  */
 #define CONFIG_DEFAULT_OMAP_RESET_TIME_MAX_USEC	31219
+
+/* CONTROL ID CODE */
+#define CONTROL_CORE_ID_CODE	0x4A002204
+#define CONTROL_WKUP_ID_CODE	0x4AE0C204
+
+#ifdef CONFIG_DRA7XX
+#define CONTROL_ID_CODE		CONTROL_WKUP_ID_CODE
+#else
+#define CONTROL_ID_CODE		CONTROL_CORE_ID_CODE
+#endif
+
 #endif /* _CLOCKS_OMAP5_H_ */
diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h
index 6dfedf4..df8222a 100644
--- a/arch/arm/include/asm/arch-omap5/omap.h
+++ b/arch/arm/include/asm/arch-omap5/omap.h
@@ -44,9 +44,6 @@
 #define DRAM_ADDR_SPACE_START	OMAP54XX_DRAM_ADDR_SPACE_START
 #define DRAM_ADDR_SPACE_END	OMAP54XX_DRAM_ADDR_SPACE_END
 
-/* CONTROL_ID_CODE */
-#define CONTROL_ID_CODE		0x4A002204
-
 /* To be verified */
 #define OMAP5430_CONTROL_ID_CODE_ES1_0		0x0B94202F
 #define OMAP5430_CONTROL_ID_CODE_ES2_0          0x1B94202F
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 02/12] ARM: DRA7xx: power Add support for tps659038 PMIC
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 01/12] ARM: DRA7xx: Add control id code for DRA7xx Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 03/12] ARM: DRA7xx: clocks: Fixing i2c_init for PMIC Lokesh Vutla
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

TPS659038 is the power IC used in DRA7XX boards.
Adding support for this and also adding pmic data
for DRA7XX boards.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/cpu/armv7/omap-common/clocks-common.c |   23 ++++++++++++++
 arch/arm/cpu/armv7/omap5/hw_data.c             |   38 +++++++++++++++++++++++-
 arch/arm/include/asm/arch-omap4/sys_proto.h    |    1 +
 arch/arm/include/asm/arch-omap5/clocks.h       |   15 ++++++++++
 arch/arm/include/asm/arch-omap5/sys_proto.h    |    1 +
 arch/arm/include/asm/omap_common.h             |    3 ++
 6 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
index 0daf98c..c51c359 100644
--- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
+++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
@@ -30,6 +30,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <i2c.h>
 #include <asm/omap_common.h>
 #include <asm/gpio.h>
 #include <asm/arch/clocks.h>
@@ -487,6 +488,9 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
 	u32 offset = volt_mv;
 	int ret = 0;
 
+	if (!volt_mv)
+		return;
+
 	pmic->pmic_bus_init();
 	/* See if we can first get the GPIO if needed */
 	if (pmic->gpio_en)
@@ -534,6 +538,15 @@ void scale_vcores(struct vcores_data const *vcores)
 	do_scale_vcore(vcores->mm.addr, vcores->mm.value,
 					  vcores->mm.pmic);
 
+	do_scale_vcore(vcores->gpu.addr, vcores->gpu.value,
+		       vcores->gpu.pmic);
+
+	do_scale_vcore(vcores->eve.addr, vcores->eve.value,
+		       vcores->eve.pmic);
+
+	do_scale_vcore(vcores->iva.addr, vcores->iva.value,
+		       vcores->iva.pmic);
+
 	 if (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3) {
 		/* Configure LDO SRAM "magic" bits */
 		writel(2, (*prcm)->prm_sldo_core_setup);
@@ -723,3 +736,13 @@ void prcm_init(void)
 	if (OMAP_INIT_CONTEXT_SPL != omap_hw_init_context())
 		enable_basic_uboot_clocks();
 }
+
+void gpi2c_init(void)
+{
+	static int gpi2c = 1;
+
+	if (gpi2c) {
+		i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+		gpi2c = 0;
+	}
+}
diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
index 74e473d..e9d34c1 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -26,6 +26,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <palmas.h>
 #include <asm/arch/omap.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/omap_common.h>
@@ -294,6 +295,19 @@ struct pmic_data palmas = {
 	.pmic_write	= omap_vc_bypass_send_value,
 };
 
+struct pmic_data tps659038 = {
+	.base_offset = PALMAS_SMPS_BASE_VOLT_UV,
+	.step = 10000, /* 10 mV represented in uV */
+	/*
+	 * Offset codes 1-6 all give the base voltage in Palmas
+	 * Offset code 0 switches OFF the SMPS
+	 */
+	.start_code = 6,
+	.i2c_slave_addr	= TPS659038_I2C_SLAVE_ADDR,
+	.pmic_bus_init	= gpi2c_init,
+	.pmic_write	= palmas_i2c_write_u8,
+};
+
 struct vcores_data omap5430_volts = {
 	.mpu.value = VDD_MPU,
 	.mpu.addr = SMPS_REG_ADDR_12_MPU,
@@ -322,6 +336,28 @@ struct vcores_data omap5430_volts_es2 = {
 	.mm.pmic = &palmas,
 };
 
+struct vcores_data dra752_volts = {
+	.mpu.value	= VDD_MPU_DRA752,
+	.mpu.addr	= TPS659038_REG_ADDR_SMPS12_MPU,
+	.mpu.pmic	= &tps659038,
+
+	.eve.value	= VDD_EVE_DRA752,
+	.eve.addr	= TPS659038_REG_ADDR_SMPS45_EVE,
+	.eve.pmic	= &tps659038,
+
+	.gpu.value	= VDD_GPU_DRA752,
+	.gpu.addr	= TPS659038_REG_ADDR_SMPS6_GPU,
+	.gpu.pmic	= &tps659038,
+
+	.core.value	= VDD_CORE_DRA752,
+	.core.addr	= TPS659038_REG_ADDR_SMPS7_CORE,
+	.core.pmic	= &tps659038,
+
+	.iva.value	= VDD_IVA_DRA752,
+	.iva.addr	= TPS659038_REG_ADDR_SMPS8_IVA,
+	.iva.pmic	= &tps659038,
+};
+
 /*
  * Enable essential clock domains, modules and
  * do some additional special settings needed
@@ -562,7 +598,7 @@ void hw_data_init(void)
 	case DRA752_ES1_0:
 	*prcm = &dra7xx_prcm;
 	*dplls_data = &dra7xx_dplls;
-	*omap_vcores = &omap5430_volts_es2;
+	*omap_vcores = &dra752_volts;
 	*ctrl = &dra7xx_ctrl;
 	break;
 
diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h
index 37d6c69..438cb96 100644
--- a/arch/arm/include/asm/arch-omap4/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap4/sys_proto.h
@@ -57,6 +57,7 @@ u32 cortex_rev(void);
 void init_omap_revision(void);
 void do_io_settings(void);
 void sri2c_init(void);
+void gpi2c_init(void);
 int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
 u32 warm_reset(void);
 void force_emif_self_refresh(void);
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h
index ca75f63..b43737e 100644
--- a/arch/arm/include/asm/arch-omap5/clocks.h
+++ b/arch/arm/include/asm/arch-omap5/clocks.h
@@ -212,9 +212,24 @@
 #define VDD_MPU_ES2_LOW 880
 #define VDD_MM_ES2_LOW 880
 
+/* TPS659038 Voltage settings in mv for OPP_NOMINAL */
+#define VDD_MPU_DRA752		1090
+#define VDD_EVE_DRA752		1060
+#define VDD_GPU_DRA752		1060
+#define VDD_CORE_DRA752		1030
+#define VDD_IVA_DRA752		1060
+
 /* Standard offset is 0.5v expressed in uv */
 #define PALMAS_SMPS_BASE_VOLT_UV 500000
 
+/* TPS659038 */
+#define TPS659038_I2C_SLAVE_ADDR		0x58
+#define TPS659038_REG_ADDR_SMPS12_MPU		0x23
+#define TPS659038_REG_ADDR_SMPS45_EVE		0x2B
+#define TPS659038_REG_ADDR_SMPS6_GPU		0x2F
+#define TPS659038_REG_ADDR_SMPS7_CORE		0x33
+#define TPS659038_REG_ADDR_SMPS8_IVA		0x37
+
 /* TPS */
 #define TPS62361_I2C_SLAVE_ADDR		0x60
 #define TPS62361_REG_ADDR_SET0		0x0
diff --git a/arch/arm/include/asm/arch-omap5/sys_proto.h b/arch/arm/include/asm/arch-omap5/sys_proto.h
index 32ced5f..36cfc6f 100644
--- a/arch/arm/include/asm/arch-omap5/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap5/sys_proto.h
@@ -61,6 +61,7 @@ u32 cortex_rev(void);
 void init_omap_revision(void);
 void do_io_settings(void);
 void sri2c_init(void);
+void gpi2c_init(void);
 int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
 u32 warm_reset(void);
 void force_emif_self_refresh(void);
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 3f1d31d..6b28f2e 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -510,6 +510,9 @@ struct vcores_data {
 	struct volts mpu;
 	struct volts core;
 	struct volts mm;
+	struct volts gpu;
+	struct volts eve;
+	struct volts iva;
 };
 
 extern struct prcm_regs const **prcm;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 03/12] ARM: DRA7xx: clocks: Fixing i2c_init for PMIC
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 01/12] ARM: DRA7xx: Add control id code for DRA7xx Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 02/12] ARM: DRA7xx: power Add support for tps659038 PMIC Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 04/12] ARM: OMAP5: DRA7xx: support class 0 optimized voltages Lokesh Vutla
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

In DRA7xx Soc's voltage scaling is done using GPI2C.
So i2c_init should happen before scaling. I2C driver
uses __udelay which needs timer to be initialized.
So moving timer_init just before voltage scaling.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/cpu/armv7/omap-common/clocks-common.c |    1 +
 arch/arm/cpu/armv7/omap-common/hwinit-common.c |    2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
index c51c359..1861df4 100644
--- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
+++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
@@ -721,6 +721,7 @@ void prcm_init(void)
 	case OMAP_INIT_CONTEXT_UBOOT_FROM_NOR:
 	case OMAP_INIT_CONTEXT_UBOOT_AFTER_CH:
 		enable_basic_clocks();
+		timer_init();
 		scale_vcores(*omap_vcores);
 		setup_dplls();
 #ifdef CONFIG_SYS_CLOCKS_ENABLE_ALL
diff --git a/arch/arm/cpu/armv7/omap-common/hwinit-common.c b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
index 1645120..5602b0e 100644
--- a/arch/arm/cpu/armv7/omap-common/hwinit-common.c
+++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
@@ -202,8 +202,6 @@ void s_init(void)
 #endif
 	prcm_init();
 #ifdef CONFIG_SPL_BUILD
-	timer_init();
-
 	/* For regular u-boot sdram_init() is called from dram_init() */
 	sdram_init();
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 04/12] ARM: OMAP5: DRA7xx: support class 0 optimized voltages
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (2 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 03/12] ARM: DRA7xx: clocks: Fixing i2c_init for PMIC Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 05/12] ARM: DRA7xx: Do not enable srcomp for DRA7xx Soc's Lokesh Vutla
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

From: Nishanth Menon <nm@ti.com>

DRA752 now uses AVS Class 0 voltages which are voltages in efuse.

This means that we can now use the optimized voltages which are
stored as mV values in efuse and program PMIC accordingly.

This allows us to go with higher OPP as needed in the system without
the need for implementing complex AVS logic.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/cpu/armv7/omap-common/clocks-common.c |   58 +++++++++++++++++++-----
 arch/arm/cpu/armv7/omap5/hw_data.c             |   10 ++++
 arch/arm/include/asm/arch-omap5/clocks.h       |   30 ++++++++++++
 arch/arm/include/asm/omap_common.h             |   11 +++++
 4 files changed, 97 insertions(+), 12 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
index 1861df4..928327a 100644
--- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
+++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
@@ -521,6 +521,38 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
 		gpio_direction_output(pmic->gpio, 1);
 }
 
+static u32 optimize_vcore_voltage(struct volts const *v)
+{
+	u32 val;
+	if (!v->value)
+		return 0;
+	if (!v->efuse.reg)
+		return v->value;
+
+	switch (v->efuse.reg_bits) {
+	case 16:
+		val = readw(v->efuse.reg);
+		break;
+	case 32:
+		val = readl(v->efuse.reg);
+		break;
+	default:
+		printf("Error: efuse 0x%08x bits=%d unknown\n",
+		       v->efuse.reg, v->efuse.reg_bits);
+		return v->value;
+	}
+
+	if (!val) {
+		printf("Error: efuse 0x%08x bits=%d val=0, using %d\n",
+		       v->efuse.reg, v->efuse.reg_bits, v->value);
+		return v->value;
+	}
+
+	debug("%s:efuse 0x%08x bits=%d Vnom=%d, using efuse value %d\n",
+	      __func__, v->efuse.reg, v->efuse.reg_bits, v->value, val);
+	return val;
+}
+
 /*
  * Setup the voltages for vdd_mpu, vdd_core, and vdd_iva
  * We set the maximum voltages allowed here because Smart-Reflex is not
@@ -529,23 +561,25 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
  */
 void scale_vcores(struct vcores_data const *vcores)
 {
-	do_scale_vcore(vcores->core.addr, vcores->core.value,
-					  vcores->core.pmic);
+	u32 val;
+
+	val = optimize_vcore_voltage(&vcores->core);
+	do_scale_vcore(vcores->core.addr, val, vcores->core.pmic);
 
-	do_scale_vcore(vcores->mpu.addr, vcores->mpu.value,
-					  vcores->mpu.pmic);
+	val = optimize_vcore_voltage(&vcores->mpu);
+	do_scale_vcore(vcores->mpu.addr, val, vcores->mpu.pmic);
 
-	do_scale_vcore(vcores->mm.addr, vcores->mm.value,
-					  vcores->mm.pmic);
+	val = optimize_vcore_voltage(&vcores->mm);
+	do_scale_vcore(vcores->mm.addr, val, vcores->mm.pmic);
 
-	do_scale_vcore(vcores->gpu.addr, vcores->gpu.value,
-		       vcores->gpu.pmic);
+	val = optimize_vcore_voltage(&vcores->gpu);
+	do_scale_vcore(vcores->gpu.addr, val, vcores->gpu.pmic);
 
-	do_scale_vcore(vcores->eve.addr, vcores->eve.value,
-		       vcores->eve.pmic);
+	val = optimize_vcore_voltage(&vcores->eve);
+	do_scale_vcore(vcores->eve.addr, val, vcores->eve.pmic);
 
-	do_scale_vcore(vcores->iva.addr, vcores->iva.value,
-		       vcores->iva.pmic);
+	val = optimize_vcore_voltage(&vcores->iva);
+	do_scale_vcore(vcores->iva.addr, val, vcores->iva.pmic);
 
 	 if (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3) {
 		/* Configure LDO SRAM "magic" bits */
diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
index e9d34c1..53aea93 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -338,22 +338,32 @@ struct vcores_data omap5430_volts_es2 = {
 
 struct vcores_data dra752_volts = {
 	.mpu.value	= VDD_MPU_DRA752,
+	.mpu.efuse.reg	= STD_FUSE_OPP_VMIN_MPU_NOM,
+	.mpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
 	.mpu.addr	= TPS659038_REG_ADDR_SMPS12_MPU,
 	.mpu.pmic	= &tps659038,
 
 	.eve.value	= VDD_EVE_DRA752,
+	.eve.efuse.reg	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
+	.eve.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
 	.eve.addr	= TPS659038_REG_ADDR_SMPS45_EVE,
 	.eve.pmic	= &tps659038,
 
 	.gpu.value	= VDD_GPU_DRA752,
+	.gpu.efuse.reg	= STD_FUSE_OPP_VMIN_GPU_NOM,
+	.gpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
 	.gpu.addr	= TPS659038_REG_ADDR_SMPS6_GPU,
 	.gpu.pmic	= &tps659038,
 
 	.core.value	= VDD_CORE_DRA752,
+	.core.efuse.reg	= STD_FUSE_OPP_VMIN_CORE_NOM,
+	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
 	.core.addr	= TPS659038_REG_ADDR_SMPS7_CORE,
 	.core.pmic	= &tps659038,
 
 	.iva.value	= VDD_IVA_DRA752,
+	.iva.efuse.reg	= STD_FUSE_OPP_VMIN_IVA_NOM,
+	.iva.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
 	.iva.addr	= TPS659038_REG_ADDR_SMPS8_IVA,
 	.iva.pmic	= &tps659038,
 };
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h
index b43737e..cfcf51d 100644
--- a/arch/arm/include/asm/arch-omap5/clocks.h
+++ b/arch/arm/include/asm/arch-omap5/clocks.h
@@ -219,6 +219,36 @@
 #define VDD_CORE_DRA752		1030
 #define VDD_IVA_DRA752		1060
 
+/* Efuse register offsets for DRA7xx platform */
+#define DRA752_EFUSE_BASE	0x4A002000
+#define DRA752_EFUSE_REGBITS	16
+/* STD_FUSE_OPP_VMIN_IVA_2 */
+#define STD_FUSE_OPP_VMIN_IVA_NOM	(DRA752_EFUSE_BASE + 0x05CC)
+/* STD_FUSE_OPP_VMIN_IVA_3 */
+#define STD_FUSE_OPP_VMIN_IVA_OD	(DRA752_EFUSE_BASE + 0x05D0)
+/* STD_FUSE_OPP_VMIN_IVA_4 */
+#define STD_FUSE_OPP_VMIN_IVA_HIGH	(DRA752_EFUSE_BASE + 0x05D4)
+/* STD_FUSE_OPP_VMIN_DSPEVE_2 */
+#define STD_FUSE_OPP_VMIN_DSPEVE_NOM	(DRA752_EFUSE_BASE + 0x05E0)
+/* STD_FUSE_OPP_VMIN_DSPEVE_3 */
+#define STD_FUSE_OPP_VMIN_DSPEVE_OD	(DRA752_EFUSE_BASE + 0x05E4)
+/* STD_FUSE_OPP_VMIN_DSPEVE_4 */
+#define STD_FUSE_OPP_VMIN_DSPEVE_HIGH	(DRA752_EFUSE_BASE + 0x05E8)
+/* STD_FUSE_OPP_VMIN_CORE_2 */
+#define STD_FUSE_OPP_VMIN_CORE_NOM	(DRA752_EFUSE_BASE + 0x05F4)
+/* STD_FUSE_OPP_VMIN_GPU_2 */
+#define STD_FUSE_OPP_VMIN_GPU_NOM	(DRA752_EFUSE_BASE + 0x1B08)
+/* STD_FUSE_OPP_VMIN_GPU_3 */
+#define STD_FUSE_OPP_VMIN_GPU_OD	(DRA752_EFUSE_BASE + 0x1B0C)
+/* STD_FUSE_OPP_VMIN_GPU_4 */
+#define STD_FUSE_OPP_VMIN_GPU_HIGH	(DRA752_EFUSE_BASE + 0x1B10)
+/* STD_FUSE_OPP_VMIN_MPU_2 */
+#define STD_FUSE_OPP_VMIN_MPU_NOM	(DRA752_EFUSE_BASE + 0x1B20)
+/* STD_FUSE_OPP_VMIN_MPU_3 */
+#define STD_FUSE_OPP_VMIN_MPU_OD	(DRA752_EFUSE_BASE + 0x1B24)
+/* STD_FUSE_OPP_VMIN_MPU_4 */
+#define STD_FUSE_OPP_VMIN_MPU_HIGH	(DRA752_EFUSE_BASE + 0x1B28)
+
 /* Standard offset is 0.5v expressed in uv */
 #define PALMAS_SMPS_BASE_VOLT_UV 500000
 
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 6b28f2e..1435674 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -500,9 +500,20 @@ struct pmic_data {
 	int (*pmic_write)(u8 sa, u8 reg_addr, u8 reg_data);
 };
 
+/**
+ * struct volts_efuse_data - efuse definition for voltage
+ * @reg:	register address for efuse
+ * @reg_bits:	Number of bits in a register address, mandatory.
+ */
+struct volts_efuse_data {
+	u32 reg;
+	u8 reg_bits;
+};
+
 struct volts {
 	u32 value;
 	u32 addr;
+	struct volts_efuse_data efuse;
 	struct pmic_data *pmic;
 };
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 05/12] ARM: DRA7xx: Do not enable srcomp for DRA7xx Soc's
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (3 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 04/12] ARM: OMAP5: DRA7xx: support class 0 optimized voltages Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 06/12] ARM: DRA7xx: Change the Debug UART to UART1 Lokesh Vutla
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

Slew rate compensation cells are not present for DRA7xx
Soc's. So return from function srcomp_enable() if soc is not
OMAP54xx.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/cpu/armv7/omap5/hwinit.c  |    3 +++
 arch/arm/include/asm/omap_common.h |    8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/arch/arm/cpu/armv7/omap5/hwinit.c b/arch/arm/cpu/armv7/omap5/hwinit.c
index e192fea..784aa11 100644
--- a/arch/arm/cpu/armv7/omap5/hwinit.c
+++ b/arch/arm/cpu/armv7/omap5/hwinit.c
@@ -201,6 +201,9 @@ void srcomp_enable(void)
 	u32 sysclk_ind	= get_sys_clk_index();
 	u32 omap_rev	= omap_revision();
 
+	if (!is_omap54xx())
+		return;
+
 	mul_factor = srcomp_parameters[sysclk_ind].multiply_factor;
 	div_factor = srcomp_parameters[sysclk_ind].divide_factor;
 
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 1435674..7007177 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -575,6 +575,14 @@ static inline u32 omap_revision(void)
 	extern u32 *const omap_si_rev;
 	return *omap_si_rev;
 }
+
+#define OMAP54xx	0x54000000
+
+static inline u8 is_omap54xx(void)
+{
+	extern u32 *const omap_si_rev;
+	return ((*omap_si_rev & 0xFF000000) == OMAP54xx);
+}
 #endif
 
 /*
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 06/12] ARM: DRA7xx: Change the Debug UART to UART1
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (4 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 05/12] ARM: DRA7xx: Do not enable srcomp for DRA7xx Soc's Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 07/12] ARM: DRA7xx: Correct the SYS_CLK to 20MHZ Lokesh Vutla
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

From: Sricharan R <r.sricharan@ti.com>

Serial UART is connected to UART1. So add the change
for the same.

Signed-off-by: Sricharan R <r.sricharan@ti.com>
---
 include/configs/dra7xx_evm.h   |    3 +++
 include/configs/omap5_common.h |    4 ----
 include/configs/omap5_uevm.h   |    4 ++++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 28a306b..b142049 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -35,4 +35,7 @@
 #define CONFIG_DRA7XX		/* in a TI DRA7XX core */
 #define CONFIG_SYS_PROMPT		"DRA752 EVM # "
 
+#define CONFIG_CONS_INDEX		1
+#define CONFIG_SYS_NS16550_COM1		UART1_BASE
+#define CONFIG_BAUDRATE			115200
 #endif /* __CONFIG_DRA7XX_EVM_H */
diff --git a/include/configs/omap5_common.h b/include/configs/omap5_common.h
index deb5e9f..d57c0da 100644
--- a/include/configs/omap5_common.h
+++ b/include/configs/omap5_common.h
@@ -81,10 +81,6 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
 #define CONFIG_SYS_NS16550_CLK		V_NS16550_CLK
-#define CONFIG_CONS_INDEX		3
-#define CONFIG_SYS_NS16550_COM3		UART3_BASE
-
-#define CONFIG_BAUDRATE			115200
 
 /* CPU */
 #define CONFIG_ARCH_CPU_INIT
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index c791789..ba81e30 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -35,6 +35,10 @@
 
 #include <configs/omap5_common.h>
 
+#define CONFIG_CONS_INDEX		3
+#define CONFIG_SYS_NS16550_COM3		UART3_BASE
+#define CONFIG_BAUDRATE			115200
+
 /* TWL6035 */
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_PALMAS_POWER
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 07/12] ARM: DRA7xx: Correct the SYS_CLK to 20MHZ
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (5 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 06/12] ARM: DRA7xx: Change the Debug UART to UART1 Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 13:04   ` Tom Rini
  2013-05-29 11:02 ` [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address Lokesh Vutla
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

From: Sricharan R <r.sricharan@ti.com>

The sys_clk on the dra evm board is 20MHZ.
Changing the configuration for the same.

Signed-off-by: Sricharan R <r.sricharan@ti.com>
---
 include/configs/dra7xx_evm.h   |    4 ++++
 include/configs/omap5_common.h |    1 -
 include/configs/omap5_uevm.h   |    3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index b142049..b0b0bda 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -38,4 +38,8 @@
 #define CONFIG_CONS_INDEX		1
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE
 #define CONFIG_BAUDRATE			115200
+
+/* Clock Defines */
+#define V_OSCK			20000000	/* Clock output from T2 */
+
 #endif /* __CONFIG_DRA7XX_EVM_H */
diff --git a/include/configs/omap5_common.h b/include/configs/omap5_common.h
index d57c0da..9fef21c 100644
--- a/include/configs/omap5_common.h
+++ b/include/configs/omap5_common.h
@@ -46,7 +46,6 @@
 #define CONFIG_DISPLAY_BOARDINFO
 
 /* Clock Defines */
-#define V_OSCK			19200000	/* Clock output from T2 */
 #define V_SCLK	V_OSCK
 
 #define CONFIG_MISC_INIT_R
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index ba81e30..4f2d425 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -58,5 +58,8 @@
 
 #define CONFIG_SYS_PROMPT		"OMAP5430 EVM # "
 
+/* Clock Defines */
+#define V_OSCK			19200000	/* Clock output from T2 */
+
 #define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC	16296
 #endif /* __CONFIG_OMAP5_EVM_H */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (6 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 07/12] ARM: DRA7xx: Correct the SYS_CLK to 20MHZ Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 13:06   ` Tom Rini
  2013-05-29 11:02 ` [U-Boot] [PATCH 09/12] mmc: omap_hsmmc: add mmc1 pbias, ldo1 Lokesh Vutla
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

From: Sricharan R <r.sricharan@ti.com>

NON SECURE SRAM is 512KB in DRA7xx devices.
So fixing it here.

Signed-off-by: Sricharan R <r.sricharan@ti.com>
---
 arch/arm/include/asm/arch-omap5/omap.h |    7 -------
 include/configs/dra7xx_evm.h           |    3 +++
 include/configs/omap5_uevm.h           |    3 +++
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h
index df8222a..15d429f 100644
--- a/arch/arm/include/asm/arch-omap5/omap.h
+++ b/arch/arm/include/asm/arch-omap5/omap.h
@@ -159,13 +159,6 @@ struct s32ktimer {
 #define EFUSE_4 0x45145100
 #endif /* __ASSEMBLY__ */
 
-/*
- * Non-secure SRAM Addresses
- * Non-secure RAM starts at 0x40300000 for GP devices. But we keep SRAM_BASE
- * at 0x40304000(EMU base) so that our code works for both EMU and GP
- */
-#define NON_SECURE_SRAM_START	0x40300000
-#define NON_SECURE_SRAM_END	0x40320000	/* Not inclusive */
 /* base address for indirect vectors (internal boot mode) */
 #define SRAM_ROM_VECT_BASE	0x4031F000
 
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index b0b0bda..fc35f2f 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -42,4 +42,7 @@
 /* Clock Defines */
 #define V_OSCK			20000000	/* Clock output from T2 */
 
+#define NON_SECURE_SRAM_START	0x40300000
+#define NON_SECURE_SRAM_END	0x40380000	/* Not inclusive */
+
 #endif /* __CONFIG_DRA7XX_EVM_H */
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 4f2d425..96c5955 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -61,5 +61,8 @@
 /* Clock Defines */
 #define V_OSCK			19200000	/* Clock output from T2 */
 
+#define NON_SECURE_SRAM_START	0x40300000
+#define NON_SECURE_SRAM_END	0x40320000	/* Not inclusive */
+
 #define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC	16296
 #endif /* __CONFIG_OMAP5_EVM_H */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 09/12] mmc: omap_hsmmc: add mmc1 pbias, ldo1
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (7 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 13:08   ` Tom Rini
  2013-05-29 11:02 ` [U-Boot] [PATCH 10/12] ARM: DRA7xx: Update pinmux data Lokesh Vutla
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

From: Balaji T K <balajitk@ti.com>

add dra mmc pbias support and ldo1 power on

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/include/asm/arch-omap5/omap.h |    3 ++-
 drivers/mmc/omap_hsmmc.c               |   26 ++++++++++++++------------
 drivers/power/palmas.c                 |   25 ++++++++++++++++++++++++-
 include/configs/omap5_common.h         |    4 ++++
 include/configs/omap5_uevm.h           |    5 -----
 include/palmas.h                       |    5 ++++-
 6 files changed, 48 insertions(+), 20 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h
index 15d429f..63378fb 100644
--- a/arch/arm/include/asm/arch-omap5/omap.h
+++ b/arch/arm/include/asm/arch-omap5/omap.h
@@ -96,9 +96,10 @@
 /* CONTROL_EFUSE_2 */
 #define CONTROL_EFUSE_2_NMOS_PMOS_PTV_CODE_1		0x00ffc000
 
+#define SDCARD_BIAS_PWRDNZ				(1 << 27)
 #define SDCARD_PWRDNZ					(1 << 26)
 #define SDCARD_BIAS_HIZ_MODE				(1 << 25)
-#define SDCARD_BIAS_PWRDNZ				(1 << 22)
+#define SDCARD_BIAS_PWRDNZ2				(1 << 22)
 #define SDCARD_PBIASLITE_VMODE				(1 << 21)
 
 #ifndef __ASSEMBLY__
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index afdfa88..60807df 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -113,23 +113,25 @@ static void omap5_pbias_config(struct mmc *mmc)
 	u32 value = 0;
 
 	value = readl((*ctrl)->control_pbias);
-	value &= ~(SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ);
-	value |= SDCARD_BIAS_HIZ_MODE;
+	value &= ~SDCARD_PWRDNZ;
+	writel(value, (*ctrl)->control_pbias);
+	udelay(10); /* wait 10 us */
+	value &= ~SDCARD_BIAS_PWRDNZ;
 	writel(value, (*ctrl)->control_pbias);
 
-	palmas_mmc1_poweron_ldo();
+#if defined(CONFIG_DRA7XX)
+	palmas_mmc1_poweron_ldo1();
+#else
+	palmas_mmc1_poweron_ldo9();
+#endif
 
 	value = readl((*ctrl)->control_pbias);
-	value &= ~SDCARD_BIAS_HIZ_MODE;
-	value |= SDCARD_PBIASLITE_VMODE | SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ;
+	value |= SDCARD_BIAS_PWRDNZ;
 	writel(value, (*ctrl)->control_pbias);
-
-	value = readl((*ctrl)->control_pbias);
-	if (value & (1 << 23)) {
-		value &= ~(SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ);
-		value |= SDCARD_BIAS_HIZ_MODE;
-		writel(value, (*ctrl)->control_pbias);
-	}
+	udelay(150); /* wait 10 us */
+	value |= SDCARD_PWRDNZ;
+	writel(value, (*ctrl)->control_pbias);
+	udelay(150); /* wait 10 us */
 }
 #endif
 
diff --git a/drivers/power/palmas.c b/drivers/power/palmas.c
index 09c832d..84ec881 100644
--- a/drivers/power/palmas.c
+++ b/drivers/power/palmas.c
@@ -28,7 +28,7 @@ void palmas_init_settings(void)
 	return;
 }
 
-int palmas_mmc1_poweron_ldo(void)
+int palmas_mmc1_poweron_ldo9(void)
 {
 	u8 val = 0;
 
@@ -50,3 +50,26 @@ int palmas_mmc1_poweron_ldo(void)
 
 	return 0;
 }
+
+int palmas_mmc1_poweron_ldo1(void)
+{
+	u8 val = 0;
+
+	/* set LDO9 TWL6035 to 3V */
+	val = 0x2b; /* (3 -.9)*20 +1 */
+
+	if (palmas_i2c_write_u8(0x58, LDO1_VOLTAGE, val)) {
+		printf("twl6035: could not set LDO1 voltage\n");
+		return 1;
+	}
+
+	/* TURN ON LDO9 */
+	val = LDO_ON | LDO_MODE_SLEEP | LDO_MODE_ACTIVE;
+
+	if (palmas_i2c_write_u8(0x58, LDO1_CTRL, val)) {
+		printf("twl6035: could not turn on LDO1\n");
+		return 1;
+	}
+
+	return 0;
+}
diff --git a/include/configs/omap5_common.h b/include/configs/omap5_common.h
index 9fef21c..f2c4c70 100644
--- a/include/configs/omap5_common.h
+++ b/include/configs/omap5_common.h
@@ -241,6 +241,10 @@
 #define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
 #endif
 
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_PALMAS_POWER
+#endif
+
 /* Defines for SPL */
 #define CONFIG_SPL
 #define CONFIG_SPL_FRAMEWORK
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 96c5955..69754c6 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -39,11 +39,6 @@
 #define CONFIG_SYS_NS16550_COM3		UART3_BASE
 #define CONFIG_BAUDRATE			115200
 
-/* TWL6035 */
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_PALMAS_POWER
-#endif
-
 /* MMC ENV related defines */
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV		1	/* SLOT2: eMMC(1) */
diff --git a/include/palmas.h b/include/palmas.h
index 3b18589..18a25ff 100644
--- a/include/palmas.h
+++ b/include/palmas.h
@@ -30,6 +30,8 @@
 #define PALMAS_CHIP_ADDR	0x48
 
 /* 0x1XY translates to page 1, register address 0xXY */
+#define LDO1_CTRL		0x50
+#define LDO1_VOLTAGE		0x51
 #define LDO9_CTRL		0x60
 #define LDO9_VOLTAGE		0x61
 
@@ -53,6 +55,7 @@ static inline int palmas_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
 }
 
 void palmas_init_settings(void);
-int palmas_mmc1_poweron_ldo(void);
+int palmas_mmc1_poweron_ldo9(void);
+int palmas_mmc1_poweron_ldo1(void);
 
 #endif /* PALMAS_H */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 10/12] ARM: DRA7xx: Update pinmux data
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (8 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 09/12] mmc: omap_hsmmc: add mmc1 pbias, ldo1 Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 11/12] ARM: DRA7xx: clocks: Update PLL values Lokesh Vutla
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

Updating pinmux data as specified in the latest DM

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
---
 arch/arm/include/asm/arch-omap5/mux_dra7xx.h |    7 +++--
 board/ti/dra7xx/mux_data.h                   |   38 ++++++++++++++++----------
 2 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap5/mux_dra7xx.h b/arch/arm/include/asm/arch-omap5/mux_dra7xx.h
index 55e9de6..5f2b0f9 100644
--- a/arch/arm/include/asm/arch-omap5/mux_dra7xx.h
+++ b/arch/arm/include/asm/arch-omap5/mux_dra7xx.h
@@ -28,11 +28,14 @@
 
 #include <asm/types.h>
 
+#define FSC	(1 << 19)
+#define SSC	(0 << 19)
+
 #define IEN	(1 << 18)
 #define IDIS	(0 << 18)
 
-#define PTU	(3 << 16)
-#define PTD	(1 << 16)
+#define PTU	(1 << 17)
+#define PTD	(0 << 17)
 #define PEN	(1 << 16)
 #define PDIS	(0 << 16)
 
diff --git a/board/ti/dra7xx/mux_data.h b/board/ti/dra7xx/mux_data.h
index 04c95fd..338a241 100644
--- a/board/ti/dra7xx/mux_data.h
+++ b/board/ti/dra7xx/mux_data.h
@@ -29,19 +29,29 @@
 #include <asm/arch/mux_dra7xx.h>
 
 const struct pad_conf_entry core_padconf_array_essential[] = {
-	{MMC1_CLK, (PTU | IEN | M0)},	/* MMC1_CLK */
-	{MMC1_CMD, (PTU | IEN | M0)},   /* MMC1_CMD */
-	{MMC1_DAT0, (PTU | IEN | M0)},  /* MMC1_DAT0 */
-	{MMC1_DAT1, (PTU | IEN | M0)},  /* MMC1_DAT1 */
-	{MMC1_DAT2, (PTU | IEN | M0)},  /* MMC1_DAT2 */
-	{MMC1_DAT3, (PTU | IEN | M0)},  /* MMC1_DAT3 */
-	{MMC1_SDCD, (PTU | IEN | M0)},  /* MMC1_SDCD */
-	{MMC1_SDWP, (PTU | IEN | M0)},  /* MMC1_SDWP */
-	{UART1_RXD, (PTU | IEN | M0)},  /* UART1_RXD */
-	{UART1_TXD, (M0)},              /* UART1_TXD */
-	{UART1_CTSN, (PTU | IEN | M0)}, /* UART1_CTSN */
-	{UART1_RTSN, (M0)},             /* UART1_RTSN */
-	{I2C1_SDA, (PTU | IEN | M0)},   /* I2C1_SDA */
-	{I2C1_SCL, (PTU | IEN | M0)},   /* I2C1_SCL */
+	{MMC1_CLK, (IEN | PTU | PDIS | M0)},	/* MMC1_CLK */
+	{MMC1_CMD, (IEN | PTU | PDIS | M0)},	/* MMC1_CMD */
+	{MMC1_DAT0, (IEN | PTU | PDIS | M0)},	/* MMC1_DAT0 */
+	{MMC1_DAT1, (IEN | PTU | PDIS | M0)},	/* MMC1_DAT1 */
+	{MMC1_DAT2, (IEN | PTU | PDIS | M0)},	/* MMC1_DAT2 */
+	{MMC1_DAT3, (IEN | PTU | PDIS | M0)},	/* MMC1_DAT3 */
+	{MMC1_SDCD, (FSC | IEN | PTU | PDIS | M0)}, /* MMC1_SDCD */
+	{MMC1_SDWP, (FSC | IEN | PTD | PEN | M14)}, /* MMC1_SDWP */
+	{GPMC_A19, (IEN | PTU | PDIS | M1)},	/* mmc2_dat4 */
+	{GPMC_A20, (IEN | PTU | PDIS | M1)},	/* mmc2_dat5 */
+	{GPMC_A21, (IEN | PTU | PDIS | M1)},	/* mmc2_dat6 */
+	{GPMC_A22, (IEN | PTU | PDIS | M1)},	/* mmc2_dat7 */
+	{GPMC_A23, (IEN | PTU | PDIS | M1)},	/* mmc2_clk */
+	{GPMC_A24, (IEN | PTU | PDIS | M1)},	/* mmc2_dat0 */
+	{GPMC_A25, (IEN | PTU | PDIS | M1)},	/* mmc2_dat1 */
+	{GPMC_A26, (IEN | PTU | PDIS | M1)},	/* mmc2_dat2 */
+	{GPMC_A27, (IEN | PTU | PDIS | M1)},	/* mmc2_dat3 */
+	{GPMC_CS1, (IEN | PTU | PDIS | M1)},	/* mmm2_cmd */
+	{UART1_RXD, (FSC | IEN | PTU | PDIS | M0)}, /* UART1_RXD */
+	{UART1_TXD, (FSC | IEN | PTU | PDIS | M0)}, /* UART1_TXD */
+	{UART1_CTSN, (IEN | PTU | PDIS | M3)},	/* UART1_CTSN */
+	{UART1_RTSN, (IEN | PTU | PDIS | M3)},	/* UART1_RTSN */
+	{I2C1_SDA, (IEN | PTU | PDIS | M0)},	/* I2C1_SDA */
+	{I2C1_SCL, (IEN | PTU | PDIS | M0)},	/* I2C1_SCL */
 };
 #endif /* _MUX_DATA_DRA7XX_H_ */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 11/12] ARM: DRA7xx: clocks: Update PLL values
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (9 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 10/12] ARM: DRA7xx: Update pinmux data Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 11:02 ` [U-Boot] [PATCH 12/12] ARM: DRA7xx: EMIF: Change settings required for EVM board Lokesh Vutla
  2013-05-29 13:12 ` [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Tom Rini
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

Update PLL values.
SYS_CLKSEL value for 20MHz is changed to 2. In other platforms
SYS_CLKSEL value 2 represents reserved. But in sys_clk array
ind 1 is used for 13Mhz. Since other platforms are not using
13Mhz, reusing index 1 for 20MHz.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
---
 arch/arm/cpu/armv7/omap-common/clocks-common.c |   16 ++---
 arch/arm/cpu/armv7/omap5/hw_data.c             |   87 +++++++++++++++---------
 arch/arm/cpu/armv7/omap5/prcm-regs.c           |    1 +
 arch/arm/include/asm/arch-omap4/clocks.h       |    2 +-
 arch/arm/include/asm/arch-omap5/clocks.h       |    8 ++-
 arch/arm/include/asm/omap_common.h             |    3 +-
 include/configs/dra7xx_evm.h                   |    1 +
 7 files changed, 72 insertions(+), 46 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
index 928327a..88d9392 100644
--- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
+++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
@@ -50,13 +50,12 @@
 
 const u32 sys_clk_array[8] = {
 	12000000,	       /* 12 MHz */
-	13000000,	       /* 13 MHz */
+	20000000,		/* 20 MHz */
 	16800000,	       /* 16.8 MHz */
 	19200000,	       /* 19.2 MHz */
 	26000000,	       /* 26 MHz */
 	27000000,	       /* 27 MHz */
 	38400000,	       /* 38.4 MHz */
-	20000000,		/* 20 MHz */
 };
 
 static inline u32 __get_sys_clk_index(void)
@@ -75,13 +74,6 @@ static inline u32 __get_sys_clk_index(void)
 		/* SYS_CLKSEL - 1 to match the dpll param array indices */
 		ind = (readl((*prcm)->cm_sys_clksel) &
 			CM_SYS_CLKSEL_SYS_CLKSEL_MASK) - 1;
-		/*
-		 * SYS_CLKSEL value for 20MHz is 0. This is introduced newly
-		 * in DRA7XX socs. SYS_CLKSEL -1 will be greater than
-		 * NUM_SYS_CLK. So considering the last 3 bits as the index
-		 * for the dpll param array.
-		 */
-		ind &= CM_SYS_CLKSEL_SYS_CLKSEL_MASK;
 	}
 	return ind;
 }
@@ -441,6 +433,12 @@ static void setup_non_essential_dplls(void)
 	params = get_abe_dpll_params(*dplls_data);
 #ifdef CONFIG_SYS_OMAP_ABE_SYSCK
 	abe_ref_clk = CM_ABE_PLL_REF_CLKSEL_CLKSEL_SYSCLK;
+
+	if (omap_revision() == DRA752_ES1_0)
+		/* Select the sys clk for dpll_abe */
+		clrsetbits_le32((*prcm)->cm_abe_pll_sys_clksel,
+				CM_CLKSEL_ABE_PLL_SYS_CLKSEL_MASK,
+				CM_ABE_PLL_SYS_CLKSEL_SYSCLK2);
 #else
 	abe_ref_clk = CM_ABE_PLL_REF_CLKSEL_CLKSEL_32KCLK;
 	/*
diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
index 53aea93..8303390 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -100,14 +100,13 @@ static const struct dpll_params mpu_dpll_params_499mhz[NUM_SYS_CLKS] = {
 };
 
 static const struct dpll_params mpu_dpll_params_1ghz[NUM_SYS_CLKS] = {
-	{250, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
-	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
-	{119, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 16.8 MHz */
-	{625, 11, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
-	{500, 12, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
+	{250, 2, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 12 MHz   */
+	{500, 9, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz   */
+	{119, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
+	{625, 11, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
+	{500, 12, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
 	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
-	{625, 23, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 38.4 MHz */
-	{50, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1}		/* 20 MHz   */
+	{625, 23, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 38.4 MHz */
 };
 
 static const struct dpll_params
@@ -133,15 +132,14 @@ static const struct dpll_params
 };
 
 static const struct dpll_params
-		core_dpll_params_2128mhz_ddr532_dra7xx[NUM_SYS_CLKS] = {
-	{266, 2, 2, -1, -1, 4, 62, 5, -1, 5, 7, 6},		/* 12 MHz   */
-	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
-	{443, 6, 2, -1, -1, 4, 62, 5, -1, 5, 7, 6},		/* 16.8 MHz */
-	{277, 4, 2, -1, -1, 4, 62, 5, -1, 5, 7, 6},		/* 19.2 MHz */
-	{368, 8, 2, -1, -1, 4, 62, 5, -1, 5, 7, 6},		/* 26 MHz   */
+		core_dpll_params_2128mhz_dra7xx[NUM_SYS_CLKS] = {
+	{266, 2, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 12 MHz   */
+	{266, 4, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 20 MHz   */
+	{443, 6, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 16.8 MHz */
+	{277, 4, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 19.2 MHz */
+	{368, 8, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 26 MHz   */
 	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
-	{277, 9, 2, -1, -1, 4, 62, 5, -1, 5, 7, 6},		/* 38.4 MHz */
-	{266, 4, 2, -1, -1, 4, 62, 5, -1, 5, 7, 6}		/* 20 MHz   */
+	{277, 9, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 38.4 MHz */
 };
 
 static const struct dpll_params
@@ -187,14 +185,13 @@ static const struct dpll_params per_dpll_params_768mhz_es2[NUM_SYS_CLKS] = {
 };
 
 static const struct dpll_params per_dpll_params_768mhz_dra7xx[NUM_SYS_CLKS] = {
-	{32, 0, 4, -1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 12 MHz   */
-	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
-	{160, 6, 4, -1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 16.8 MHz */
-	{20, 0, 4, -1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 19.2 MHz */
-	{192, 12, 4, -1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 26 MHz   */
+	{32, 0, 4, 1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 12 MHz   */
+	{96, 4, 4, 1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 20 MHz   */
+	{160, 6, 4, 1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 16.8 MHz */
+	{20, 0, 4, 1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 19.2 MHz */
+	{192, 12, 4, 1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 26 MHz   */
 	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
-	{10, 0, 4, -1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 38.4 MHz */
-	{96, 4, 4, -1, 3, 4, 10, 2, -1, -1, -1, -1}		/* 20 MHz   */
+	{10, 0, 4, 1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 38.4 MHz */
 };
 
 static const struct dpll_params iva_dpll_params_2330mhz[NUM_SYS_CLKS] = {
@@ -207,6 +204,16 @@ static const struct dpll_params iva_dpll_params_2330mhz[NUM_SYS_CLKS] = {
 	{91, 2, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1}		/* 38.4 MHz */
 };
 
+static const struct dpll_params iva_dpll_params_2330mhz_dra7xx[NUM_SYS_CLKS] = {
+	{1165, 11, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
+	{233, 3, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz */
+	{208, 2, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
+	{182, 2, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
+	{224, 4, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
+	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
+	{91, 2, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 38.4 MHz */
+};
+
 /* ABE M & N values with sys_clk as source */
 static const struct dpll_params
 		abe_dpll_params_sysclk_196608khz[NUM_SYS_CLKS] = {
@@ -224,26 +231,36 @@ static const struct dpll_params abe_dpll_params_32k_196608khz = {
 	750, 0, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1
 };
 
+/* ABE M & N values with sysclk2(22.5792 MHz) as input */
+static const struct dpll_params
+		abe_dpll_params_sysclk2_361267khz[NUM_SYS_CLKS] = {
+	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
+	{16, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz   */
+	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 16.8 MHz */
+	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
+	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
+	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
+	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 38.4 MHz */
+};
+
 static const struct dpll_params usb_dpll_params_1920mhz[NUM_SYS_CLKS] = {
 	{400, 4, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
-	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
+	{480, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 20 MHz   */
 	{400, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 16.8 MHz */
 	{400, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
 	{480, 12, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
 	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
 	{400, 15, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 38.4 MHz */
-	{48, 0, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1}		/* 20 MHz   */
 };
 
-static const struct dpll_params ddr_dpll_params_1066mhz[NUM_SYS_CLKS] = {
-	{533, 11, 1, 1, 4, -1, -1, -1, -1, -1, -1, -1},		/* 12 MHz   */
-	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
-	{222, 6, 1, 1, 4, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
-	{111, 3, 1, 1, 4, -1, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
-	{41, 1, 1, 1, 4, -1, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
+static const struct dpll_params ddr_dpll_params_2128mhz[NUM_SYS_CLKS] = {
+	{266, 2, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 12 MHz   */
+	{266, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz   */
+	{190, 2, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
+	{665, 11, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
+	{532, 12, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
 	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
-	{347, 24, 1, 1, 4, -1, -1, -1, -1, -1, -1, -1},		/* 38.4 MHz */
-	{533, 19, 1, 1, 4, -1, -1, -1, -1, -1, -1, -1}		/* 20 MHz   */
+	{665, 23, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 38.4 MHz */
 };
 
 struct dplls omap5_dplls_es1 = {
@@ -276,10 +293,12 @@ struct dplls omap5_dplls_es2 = {
 
 struct dplls dra7xx_dplls = {
 	.mpu = mpu_dpll_params_1ghz,
-	.core = core_dpll_params_2128mhz_ddr532_dra7xx,
+	.core = core_dpll_params_2128mhz_dra7xx,
 	.per = per_dpll_params_768mhz_dra7xx,
+	.abe = abe_dpll_params_sysclk2_361267khz,
+	.iva = iva_dpll_params_2330mhz_dra7xx,
 	.usb = usb_dpll_params_1920mhz,
-	.ddr = ddr_dpll_params_1066mhz,
+	.ddr = ddr_dpll_params_2128mhz,
 };
 
 struct pmic_data palmas = {
diff --git a/arch/arm/cpu/armv7/omap5/prcm-regs.c b/arch/arm/cpu/armv7/omap5/prcm-regs.c
index db779f2..fdf204f 100644
--- a/arch/arm/cpu/armv7/omap5/prcm-regs.c
+++ b/arch/arm/cpu/armv7/omap5/prcm-regs.c
@@ -943,6 +943,7 @@ struct prcm_regs const dra7xx_prcm = {
 	/* l4 wkup regs */
 	.cm_abe_pll_ref_clksel			= 0x4ae0610c,
 	.cm_sys_clksel				= 0x4ae06110,
+	.cm_abe_pll_sys_clksel			= 0x4ae06118,
 	.cm_wkup_clkstctrl			= 0x4ae07800,
 	.cm_wkup_l4wkup_clkctrl			= 0x4ae07820,
 	.cm_wkup_wdtimer1_clkctrl		= 0x4ae07828,
diff --git a/arch/arm/include/asm/arch-omap4/clocks.h b/arch/arm/include/asm/arch-omap4/clocks.h
index f544edf..e94fae6 100644
--- a/arch/arm/include/asm/arch-omap4/clocks.h
+++ b/arch/arm/include/asm/arch-omap4/clocks.h
@@ -76,7 +76,7 @@
 #define CM_CLKSEL_DCC_EN_MASK			(1 << 22)
 
 /* CM_SYS_CLKSEL */
-#define CM_SYS_CLKSEL_SYS_CLKSEL_MASK	7
+#define CM_SYS_CLKSEL_SYS_CLKSEL_MASK  7
 
 /* CM_CLKSEL_CORE */
 #define CLKSEL_CORE_SHIFT	0
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h
index cfcf51d..41c4f66 100644
--- a/arch/arm/include/asm/arch-omap5/clocks.h
+++ b/arch/arm/include/asm/arch-omap5/clocks.h
@@ -81,7 +81,7 @@
 #define CM_CLKSEL_DCC_EN_MASK			(1 << 22)
 
 /* CM_SYS_CLKSEL */
-#define CM_SYS_CLKSEL_SYS_CLKSEL_MASK	7
+#define CM_SYS_CLKSEL_SYS_CLKSEL_MASK  7
 
 /* CM_CLKSEL_CORE */
 #define CLKSEL_CORE_SHIFT	0
@@ -98,6 +98,12 @@
 #define CM_ABE_PLL_REF_CLKSEL_CLKSEL_SYSCLK	0
 #define CM_ABE_PLL_REF_CLKSEL_CLKSEL_32KCLK	1
 
+/* CM_CLKSEL_ABE_PLL_SYS */
+#define CM_CLKSEL_ABE_PLL_SYS_CLKSEL_SHIFT	0
+#define CM_CLKSEL_ABE_PLL_SYS_CLKSEL_MASK	1
+#define CM_ABE_PLL_SYS_CLKSEL_SYSCLK1		0
+#define CM_ABE_PLL_SYS_CLKSEL_SYSCLK2		1
+
 /* CM_BYPCLK_DPLL_IVA */
 #define CM_BYPCLK_DPLL_IVA_CLKSEL_SHIFT		0
 #define CM_BYPCLK_DPLL_IVA_CLKSEL_MASK		3
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 7007177..86ddd65 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -29,7 +29,7 @@
 
 #include <common.h>
 
-#define NUM_SYS_CLKS	8
+#define NUM_SYS_CLKS	7
 
 struct prcm_regs {
 	/* cm1.ckgen */
@@ -301,6 +301,7 @@ struct prcm_regs {
 	/* l4 wkup regs */
 	u32 cm_abe_pll_ref_clksel;
 	u32 cm_sys_clksel;
+	u32 cm_abe_pll_sys_clksel;
 	u32 cm_wkup_clkstctrl;
 	u32 cm_wkup_l4wkup_clkctrl;
 	u32 cm_wkup_wdtimer1_clkctrl;
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index fc35f2f..6b37e1d 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -45,4 +45,5 @@
 #define NON_SECURE_SRAM_START	0x40300000
 #define NON_SECURE_SRAM_END	0x40380000	/* Not inclusive */
 
+#define CONFIG_SYS_OMAP_ABE_SYSCK
 #endif /* __CONFIG_DRA7XX_EVM_H */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 12/12] ARM: DRA7xx: EMIF: Change settings required for EVM board
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (10 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 11/12] ARM: DRA7xx: clocks: Update PLL values Lokesh Vutla
@ 2013-05-29 11:02 ` Lokesh Vutla
  2013-05-29 13:12 ` [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Tom Rini
  12 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-29 11:02 UTC (permalink / raw)
  To: u-boot

From: Sricharan R <r.sricharan@ti.com>

DRA7 EVM board has the below configuration. Adding the
settings for the same here.

   2Gb_1_35V_DDR3L part * 2 on EMIF1
   2Gb_1_35V_DDR3L part * 4 on EMIF2

Signed-off-by: Sricharan R <r.sricharan@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/cpu/armv7/omap-common/emif-common.c |   26 +++-
 arch/arm/cpu/armv7/omap5/hw_data.c           |   21 +++-
 arch/arm/cpu/armv7/omap5/hwinit.c            |   19 +--
 arch/arm/cpu/armv7/omap5/prcm-regs.c         |    1 +
 arch/arm/cpu/armv7/omap5/sdram.c             |  170 ++++++++++++++++++++++++--
 arch/arm/include/asm/arch-omap5/omap.h       |    1 +
 arch/arm/include/asm/emif.h                  |   12 +-
 arch/arm/include/asm/omap_common.h           |    1 +
 8 files changed, 220 insertions(+), 31 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/emif-common.c b/arch/arm/cpu/armv7/omap-common/emif-common.c
index 11e830a..f925e82 100644
--- a/arch/arm/cpu/armv7/omap-common/emif-common.c
+++ b/arch/arm/cpu/armv7/omap-common/emif-common.c
@@ -209,7 +209,8 @@ void emif_update_timings(u32 base, const struct emif_regs *regs)
 	writel(regs->temp_alert_config, &emif->emif_temp_alert_config);
 	writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1_shdw);
 
-	if (omap_revision() >= OMAP5430_ES1_0) {
+	if ((omap_revision() >= OMAP5430_ES1_0) ||
+				(omap_revision() == DRA752_ES1_0)) {
 		writel(EMIF_L3_CONFIG_VAL_SYS_10_MPU_5_LL_0,
 			&emif->emif_l3_config);
 	} else if (omap_revision() >= OMAP4460_ES1_0) {
@@ -263,6 +264,18 @@ static void ddr3_leveling(u32 base, const struct emif_regs *regs)
 	__udelay(130);
 }
 
+static void ddr3_sw_leveling(u32 base, const struct emif_regs *regs)
+{
+	struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
+
+	writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1);
+	writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1_shdw);
+	config_data_eye_leveling_samples(base);
+
+	writel(regs->emif_rd_wr_lvl_ctl, &emif->emif_rd_wr_lvl_ctl);
+	writel(regs->sdram_config, &emif->emif_sdram_config);
+}
+
 static void ddr3_init(u32 base, const struct emif_regs *regs)
 {
 	struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
@@ -273,6 +286,7 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
 	 * defined, contents of mode Registers must be fully initialized.
 	 * H/W takes care of this initialization
 	 */
+	writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config);
 	writel(regs->sdram_config_init, &emif->emif_sdram_config);
 
 	writel(regs->emif_ddr_phy_ctlr_1_init, &emif->emif_ddr_phy_ctrl_1);
@@ -290,7 +304,10 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
 	/* enable leveling */
 	writel(regs->emif_rd_wr_lvl_rmp_ctl, &emif->emif_rd_wr_lvl_rmp_ctl);
 
-	ddr3_leveling(base, regs);
+	if (omap_revision() == DRA752_ES1_0)
+		ddr3_sw_leveling(base, regs);
+	else
+		ddr3_leveling(base, regs);
 }
 
 #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
@@ -1078,7 +1095,10 @@ static void do_sdram_init(u32 base)
 	if (warm_reset() && (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3)) {
 		set_lpmode_selfrefresh(base);
 		emif_reset_phy(base);
-		ddr3_leveling(base, regs);
+		if (omap_revision() == DRA752_ES1_0)
+			ddr3_sw_leveling(base, regs);
+		else
+			ddr3_leveling(base, regs);
 	}
 
 	/* Write to the shadow registers */
diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
index 8303390..9374c6a 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -602,6 +602,17 @@ const struct ctrl_ioregs ioregs_omap5432_es2 = {
 	.ctrl_emif_sdram_config_ext = SDRAM_CONFIG_EXT_RD_LVL_11_SAMPLES,
 };
 
+const struct ctrl_ioregs ioregs_dra7xx_es1 = {
+	.ctrl_ddrch = 0x40404040,
+	.ctrl_lpddr2ch = 0x40404040,
+	.ctrl_ddr3ch = 0x80808080,
+	.ctrl_ddrio_0 = 0xbae8c631,
+	.ctrl_ddrio_1 = 0xb46318d8,
+	.ctrl_ddrio_2 = 0x84210000,
+	.ctrl_emif_sdram_config_ext = 0xb2c00000,
+	.ctrl_ddr_ctrl_ext_0 = 0xA2000000,
+};
+
 void hw_data_init(void)
 {
 	u32 omap_rev = omap_revision();
@@ -644,14 +655,16 @@ void get_ioregs(const struct ctrl_ioregs **regs)
 	case OMAP5430_ES1_0:
 	case OMAP5430_ES2_0:
 		*regs = &ioregs_omap5430;
-	break;
+		break;
 	case OMAP5432_ES1_0:
 		*regs = &ioregs_omap5432_es1;
-	break;
+		break;
 	case OMAP5432_ES2_0:
-	case DRA752_ES1_0:
 		*regs = &ioregs_omap5432_es2;
-	break;
+		break;
+	case DRA752_ES1_0:
+		*regs = &ioregs_dra7xx_es1;
+		break;
 
 	default:
 		printf("\n INVALID OMAP REVISION ");
diff --git a/arch/arm/cpu/armv7/omap5/hwinit.c b/arch/arm/cpu/armv7/omap5/hwinit.c
index 784aa11..50a938c 100644
--- a/arch/arm/cpu/armv7/omap5/hwinit.c
+++ b/arch/arm/cpu/armv7/omap5/hwinit.c
@@ -100,16 +100,21 @@ static void io_settings_ddr3(void)
 	writel(ioregs->ctrl_emif_sdram_config_ext,
 	       (*ctrl)->control_emif2_sdram_config_ext);
 
-	/* Disable DLL select */
-	io_settings = (readl((*ctrl)->control_port_emif1_sdram_config)
+	if (is_omap54xx()) {
+		/* Disable DLL select */
+		io_settings = (readl((*ctrl)->control_port_emif1_sdram_config)
 							& 0xFFEFFFFF);
-	writel(io_settings,
-		(*ctrl)->control_port_emif1_sdram_config);
+		writel(io_settings,
+			(*ctrl)->control_port_emif1_sdram_config);
 
-	io_settings = (readl((*ctrl)->control_port_emif2_sdram_config)
+		io_settings = (readl((*ctrl)->control_port_emif2_sdram_config)
 							& 0xFFEFFFFF);
-	writel(io_settings,
-		(*ctrl)->control_port_emif2_sdram_config);
+		writel(io_settings,
+			(*ctrl)->control_port_emif2_sdram_config);
+	} else {
+		writel(ioregs->ctrl_ddr_ctrl_ext_0,
+				(*ctrl)->control_ddr_control_ext_0);
+	}
 }
 
 /*
diff --git a/arch/arm/cpu/armv7/omap5/prcm-regs.c b/arch/arm/cpu/armv7/omap5/prcm-regs.c
index fdf204f..331117c 100644
--- a/arch/arm/cpu/armv7/omap5/prcm-regs.c
+++ b/arch/arm/cpu/armv7/omap5/prcm-regs.c
@@ -436,6 +436,7 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
 	.control_srcomp_east_side		= 0x4A002E7C,
 	.control_srcomp_west_side		= 0x4A002E80,
 	.control_srcomp_code_latch		= 0x4A002E84,
+	.control_ddr_control_ext_0		= 0x4A002E88,
 	.control_padconf_core_base		= 0x4A003400,
 	.control_port_emif1_sdram_config	= 0x4AE0C110,
 	.control_port_emif1_lpddr2_nvm_config	= 0x4AE0C114,
diff --git a/arch/arm/cpu/armv7/omap5/sdram.c b/arch/arm/cpu/armv7/omap5/sdram.c
index 6b461e4..1b445a6 100644
--- a/arch/arm/cpu/armv7/omap5/sdram.c
+++ b/arch/arm/cpu/armv7/omap5/sdram.c
@@ -108,6 +108,7 @@ const struct emif_regs emif_regs_266_mhz_2cs = {
 const struct emif_regs emif_regs_ddr3_532_mhz_1cs = {
 	.sdram_config_init		= 0x61851B32,
 	.sdram_config			= 0x61851B32,
+	.sdram_config2			= 0x0,
 	.ref_ctrl			= 0x00001035,
 	.sdram_tim1			= 0xCCCF36B3,
 	.sdram_tim2			= 0x308F7FDA,
@@ -131,6 +132,7 @@ const struct emif_regs emif_regs_ddr3_532_mhz_1cs = {
 const struct emif_regs emif_regs_ddr3_532_mhz_1cs_es2 = {
 	.sdram_config_init              = 0x61851B32,
 	.sdram_config                   = 0x61851B32,
+	.sdram_config2			= 0x0,
 	.ref_ctrl                       = 0x00001035,
 	.sdram_tim1                     = 0xCCCF36B3,
 	.sdram_tim2                     = 0x308F7FDA,
@@ -151,6 +153,54 @@ const struct emif_regs emif_regs_ddr3_532_mhz_1cs_es2 = {
 	.emif_rd_wr_exec_thresh         = 0x40000305
 };
 
+const struct emif_regs emif_1_regs_ddr3_532_mhz_1cs_dra_es1 = {
+	.sdram_config_init              = 0x61851ab2,
+	.sdram_config                   = 0x61851ab2,
+	.sdram_config2			= 0x08000000,
+	.ref_ctrl                       = 0x00001035,
+	.sdram_tim1                     = 0xCCCF36B3,
+	.sdram_tim2                     = 0x308F7FDA,
+	.sdram_tim3                     = 0x027F88A8,
+	.read_idle_ctrl                 = 0x00050000,
+	.zq_config                      = 0x0007190B,
+	.temp_alert_config              = 0x00000000,
+	.emif_ddr_phy_ctlr_1_init       = 0x0E20400A,
+	.emif_ddr_phy_ctlr_1            = 0x0E24400A,
+	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
+	.emif_ddr_ext_phy_ctrl_2        = 0x009E009E,
+	.emif_ddr_ext_phy_ctrl_3        = 0x009E009E,
+	.emif_ddr_ext_phy_ctrl_4        = 0x009E009E,
+	.emif_ddr_ext_phy_ctrl_5        = 0x009E009E,
+	.emif_rd_wr_lvl_rmp_win         = 0x00000000,
+	.emif_rd_wr_lvl_rmp_ctl         = 0x80000000,
+	.emif_rd_wr_lvl_ctl             = 0x00000000,
+	.emif_rd_wr_exec_thresh         = 0x00000305
+};
+
+const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = {
+	.sdram_config_init              = 0x61851B32,
+	.sdram_config                   = 0x61851B32,
+	.sdram_config2			= 0x08000000,
+	.ref_ctrl                       = 0x00001035,
+	.sdram_tim1                     = 0xCCCF36B3,
+	.sdram_tim2                     = 0x308F7FDA,
+	.sdram_tim3                     = 0x027F88A8,
+	.read_idle_ctrl                 = 0x00050000,
+	.zq_config                      = 0x0007190B,
+	.temp_alert_config              = 0x00000000,
+	.emif_ddr_phy_ctlr_1_init       = 0x0020400A,
+	.emif_ddr_phy_ctlr_1            = 0x0E24400A,
+	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
+	.emif_ddr_ext_phy_ctrl_2        = 0x009D009D,
+	.emif_ddr_ext_phy_ctrl_3        = 0x009D009D,
+	.emif_ddr_ext_phy_ctrl_4        = 0x009D009D,
+	.emif_ddr_ext_phy_ctrl_5        = 0x009D009D,
+	.emif_rd_wr_lvl_rmp_win         = 0x00000000,
+	.emif_rd_wr_lvl_rmp_ctl         = 0x80000000,
+	.emif_rd_wr_lvl_ctl             = 0x00000000,
+	.emif_rd_wr_exec_thresh         = 0x00000305
+};
+
 const struct dmm_lisa_map_regs lisa_map_4G_x_2_x_2 = {
 	.dmm_lisa_map_0 = 0x0,
 	.dmm_lisa_map_1 = 0x0,
@@ -159,11 +209,39 @@ const struct dmm_lisa_map_regs lisa_map_4G_x_2_x_2 = {
 	.is_ma_present	= 0x1
 };
 
-const struct dmm_lisa_map_regs lisa_map_512M_x_1 = {
+/*
+ * DRA752 EVM board has 1.5 GB of memory
+ * EMIF1 --> 2Gb * 2 =  512MB
+ * EMIF2 --> 2Gb * 4 =  1GB
+ * so mapping 1GB interleaved and 512MB non-interleaved
+ */
+const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2_2G_x_1_x_2 = {
+	.dmm_lisa_map_0 = 0x0,
+	.dmm_lisa_map_1 = 0x80640300,
+	.dmm_lisa_map_2 = 0xC0500220,
+	.dmm_lisa_map_3 = 0xFF020100,
+	.is_ma_present	= 0x1
+};
+
+/*
+ * DRA752 EVM EMIF1 ONLY CONFIGURATION
+ */
+const struct dmm_lisa_map_regs lisa_map_2G_x_1_x_2 = {
 	.dmm_lisa_map_0 = 0x0,
 	.dmm_lisa_map_1 = 0x0,
-	.dmm_lisa_map_2 = 0x0,
-	.dmm_lisa_map_3 = 0x80500100,
+	.dmm_lisa_map_2 = 0x80500100,
+	.dmm_lisa_map_3 = 0xFF020100,
+	.is_ma_present	= 0x1
+};
+
+/*
+ * DRA752 EVM EMIF2 ONLY CONFIGURATION
+ */
+const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2 = {
+	.dmm_lisa_map_0 = 0x0,
+	.dmm_lisa_map_1 = 0x0,
+	.dmm_lisa_map_2 = 0x80600200,
+	.dmm_lisa_map_3 = 0xFF020100,
 	.is_ma_present	= 0x1
 };
 
@@ -180,9 +258,20 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs)
 		*regs = &emif_regs_532_mhz_2cs_es2;
 		break;
 	case OMAP5432_ES2_0:
+		*regs = &emif_regs_ddr3_532_mhz_1cs_es2;
+		break;
 	case DRA752_ES1_0:
+		switch (emif_nr) {
+		case 1:
+			*regs = &emif_1_regs_ddr3_532_mhz_1cs_dra_es1;
+			break;
+		case 2:
+			*regs = &emif_2_regs_ddr3_532_mhz_1cs_dra_es1;
+			break;
+		}
+		break;
 	default:
-		*regs = &emif_regs_ddr3_532_mhz_1cs_es2;
+		*regs = &emif_1_regs_ddr3_532_mhz_1cs_dra_es1;
 	}
 }
 
@@ -201,7 +290,7 @@ static void emif_get_dmm_regs_sdp(const struct dmm_lisa_map_regs
 		break;
 	case DRA752_ES1_0:
 	default:
-		*dmm_lisa_regs = &lisa_map_512M_x_1;
+		*dmm_lisa_regs = &lisa_map_2G_x_2_x_2_2G_x_1_x_2;
 	}
 
 }
@@ -252,7 +341,8 @@ const u32 ext_phy_ctrl_const_base[EMIF_EXT_PHY_CTRL_CONST_REG] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000077
+	0x00000077,
+	0x0
 };
 
 const u32 ddr3_ext_phy_ctrl_const_base_es1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
@@ -274,7 +364,8 @@ const u32 ddr3_ext_phy_ctrl_const_base_es1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000057
+	0x00000057,
+	0x0
 };
 
 const u32 ddr3_ext_phy_ctrl_const_base_es2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
@@ -296,7 +387,56 @@ const u32 ddr3_ext_phy_ctrl_const_base_es2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000057
+	0x00000057,
+	0x0
+};
+
+const u32
+dra_ddr3_ext_phy_ctrl_const_base_es1_emif1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
+	0x009E009E,
+	0x002E002E,
+	0x002E002E,
+	0x002E002E,
+	0x002E002E,
+	0x002E002E,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x004D004D,
+	0x0,
+	0x600020,
+	0x40010080,
+	0x8102040
+};
+
+const u32
+dra_ddr3_ext_phy_ctrl_const_base_es1_emif2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
+	0x009D009D,
+	0x002D002D,
+	0x002D002D,
+	0x002D002D,
+	0x002D002D,
+	0x002D002D,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x00570057,
+	0x0,
+	0x600020,
+	0x40010080,
+	0x8102040
 };
 
 const struct lpddr2_mr_regs mr_regs = {
@@ -307,7 +447,7 @@ const struct lpddr2_mr_regs mr_regs = {
 	.mr16	= MR16_REF_FULL_ARRAY
 };
 
-static void emif_get_ext_phy_ctrl_const_regs(const u32 **regs)
+static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr, const u32 **regs)
 {
 	switch (omap_revision()) {
 	case OMAP5430_ES1_0:
@@ -318,7 +458,14 @@ static void emif_get_ext_phy_ctrl_const_regs(const u32 **regs)
 		*regs = ddr3_ext_phy_ctrl_const_base_es1;
 		break;
 	case OMAP5432_ES2_0:
+		*regs = ddr3_ext_phy_ctrl_const_base_es2;
+		break;
 	case DRA752_ES1_0:
+		if (emif_nr == 1)
+			*regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif1;
+		else
+			*regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif2;
+		break;
 	default:
 		*regs = ddr3_ext_phy_ctrl_const_base_es2;
 
@@ -334,9 +481,12 @@ void do_ext_phy_settings(u32 base, const struct emif_regs *regs)
 {
 	u32 *ext_phy_ctrl_base = 0;
 	u32 *emif_ext_phy_ctrl_base = 0;
+	u32 emif_nr;
 	const u32 *ext_phy_ctrl_const_regs;
 	u32 i = 0;
 
+	emif_nr = (base == EMIF1_BASE) ? 1 : 2;
+
 	struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
 
 	ext_phy_ctrl_base = (u32 *) &(regs->emif_ddr_ext_phy_ctrl_1);
@@ -353,7 +503,7 @@ void do_ext_phy_settings(u32 base, const struct emif_regs *regs)
 	 * external phy 6-24 registers do not change with
 	 * ddr frequency
 	 */
-	emif_get_ext_phy_ctrl_const_regs(&ext_phy_ctrl_const_regs);
+	emif_get_ext_phy_ctrl_const_regs(emif_nr, &ext_phy_ctrl_const_regs);
 	for (i = 0; i < EMIF_EXT_PHY_CTRL_CONST_REG; i++) {
 		writel(ext_phy_ctrl_const_regs[i],
 		       emif_ext_phy_ctrl_base++);
diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h
index 63378fb..e7d79fc 100644
--- a/arch/arm/include/asm/arch-omap5/omap.h
+++ b/arch/arm/include/asm/arch-omap5/omap.h
@@ -191,6 +191,7 @@ struct ctrl_ioregs {
 	u32 ctrl_ddrio_1;
 	u32 ctrl_ddrio_2;
 	u32 ctrl_emif_sdram_config_ext;
+	u32 ctrl_ddr_ctrl_ext_0;
 };
 #endif /* __ASSEMBLY__ */
 #endif
diff --git a/arch/arm/include/asm/emif.h b/arch/arm/include/asm/emif.h
index 5f11d7b..1b94a99 100644
--- a/arch/arm/include/asm/emif.h
+++ b/arch/arm/include/asm/emif.h
@@ -581,7 +581,7 @@
 	(0xFF << EMIF_SYS_ADDR_SHIFT))
 
 #define EMIF_EXT_PHY_CTRL_TIMING_REG	0x5
-#define EMIF_EXT_PHY_CTRL_CONST_REG	0x13
+#define EMIF_EXT_PHY_CTRL_CONST_REG	0x14
 
 /* Reg mapping structure */
 struct emif_reg_struct {
@@ -855,13 +855,10 @@ struct dmm_lisa_map_regs {
 #define DPD_ENABLE	1
 
 /* Maximum delay before Low Power Modes */
-#ifndef CONFIG_OMAP54XX
-#define REG_CS_TIM		0xF
-#else
 #define REG_CS_TIM		0x0
-#endif
-#define REG_SR_TIM		0xF
-#define REG_PD_TIM		0xF
+#define REG_SR_TIM		0x0
+#define REG_PD_TIM		0x0
+
 
 /* EMIF_PWR_MGMT_CTRL register */
 #define EMIF_PWR_MGMT_CTRL (\
@@ -1113,6 +1110,7 @@ struct emif_regs {
 	u32 freq;
 	u32 sdram_config_init;
 	u32 sdram_config;
+	u32 sdram_config2;
 	u32 ref_ctrl;
 	u32 sdram_tim1;
 	u32 sdram_tim2;
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 86ddd65..fa28358 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -396,6 +396,7 @@ struct omap_sys_ctrl_regs {
 	u32 control_ddrio_0;
 	u32 control_ddrio_1;
 	u32 control_ddrio_2;
+	u32 control_ddr_control_ext_0;
 	u32 control_lpddr2io1_0;
 	u32 control_lpddr2io1_1;
 	u32 control_lpddr2io1_2;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 07/12] ARM: DRA7xx: Correct the SYS_CLK to 20MHZ
  2013-05-29 11:02 ` [U-Boot] [PATCH 07/12] ARM: DRA7xx: Correct the SYS_CLK to 20MHZ Lokesh Vutla
@ 2013-05-29 13:04   ` Tom Rini
  0 siblings, 0 replies; 20+ messages in thread
From: Tom Rini @ 2013-05-29 13:04 UTC (permalink / raw)
  To: u-boot

On Wed, May 29, 2013 at 04:32:42PM +0530, Lokesh Vutla wrote:

> From: Sricharan R <r.sricharan@ti.com>
> 
> The sys_clk on the dra evm board is 20MHZ.
> Changing the configuration for the same.
> 
> Signed-off-by: Sricharan R <r.sricharan@ti.com>
> ---
>  include/configs/dra7xx_evm.h   |    4 ++++
>  include/configs/omap5_common.h |    1 -
>  include/configs/omap5_uevm.h   |    3 +++
>  3 files changed, 7 insertions(+), 1 deletion(-)

OK, lets start fixing some of this madness while we're in here.  V_OSCK
(setting aside am335x) is only used for V_SCLK.  V_SCLK is only used for
TIMER_CLOCK in arch/arm/cpu/armv7/omap-common/timer.c.  We need to move
this value (or value pair) into <asm/arch/clock.h> and rename
omap*/clocks.h to clock.h (it's the outlier vs the rest of ARM).

-- 
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/20130529/ce914972/attachment.pgp>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address
  2013-05-29 11:02 ` [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address Lokesh Vutla
@ 2013-05-29 13:06   ` Tom Rini
  2013-05-29 13:33     ` Sricharan R
  0 siblings, 1 reply; 20+ messages in thread
From: Tom Rini @ 2013-05-29 13:06 UTC (permalink / raw)
  To: u-boot

On Wed, May 29, 2013 at 04:32:43PM +0530, Lokesh Vutla wrote:

> From: Sricharan R <r.sricharan@ti.com>
> 
> NON SECURE SRAM is 512KB in DRA7xx devices.
> So fixing it here.
> 
> Signed-off-by: Sricharan R <r.sricharan@ti.com>
> ---
>  arch/arm/include/asm/arch-omap5/omap.h |    7 -------
>  include/configs/dra7xx_evm.h           |    3 +++
>  include/configs/omap5_uevm.h           |    3 +++

No, we need to handle this in the include files, not the config files.

-- 
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/20130529/a4e67a7f/attachment.pgp>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 09/12] mmc: omap_hsmmc: add mmc1 pbias, ldo1
  2013-05-29 11:02 ` [U-Boot] [PATCH 09/12] mmc: omap_hsmmc: add mmc1 pbias, ldo1 Lokesh Vutla
@ 2013-05-29 13:08   ` Tom Rini
  0 siblings, 0 replies; 20+ messages in thread
From: Tom Rini @ 2013-05-29 13:08 UTC (permalink / raw)
  To: u-boot

On Wed, May 29, 2013 at 04:32:44PM +0530, Lokesh Vutla wrote:
> From: Balaji T K <balajitk@ti.com>
> 
> add dra mmc pbias support and ldo1 power on
> 
> Signed-off-by: Balaji T K <balajitk@ti.com>
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[snip]
> +	udelay(150); /* wait 10 us */
> +	value |= SDCARD_PWRDNZ;
> +	writel(value, (*ctrl)->control_pbias);
> +	udelay(150); /* wait 10 us */

That's not 10us.

> +	val = 0x2b; /* (3 -.9)*20 +1 */

Consistent spacing in the math please (and leading 0).

> +	if (palmas_i2c_write_u8(0x58, LDO1_CTRL, val)) {

No magic values please.

Thanks!

-- 
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/20130529/1fa9bcfe/attachment.pgp>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's
  2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
                   ` (11 preceding siblings ...)
  2013-05-29 11:02 ` [U-Boot] [PATCH 12/12] ARM: DRA7xx: EMIF: Change settings required for EVM board Lokesh Vutla
@ 2013-05-29 13:12 ` Tom Rini
  2013-05-30  4:11   ` Lokesh Vutla
  12 siblings, 1 reply; 20+ messages in thread
From: Tom Rini @ 2013-05-29 13:12 UTC (permalink / raw)
  To: u-boot

On Wed, May 29, 2013 at 04:32:35PM +0530, Lokesh Vutla wrote:

> This series update support for DRA7xx family Socs and the data for
> DRA752 ES1.0 soc.
> This is on top of my recent Misc cleanup series:
> http://u-boot.10912.n7.nabble.com/PATCH-0-3-ARM-OMAP4-Misc-Cleanup-tt155877.html
> 
> Tested on DRA752 ES1.0, OMAP5432 ES2.0,
> MAKEALL for all armv7 board has been verified.

Aside from a few comments, everything else looks good.  Oh, and please
test with MAKEALL -s omap as well as -c armv7, thanks!

-- 
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/20130529/8a7d1292/attachment.pgp>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address
  2013-05-29 13:06   ` Tom Rini
@ 2013-05-29 13:33     ` Sricharan R
  2013-05-29 13:53       ` Tom Rini
  0 siblings, 1 reply; 20+ messages in thread
From: Sricharan R @ 2013-05-29 13:33 UTC (permalink / raw)
  To: u-boot

On Wednesday 29 May 2013 06:36 PM, Tom Rini wrote:
> On Wed, May 29, 2013 at 04:32:43PM +0530, Lokesh Vutla wrote:
>
>> From: Sricharan R <r.sricharan@ti.com>
>>
>> NON SECURE SRAM is 512KB in DRA7xx devices.
>> So fixing it here.
>>
>> Signed-off-by: Sricharan R <r.sricharan@ti.com>
>> ---
>>  arch/arm/include/asm/arch-omap5/omap.h |    7 -------
>>  include/configs/dra7xx_evm.h           |    3 +++
>>  include/configs/omap5_uevm.h           |    3 +++
> No, we need to handle this in the include files, not the config files.
>
   Ok.. The only concern was headers were shared between
   OMAP5/DRA and this results in #ifdef CONFIG_XX checks.
   Just thinking how to handle this better.

Regards,
 Sricharan

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address
  2013-05-29 13:33     ` Sricharan R
@ 2013-05-29 13:53       ` Tom Rini
  0 siblings, 0 replies; 20+ messages in thread
From: Tom Rini @ 2013-05-29 13:53 UTC (permalink / raw)
  To: u-boot

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

On 05/29/2013 09:33 AM, Sricharan R wrote:
> On Wednesday 29 May 2013 06:36 PM, Tom Rini wrote:
>> On Wed, May 29, 2013 at 04:32:43PM +0530, Lokesh Vutla wrote:
>> 
>>> From: Sricharan R <r.sricharan@ti.com>
>>> 
>>> NON SECURE SRAM is 512KB in DRA7xx devices. So fixing it here.
>>> 
>>> Signed-off-by: Sricharan R <r.sricharan@ti.com> --- 
>>> arch/arm/include/asm/arch-omap5/omap.h |    7 ------- 
>>> include/configs/dra7xx_evm.h           |    3 +++ 
>>> include/configs/omap5_uevm.h           |    3 +++
>> No, we need to handle this in the include files, not the config
>> files.
>> 
> Ok.. The only concern was headers were shared between OMAP5/DRA and
> this results in #ifdef CONFIG_XX checks. Just thinking how to
> handle this better.

That's fine.  If we end up with large differences we can split the
files, ala am335x and ti814x (and later, ti816x).

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

iQIcBAEBAgAGBQJRpgg/AAoJENk4IS6UOR1WwpoP/0dzJxZRFRRStw96ef46hi8m
gtCBN4AXxTrv5+d2wgShOxmFTufTqHYJDi68kVKmrB3brMUjpgbp/ApTyi4a4vRh
Dim9VWHHnlFZOKHwJwfDNr6CTx4mPXmI2qs94pfzHOvFmGtfkhYRVF/wbF1XwgW5
86Qep+YW1mr62t3kact+Cg6Pln3Krbb3RjX3waUSZeKzOlifaSI3Dntvp2uLgrA2
YQCIVVYd3TE8L7utgHF48v8x7aRuAxcd5ZtZvtXoVAxXv3zFyyibGyBFFXxnMmLz
0dFwUm9mE1+MYATAjcxlB+OpD5bJDp30JhtF0s42rvrQGyBxy1mdLAQBxR0DxoPa
1GvhQgWKGJKhwXr9TSDT3N1DTCt0nPEzjs7iekz2NLHjhoYMPL/yfj0rliyfaw5o
O2S3I1d1Yy/V0gyLJgAey1SqC4G9n9XQyjsxAeSdosdDHSKUM3w6bkIS+UbTL8OZ
gq1MteO/fddvSGQIR5+YQ6R7boH3BenSOxJRiKNMWVXlDiqZGgMRSEqT/HGnrBgh
WBM0Va5c3HJjce4WXc+gWpJR+QREB6cHuc7lRGjI+VAKFioFDdaDXQSc2TJ6Q74W
QRwl0xCMgykvXekHG9t+KXrSBFh1cDiJXeyI9dD3UnvE09Hzu1DwPCZf/XfhcT+4
ic2Z/9fUSgPfHFqZqOnq
=/EmW
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's
  2013-05-29 13:12 ` [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Tom Rini
@ 2013-05-30  4:11   ` Lokesh Vutla
  0 siblings, 0 replies; 20+ messages in thread
From: Lokesh Vutla @ 2013-05-30  4:11 UTC (permalink / raw)
  To: u-boot

Hi,
On Wednesday 29 May 2013 06:42 PM, Tom Rini wrote:
> On Wed, May 29, 2013 at 04:32:35PM +0530, Lokesh Vutla wrote:
>
>> This series update support for DRA7xx family Socs and the data for
>> DRA752 ES1.0 soc.
>> This is on top of my recent Misc cleanup series:
>> http://u-boot.10912.n7.nabble.com/PATCH-0-3-ARM-OMAP4-Misc-Cleanup-tt155877.html
>>
>> Tested on DRA752 ES1.0, OMAP5432 ES2.0,
>> MAKEALL for all armv7 board has been verified.
>
> Aside from a few comments, everything else looks good.  Oh, and please
> test with MAKEALL -s omap as well as -c armv7, thanks!
Thanks Tom. Will address your comments and post a V2.
Ok will do MAKEALL for omap boards also.

Regards,
Lokesh
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-05-30  4:11 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 11:02 [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 01/12] ARM: DRA7xx: Add control id code for DRA7xx Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 02/12] ARM: DRA7xx: power Add support for tps659038 PMIC Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 03/12] ARM: DRA7xx: clocks: Fixing i2c_init for PMIC Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 04/12] ARM: OMAP5: DRA7xx: support class 0 optimized voltages Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 05/12] ARM: DRA7xx: Do not enable srcomp for DRA7xx Soc's Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 06/12] ARM: DRA7xx: Change the Debug UART to UART1 Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 07/12] ARM: DRA7xx: Correct the SYS_CLK to 20MHZ Lokesh Vutla
2013-05-29 13:04   ` Tom Rini
2013-05-29 11:02 ` [U-Boot] [PATCH 08/12] ARM: DRA7xx: Correct SRAM END address Lokesh Vutla
2013-05-29 13:06   ` Tom Rini
2013-05-29 13:33     ` Sricharan R
2013-05-29 13:53       ` Tom Rini
2013-05-29 11:02 ` [U-Boot] [PATCH 09/12] mmc: omap_hsmmc: add mmc1 pbias, ldo1 Lokesh Vutla
2013-05-29 13:08   ` Tom Rini
2013-05-29 11:02 ` [U-Boot] [PATCH 10/12] ARM: DRA7xx: Update pinmux data Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 11/12] ARM: DRA7xx: clocks: Update PLL values Lokesh Vutla
2013-05-29 11:02 ` [U-Boot] [PATCH 12/12] ARM: DRA7xx: EMIF: Change settings required for EVM board Lokesh Vutla
2013-05-29 13:12 ` [U-Boot] [PATCH 00/12] ARM: DRA7xx: Update support for DRA7xx Soc's Tom Rini
2013-05-30  4:11   ` Lokesh Vutla

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.