diff options
Diffstat (limited to 'arch/arm/cpu')
| -rw-r--r-- | arch/arm/cpu/armv7/omap-common/clocks-common.c | 2 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap-common/emif-common.c | 4 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap-common/hwinit-common.c | 201 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap-common/lowlevel_init.S | 12 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap4/Makefile | 5 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap4/hwinit.c | 167 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap4/omap4_mux_data.h | 83 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap4/sys_info.c | 53 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap5/Makefile | 48 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap5/config.mk | 28 | ||||
| -rw-r--r-- | arch/arm/cpu/armv7/omap5/hwinit.c | 78 | 
11 files changed, 362 insertions, 319 deletions
| diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c index 095ba39ae..9f5200dda 100644 --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c @@ -925,7 +925,7 @@ void setup_clocks_for_console(void)  void prcm_init(void)  { -	switch (omap4_hw_init_context()) { +	switch (omap_hw_init_context()) {  	case OMAP_INIT_CONTEXT_SPL:  	case OMAP_INIT_CONTEXT_UBOOT_FROM_NOR:  	case OMAP_INIT_CONTEXT_UBOOT_AFTER_CH: diff --git a/arch/arm/cpu/armv7/omap-common/emif-common.c b/arch/arm/cpu/armv7/omap-common/emif-common.c index 94c8bed24..03b45c69b 100644 --- a/arch/arm/cpu/armv7/omap-common/emif-common.c +++ b/arch/arm/cpu/armv7/omap-common/emif-common.c @@ -1212,7 +1212,7 @@ void sdram_init(void)  	debug(">>sdram_init()\n"); -	if (omap4_hw_init_context() == OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL) +	if (omap_hw_init_context() == OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)  		return;  	in_sdram = running_from_sdram(); @@ -1237,7 +1237,7 @@ void sdram_init(void)  	/* Do some testing after the init */  	if (!in_sdram) { -		size_prog = omap4_sdram_size(); +		size_prog = omap_sdram_size();  		size_detect = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,  						size_prog);  		/* Compare with the size programmed */ diff --git a/arch/arm/cpu/armv7/omap-common/hwinit-common.c b/arch/arm/cpu/armv7/omap-common/hwinit-common.c index 8e765cfe7..2ab16bfeb 100644 --- a/arch/arm/cpu/armv7/omap-common/hwinit-common.c +++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c @@ -1,6 +1,6 @@  /*   * - * Common functions for OMAP4 based boards + * Common functions for OMAP4/5 based boards   *   * (C) Copyright 2010   * Texas Instruments, <www.ti.com> @@ -28,29 +28,12 @@   * MA 02111-1307 USA   */  #include <common.h> -#include <asm/armv7.h> -#include <asm/arch/cpu.h>  #include <asm/arch/sys_proto.h>  #include <asm/sizes.h>  #include <asm/arch/emif.h> -#include <asm/arch/gpio.h> -#include "../omap4/omap4_mux_data.h"  DECLARE_GLOBAL_DATA_PTR; -u32 *const omap4_revision = (u32 *)OMAP4_SRAM_SCRATCH_OMAP4_REV; - -static const struct gpio_bank gpio_bank_44xx[6] = { -	{ (void *)OMAP44XX_GPIO1_BASE, METHOD_GPIO_24XX }, -	{ (void *)OMAP44XX_GPIO2_BASE, METHOD_GPIO_24XX }, -	{ (void *)OMAP44XX_GPIO3_BASE, METHOD_GPIO_24XX }, -	{ (void *)OMAP44XX_GPIO4_BASE, METHOD_GPIO_24XX }, -	{ (void *)OMAP44XX_GPIO5_BASE, METHOD_GPIO_24XX }, -	{ (void *)OMAP44XX_GPIO6_BASE, METHOD_GPIO_24XX }, -}; - -const struct gpio_bank *const omap_gpio_bank = gpio_bank_44xx; -  #ifdef CONFIG_SPL_BUILD  /*   * We use static variables because global data is not ready yet. @@ -58,78 +41,17 @@ const struct gpio_bank *const omap_gpio_bank = gpio_bank_44xx;   * We would not typically need to save these parameters in regular   * U-Boot. This is needed only in SPL at the moment.   */ -u32 omap4_boot_device = BOOT_DEVICE_MMC1; -u32 omap4_boot_mode = MMCSD_MODE_FAT; +u32 omap_bootdevice = BOOT_DEVICE_MMC1; +u32 omap_bootmode = MMCSD_MODE_FAT;  u32 omap_boot_device(void)  { -	return omap4_boot_device; +	return omap_bootdevice;  }  u32 omap_boot_mode(void)  { -	return omap4_boot_mode; -} - -/* - * Some tuning of IOs for optimal power and performance - */ -static void do_io_settings(void) -{ -	u32 lpddr2io; -	struct control_lpddr2io_regs *lpddr2io_regs = -		(struct control_lpddr2io_regs *)LPDDR2_IO_REGS_BASE; -	struct omap4_sys_ctrl_regs *const ctrl = -		(struct omap4_sys_ctrl_regs *)SYSCTRL_GENERAL_CORE_BASE; - -	u32 omap4_rev = omap_revision(); - -	if (omap4_rev == OMAP4430_ES1_0) -		lpddr2io = CONTROL_LPDDR2IO_SLEW_125PS_DRV8_PULL_DOWN; -	else if (omap4_rev == OMAP4430_ES2_0) -		lpddr2io = CONTROL_LPDDR2IO_SLEW_325PS_DRV8_GATE_KEEPER; -	else -		lpddr2io = CONTROL_LPDDR2IO_SLEW_315PS_DRV12_PULL_DOWN; - -	/* EMIF1 */ -	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io1_0); -	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io1_1); -	/* No pull for GR10 as per hw team's recommendation */ -	writel(lpddr2io & ~LPDDR2IO_GR10_WD_MASK, -		&lpddr2io_regs->control_lpddr2io1_2); -	writel(CONTROL_LPDDR2IO_3_VAL, &lpddr2io_regs->control_lpddr2io1_3); - -	/* EMIF2 */ -	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io2_0); -	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io2_1); -	/* No pull for GR10 as per hw team's recommendation */ -	writel(lpddr2io & ~LPDDR2IO_GR10_WD_MASK, -		&lpddr2io_regs->control_lpddr2io2_2); -	writel(CONTROL_LPDDR2IO_3_VAL, &lpddr2io_regs->control_lpddr2io2_3); - -	/* -	 * Some of these settings (TRIM values) come from eFuse and are -	 * in turn programmed in the eFuse at manufacturing time after -	 * calibration of the device. Do the software over-ride only if -	 * the device is not correctly trimmed -	 */ -	if (!(readl(&ctrl->control_std_fuse_opp_bgap) & 0xFFFF)) { - -		writel(LDOSRAM_VOLT_CTRL_OVERRIDE, -			&ctrl->control_ldosram_iva_voltage_ctrl); - -		writel(LDOSRAM_VOLT_CTRL_OVERRIDE, -			&ctrl->control_ldosram_mpu_voltage_ctrl); - -		writel(LDOSRAM_VOLT_CTRL_OVERRIDE, -			&ctrl->control_ldosram_core_voltage_ctrl); -	} - -	if (!readl(&ctrl->control_efuse_1)) -		writel(CONTROL_EFUSE_1_OVERRIDE, &ctrl->control_efuse_1); - -	if (!readl(&ctrl->control_efuse_2)) -		writel(CONTROL_EFUSE_2_OVERRIDE, &ctrl->control_efuse_2); +	return omap_bootmode;  }  #endif @@ -142,26 +64,9 @@ void do_set_mux(u32 base, struct pad_conf_entry const *array, int size)  		writew(pad->val, base + pad->offset);  } -static void set_muxconf_regs_essential(void) -{ -	do_set_mux(CONTROL_PADCONF_CORE, core_padconf_array_essential, -		   sizeof(core_padconf_array_essential) / -		   sizeof(struct pad_conf_entry)); - -	do_set_mux(CONTROL_PADCONF_WKUP, wkup_padconf_array_essential, -		   sizeof(wkup_padconf_array_essential) / -		   sizeof(struct pad_conf_entry)); - -	if (omap_revision() >= OMAP4460_ES1_0) -		do_set_mux(CONTROL_PADCONF_WKUP, -				 wkup_padconf_array_essential_4460, -				 sizeof(wkup_padconf_array_essential_4460) / -				 sizeof(struct pad_conf_entry)); -} -  static void set_mux_conf_regs(void)  { -	switch (omap4_hw_init_context()) { +	switch (omap_hw_init_context()) {  	case OMAP_INIT_CONTEXT_SPL:  		set_muxconf_regs_essential();  		break; @@ -176,7 +81,7 @@ static void set_mux_conf_regs(void)  	}  } -static u32 cortex_a9_rev(void) +u32 cortex_rev(void)  {  	unsigned int rev; @@ -187,65 +92,14 @@ static u32 cortex_a9_rev(void)  	return rev;  } -static void init_omap4_revision(void) +void omap_rev_string(char *omap_rev_string)  { -	/* -	 * For some of the ES2/ES1 boards ID_CODE is not reliable: -	 * Also, ES1 and ES2 have different ARM revisions -	 * So use ARM revision for identification -	 */ -	unsigned int arm_rev = cortex_a9_rev(); +	u32 omap_rev = omap_revision(); +	u32 omap_variant = (omap_rev & 0xFFFF0000) >> 16; +	u32 major_rev = (omap_rev & 0x00000F00) >> 8; +	u32 minor_rev = (omap_rev & 0x000000F0) >> 4; -	switch (arm_rev) { -	case MIDR_CORTEX_A9_R0P1: -		*omap4_revision = OMAP4430_ES1_0; -		break; -	case MIDR_CORTEX_A9_R1P2: -		switch (readl(CONTROL_ID_CODE)) { -		case OMAP4430_CONTROL_ID_CODE_ES2_0: -			*omap4_revision = OMAP4430_ES2_0; -			break; -		case OMAP4430_CONTROL_ID_CODE_ES2_1: -			*omap4_revision = OMAP4430_ES2_1; -			break; -		case OMAP4430_CONTROL_ID_CODE_ES2_2: -			*omap4_revision = OMAP4430_ES2_2; -			break; -		default: -			*omap4_revision = OMAP4430_ES2_0; -			break; -		} -		break; -	case MIDR_CORTEX_A9_R1P3: -		*omap4_revision = OMAP4430_ES2_3; -		break; -	case MIDR_CORTEX_A9_R2P10: -		switch (readl(CONTROL_ID_CODE)) { -		case OMAP4460_CONTROL_ID_CODE_ES1_0: -			*omap4_revision = OMAP4460_ES1_0; -			break; -		case OMAP4460_CONTROL_ID_CODE_ES1_1: -			*omap4_revision = OMAP4460_ES1_1; -			break; -		default: -			*omap4_revision = OMAP4460_ES1_0; -			break; -		} -		break; -	default: -		*omap4_revision = OMAP4430_SILICON_ID_INVALID; -		break; -	} -} - -void omap_rev_string(char *omap4_rev_string) -{ -	u32 omap4_rev = omap_revision(); -	u32 omap4_variant = (omap4_rev & 0xFFFF0000) >> 16; -	u32 major_rev = (omap4_rev & 0x00000F00) >> 8; -	u32 minor_rev = (omap4_rev & 0x000000F0) >> 4; - -	sprintf(omap4_rev_string, "OMAP%x ES%x.%x", omap4_variant, major_rev, +	sprintf(omap_rev_string, "OMAP%x ES%x.%x", omap_variant, major_rev,  		minor_rev);  } @@ -265,7 +119,7 @@ void omap_rev_string(char *omap4_rev_string)   */  void s_init(void)  { -	init_omap4_revision(); +	init_omap_revision();  	watchdog_init();  	set_mux_conf_regs();  #ifdef CONFIG_SPL_BUILD @@ -312,7 +166,7 @@ void watchdog_init(void)   * This is needed because the size of memory installed may be   * different on different versions of the board   */ -u32 omap4_sdram_size(void) +u32 omap_sdram_size(void)  {  	u32 section, i, total_size = 0, size, addr;  	for (i = 0; i < 4; i++) { @@ -339,8 +193,7 @@ u32 omap4_sdram_size(void)  int dram_init(void)  {  	sdram_init(); -	gd->ram_size = omap4_sdram_size(); - +	gd->ram_size = omap_sdram_size();  	return 0;  } @@ -363,18 +216,26 @@ int arch_cpu_init(void)  	return 0;  } -#ifndef CONFIG_SYS_L2CACHE_OFF -void v7_outer_cache_enable(void) +/* + *  get_device_type(): tell if GP/HS/EMU/TST + */ +u32 get_device_type(void)  { -	set_pl310_ctrl_reg(1); +	return 0;  } -void v7_outer_cache_disable(void) +/* + * Print CPU information + */ +int print_cpuinfo(void)  { -	set_pl310_ctrl_reg(0); -} -#endif +	char rev_string_buffer[50]; + +	omap_rev_string(rev_string_buffer); +	printf("CPU  : %s\n", rev_string_buffer); +	return 0; +}  #ifndef CONFIG_SYS_DCACHE_OFF  void enable_caches(void)  { diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S index 91525ecd4..68732987a 100644 --- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S +++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S @@ -26,7 +26,7 @@   * MA 02111-1307 USA   */ -#include <asm/arch/omap4.h> +#include <asm/arch/omap.h>  #ifdef CONFIG_SPL_BUILD  .global save_boot_params  save_boot_params: @@ -43,17 +43,17 @@ save_boot_params:  	cmp	r2, r0  	blt	1f -	/* Store the boot device in omap4_boot_device */ +	/* Store the boot device in omap_boot_device */  	ldr     r2, [r0, #BOOT_DEVICE_OFFSET]	@ r1 <- value of boot device  	and	r2, #BOOT_DEVICE_MASK -	ldr	r3, =omap4_boot_device -	str     r2, [r3]			@ omap4_boot_device <- r1 +	ldr	r3, =omap_bootdevice +	str     r2, [r3]			@ omap_boot_device <- r1 -	/* Store the boot mode (raw/FAT) in omap4_boot_mode */ +	/* Store the boot mode (raw/FAT) in omap_boot_mode */  	ldr	r2, [r0, #DEV_DESC_PTR_OFFSET]	@ get the device descriptor ptr  	ldr	r2, [r2, #DEV_DATA_PTR_OFFSET]	@ get the pDeviceData ptr  	ldr	r2, [r2, #BOOT_MODE_OFFSET]	@ get the boot mode -	ldr	r3, =omap4_boot_mode +	ldr	r3, =omap_bootmode  	str	r2, [r3]  1:  	bx	lr diff --git a/arch/arm/cpu/armv7/omap4/Makefile b/arch/arm/cpu/armv7/omap4/Makefile index d91272958..606538be9 100644 --- a/arch/arm/cpu/armv7/omap4/Makefile +++ b/arch/arm/cpu/armv7/omap4/Makefile @@ -26,10 +26,7 @@ include $(TOPDIR)/config.mk  LIB	=  $(obj)lib$(SOC).o  COBJS	+= sdram_elpida.o - -ifndef CONFIG_SPL_BUILD -COBJS	+= sys_info.o -endif +COBJS	+= hwinit.o  SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)  OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS)) diff --git a/arch/arm/cpu/armv7/omap4/hwinit.c b/arch/arm/cpu/armv7/omap4/hwinit.c new file mode 100644 index 000000000..78b3cabb0 --- /dev/null +++ b/arch/arm/cpu/armv7/omap4/hwinit.c @@ -0,0 +1,167 @@ +/* + * + * Common functions for OMAP4 based boards + * + * (C) Copyright 2010 + * Texas Instruments, <www.ti.com> + * + * Author : + *	Aneesh V	<aneesh@ti.com> + *	Steve Sakoman	<steve@sakoman.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#include <common.h> +#include <asm/armv7.h> +#include <asm/arch/cpu.h> +#include <asm/arch/sys_proto.h> +#include <asm/sizes.h> +#include <asm/arch/emif.h> +#include <asm/arch/gpio.h> + +DECLARE_GLOBAL_DATA_PTR; + +u32 *const omap4_revision = (u32 *)OMAP4_SRAM_SCRATCH_OMAP4_REV; + +static const struct gpio_bank gpio_bank_44xx[6] = { +	{ (void *)OMAP44XX_GPIO1_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP44XX_GPIO2_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP44XX_GPIO3_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP44XX_GPIO4_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP44XX_GPIO5_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP44XX_GPIO6_BASE, METHOD_GPIO_24XX }, +}; + +const struct gpio_bank *const omap_gpio_bank = gpio_bank_44xx; + +#ifdef CONFIG_SPL_BUILD +/* + * Some tuning of IOs for optimal power and performance + */ +void do_io_settings(void) +{ +	u32 lpddr2io; +	struct control_lpddr2io_regs *lpddr2io_regs = +		(struct control_lpddr2io_regs *)LPDDR2_IO_REGS_BASE; +	struct omap4_sys_ctrl_regs *const ctrl = +		(struct omap4_sys_ctrl_regs *)SYSCTRL_GENERAL_CORE_BASE; + +	u32 omap4_rev = omap_revision(); + +	if (omap4_rev == OMAP4430_ES1_0) +		lpddr2io = CONTROL_LPDDR2IO_SLEW_125PS_DRV8_PULL_DOWN; +	else if (omap4_rev == OMAP4430_ES2_0) +		lpddr2io = CONTROL_LPDDR2IO_SLEW_325PS_DRV8_GATE_KEEPER; +	else +		lpddr2io = CONTROL_LPDDR2IO_SLEW_315PS_DRV12_PULL_DOWN; + +	/* EMIF1 */ +	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io1_0); +	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io1_1); +	/* No pull for GR10 as per hw team's recommendation */ +	writel(lpddr2io & ~LPDDR2IO_GR10_WD_MASK, +		&lpddr2io_regs->control_lpddr2io1_2); +	writel(CONTROL_LPDDR2IO_3_VAL, &lpddr2io_regs->control_lpddr2io1_3); + +	/* EMIF2 */ +	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io2_0); +	writel(lpddr2io, &lpddr2io_regs->control_lpddr2io2_1); +	/* No pull for GR10 as per hw team's recommendation */ +	writel(lpddr2io & ~LPDDR2IO_GR10_WD_MASK, +		&lpddr2io_regs->control_lpddr2io2_2); +	writel(CONTROL_LPDDR2IO_3_VAL, &lpddr2io_regs->control_lpddr2io2_3); + +	/* +	 * Some of these settings (TRIM values) come from eFuse and are +	 * in turn programmed in the eFuse at manufacturing time after +	 * calibration of the device. Do the software over-ride only if +	 * the device is not correctly trimmed +	 */ +	if (!(readl(&ctrl->control_std_fuse_opp_bgap) & 0xFFFF)) { + +		writel(LDOSRAM_VOLT_CTRL_OVERRIDE, +			&ctrl->control_ldosram_iva_voltage_ctrl); + +		writel(LDOSRAM_VOLT_CTRL_OVERRIDE, +			&ctrl->control_ldosram_mpu_voltage_ctrl); + +		writel(LDOSRAM_VOLT_CTRL_OVERRIDE, +			&ctrl->control_ldosram_core_voltage_ctrl); +	} + +	if (!readl(&ctrl->control_efuse_1)) +		writel(CONTROL_EFUSE_1_OVERRIDE, &ctrl->control_efuse_1); + +	if (!readl(&ctrl->control_efuse_2)) +		writel(CONTROL_EFUSE_2_OVERRIDE, &ctrl->control_efuse_2); +} +#endif + +void init_omap_revision(void) +{ +	/* +	 * For some of the ES2/ES1 boards ID_CODE is not reliable: +	 * Also, ES1 and ES2 have different ARM revisions +	 * So use ARM revision for identification +	 */ +	unsigned int arm_rev = cortex_rev(); + +	switch (arm_rev) { +	case MIDR_CORTEX_A9_R0P1: +		*omap4_revision = OMAP4430_ES1_0; +		break; +	case MIDR_CORTEX_A9_R1P2: +		switch (readl(CONTROL_ID_CODE)) { +		case OMAP4_CONTROL_ID_CODE_ES2_0: +			*omap4_revision = OMAP4430_ES2_0; +			break; +		case OMAP4_CONTROL_ID_CODE_ES2_1: +			*omap4_revision = OMAP4430_ES2_1; +			break; +		case OMAP4_CONTROL_ID_CODE_ES2_2: +			*omap4_revision = OMAP4430_ES2_2; +			break; +		default: +			*omap4_revision = OMAP4430_ES2_0; +			break; +		} +		break; +	case MIDR_CORTEX_A9_R1P3: +		*omap4_revision = OMAP4430_ES2_3; +		break; +	case MIDR_CORTEX_A9_R2P10: +		*omap4_revision = OMAP4460_ES1_0; +		break; +	default: +		*omap4_revision = OMAP4430_SILICON_ID_INVALID; +		break; +	} +} + +#ifndef CONFIG_SYS_L2CACHE_OFF +void v7_outer_cache_enable(void) +{ +	set_pl310_ctrl_reg(1); +} + +void v7_outer_cache_disable(void) +{ +	set_pl310_ctrl_reg(0); +} +#endif diff --git a/arch/arm/cpu/armv7/omap4/omap4_mux_data.h b/arch/arm/cpu/armv7/omap4/omap4_mux_data.h deleted file mode 100644 index b9403910c..000000000 --- a/arch/arm/cpu/armv7/omap4/omap4_mux_data.h +++ /dev/null @@ -1,83 +0,0 @@ - /* - * (C) Copyright 2010 - * Texas Instruments Incorporated, <www.ti.com> - * - *	Balaji Krishnamoorthy	<balajitk@ti.com> - *	Aneesh V		<aneesh@ti.com> - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ -#ifndef _OMAP4_MUX_DATA_H_ -#define _OMAP4_MUX_DATA_H_ - -#include <asm/arch/mux_omap4.h> - -const struct pad_conf_entry core_padconf_array_essential[] = { - -{GPMC_AD0, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat0 */ -{GPMC_AD1, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat1 */ -{GPMC_AD2, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat2 */ -{GPMC_AD3, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat3 */ -{GPMC_AD4, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat4 */ -{GPMC_AD5, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat5 */ -{GPMC_AD6, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat6 */ -{GPMC_AD7, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat7 */ -{GPMC_NOE, (PTU | IEN | OFF_EN | OFF_OUT_PTD | M1)},	 /* sdmmc2_clk */ -{GPMC_NWE, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_cmd */ -{SDMMC1_CLK, (PTU | OFF_EN | OFF_OUT_PTD | M0)},	 /* sdmmc1_clk */ -{SDMMC1_CMD, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_cmd */ -{SDMMC1_DAT0, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat0 */ -{SDMMC1_DAT1, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat1 */ -{SDMMC1_DAT2, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat2 */ -{SDMMC1_DAT3, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat3 */ -{SDMMC1_DAT4, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat4 */ -{SDMMC1_DAT5, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat5 */ -{SDMMC1_DAT6, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat6 */ -{SDMMC1_DAT7, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat7 */ -{I2C1_SCL, (PTU | IEN | M0)},				/* i2c1_scl */ -{I2C1_SDA, (PTU | IEN | M0)},				/* i2c1_sda */ -{I2C2_SCL, (PTU | IEN | M0)},				/* i2c2_scl */ -{I2C2_SDA, (PTU | IEN | M0)},				/* i2c2_sda */ -{I2C3_SCL, (PTU | IEN | M0)},				/* i2c3_scl */ -{I2C3_SDA, (PTU | IEN | M0)},				/* i2c3_sda */ -{I2C4_SCL, (PTU | IEN | M0)},				/* i2c4_scl */ -{I2C4_SDA, (PTU | IEN | M0)},				/* i2c4_sda */ -{UART3_CTS_RCTX, (PTU | IEN | M0)},			/* uart3_tx */ -{UART3_RTS_SD, (M0)},					/* uart3_rts_sd */ -{UART3_RX_IRRX, (IEN | M0)},				/* uart3_rx */ -{UART3_TX_IRTX, (M0)}					/* uart3_tx */ - -}; - -const struct pad_conf_entry wkup_padconf_array_essential[] = { - -{PAD1_SR_SCL, (PTU | IEN | M0)}, /* sr_scl */ -{PAD0_SR_SDA, (PTU | IEN | M0)}, /* sr_sda */ -{PAD1_SYS_32K, (IEN | M0)}	 /* sys_32k */ - -}; - -const struct pad_conf_entry wkup_padconf_array_essential_4460[] = { - -{PAD1_FREF_CLK4_REQ, (M3)},	 /* gpio_wk7, TPS */ - -}; - - -#endif  /* _OMAP4_MUX_DATA_H_ */ diff --git a/arch/arm/cpu/armv7/omap4/sys_info.c b/arch/arm/cpu/armv7/omap4/sys_info.c deleted file mode 100644 index b9e57659f..000000000 --- a/arch/arm/cpu/armv7/omap4/sys_info.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * (C) Copyright 2010 - * Texas Instruments, <www.ti.com> - * - * Author : - *	Aneesh V	<aneesh@ti.com> - *	Steve Sakoman	<steve@sakoman.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#include <common.h> -#include <asm/arch/sys_proto.h> - -/* - *  get_device_type(): tell if GP/HS/EMU/TST - */ -u32 get_device_type(void) -{ -	return 0; -} - -/* - * get_board_rev() - get board revision - */ -u32 get_board_rev(void) -{ -	return 0x20; -} - -/* - * Print CPU information - */ -int print_cpuinfo(void) -{ - -	puts("CPU  : OMAP4430\n"); - -	return 0; -} diff --git a/arch/arm/cpu/armv7/omap5/Makefile b/arch/arm/cpu/armv7/omap5/Makefile new file mode 100644 index 000000000..f8ca9ac36 --- /dev/null +++ b/arch/arm/cpu/armv7/omap5/Makefile @@ -0,0 +1,48 @@ +# +# (C) Copyright 2000-2010 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB	=  $(obj)lib$(SOC).o + +COBJS	+= hwinit.o +COBJS	+= clocks.o +COBJS	+= emif.o +COBJS	+= sdram_elpida.o + +SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS)) + +all:	 $(obj).depend $(LIB) + +$(LIB):	$(OBJS) +	$(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/arch/arm/cpu/armv7/omap5/config.mk b/arch/arm/cpu/armv7/omap5/config.mk new file mode 100644 index 000000000..639f69904 --- /dev/null +++ b/arch/arm/cpu/armv7/omap5/config.mk @@ -0,0 +1,28 @@ +# +# Copyright 2011 Linaro Limited +# See file CREDITS for list of people who contributed to this +# project. +# +# Aneesh V <annesh@ti.com> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +ifdef CONFIG_SPL_BUILD +ALL-y	+= $(OBJTREE)/MLO +else +ALL-y	+= $(obj)u-boot.img +endif diff --git a/arch/arm/cpu/armv7/omap5/hwinit.c b/arch/arm/cpu/armv7/omap5/hwinit.c new file mode 100644 index 000000000..fa8e390c1 --- /dev/null +++ b/arch/arm/cpu/armv7/omap5/hwinit.c @@ -0,0 +1,78 @@ +/* + * + * Functions for omap5 based boards. + * + * (C) Copyright 2011 + * Texas Instruments, <www.ti.com> + * + * Author : + *	Aneesh V	<aneesh@ti.com> + *	Steve Sakoman	<steve@sakoman.com> + *	Sricharan	<r.sricharan@ti.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#include <common.h> +#include <asm/armv7.h> +#include <asm/arch/cpu.h> +#include <asm/arch/sys_proto.h> +#include <asm/sizes.h> +#include <asm/utils.h> +#include <asm/arch/gpio.h> + +DECLARE_GLOBAL_DATA_PTR; + +u32 *const omap5_revision = (u32 *)OMAP5_SRAM_SCRATCH_OMAP5_REV; + +static struct gpio_bank gpio_bank_54xx[6] = { +	{ (void *)OMAP54XX_GPIO1_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP54XX_GPIO2_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP54XX_GPIO3_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP54XX_GPIO4_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP54XX_GPIO5_BASE, METHOD_GPIO_24XX }, +	{ (void *)OMAP54XX_GPIO6_BASE, METHOD_GPIO_24XX }, +}; + +const struct gpio_bank *const omap_gpio_bank = gpio_bank_54xx; + +#ifdef CONFIG_SPL_BUILD +/* + * Some tuning of IOs for optimal power and performance + */ +void do_io_settings(void) +{ +} +#endif + +void init_omap_revision(void) +{ +	/* +	 * For some of the ES2/ES1 boards ID_CODE is not reliable: +	 * Also, ES1 and ES2 have different ARM revisions +	 * So use ARM revision for identification +	 */ +	unsigned int rev = cortex_rev(); + +	switch (rev) { +	case MIDR_CORTEX_A15_R0P0: +		*omap5_revision = OMAP5430_ES1_0; +	default: +		*omap5_revision = OMAP5430_SILICON_ID_INVALID; +	} +} |