Skip to content

Commit

Permalink
Merge branch 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/t…
Browse files Browse the repository at this point in the history
…mlind/linux-omap into omap/soc
  • Loading branch information
Olof Johansson committed Dec 16, 2011
2 parents deee6d5 + 4390f5b commit c971363
Show file tree
Hide file tree
Showing 24 changed files with 283 additions and 83 deletions.
11 changes: 8 additions & 3 deletions arch/arm/mach-omap2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ config SOC_OMAP3430
default y
select ARCH_OMAP_OTG

config SOC_OMAPTI816X
bool "TI816X support"
config SOC_OMAPTI81XX
bool "TI81XX support"
depends on ARCH_OMAP3
default y

config SOC_OMAPAM33XX
bool "AM33XX support"
depends on ARCH_OMAP3
default y

Expand Down Expand Up @@ -314,7 +319,7 @@ config MACH_OMAP_3630SDP

config MACH_TI8168EVM
bool "TI8168 Evaluation Module"
depends on SOC_OMAPTI816X
depends on SOC_OMAPTI81XX
default y

config MACH_OMAP_4430SDP
Expand Down
11 changes: 3 additions & 8 deletions arch/arm/mach-omap2/board-ti8168evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,12 @@ static void __init ti8168_evm_init(void)
omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
}

static void __init ti8168_evm_map_io(void)
{
omapti816x_map_common_io();
}

MACHINE_START(TI8168EVM, "ti8168evm")
/* Maintainer: Texas Instruments */
.atag_offset = 0x100,
.map_io = ti8168_evm_map_io,
.init_early = ti816x_init_early,
.init_irq = ti816x_init_irq,
.map_io = ti81xx_map_io,
.init_early = ti81xx_init_early,
.init_irq = ti81xx_init_irq,
.timer = &omap3_timer,
.init_machine = ti8168_evm_init,
MACHINE_END
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "cm-regbits-24xx.h"
#include "cm-regbits-34xx.h"

u8 cpu_mask;
u16 cpu_mask;

/*
* clkdm_control: if true, then when a clock is enabled in the
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
const char *core_ck_name,
const char *mpu_ck_name);

extern u8 cpu_mask;
extern u16 cpu_mask;

extern const struct clkops clkops_omap2_dflt_wait;
extern const struct clkops clkops_dummy;
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-omap2/clock3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -3517,6 +3517,10 @@ int __init omap3xxx_clk_init(void)
} else if (cpu_is_ti816x()) {
cpu_mask = RATE_IN_TI816X;
cpu_clkflg = CK_TI816X;
} else if (cpu_is_am33xx()) {
cpu_mask = RATE_IN_AM33XX;
} else if (cpu_is_ti814x()) {
cpu_mask = RATE_IN_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
Expand Down Expand Up @@ -3600,7 +3604,7 @@ int __init omap3xxx_clk_init(void)
* Lock DPLL5 -- here only until other device init code can
* handle this
*/
if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0))
if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
omap3_clk_lock_dpll5();

/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
Expand Down
48 changes: 37 additions & 11 deletions arch/arm/mach-omap2/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,49 @@ void __init omap3_map_io(void)

/*
* Adjust TAP register base such that omap3_check_revision accesses the correct
* TI816X register for checking device ID (it adds 0x204 to tap base while
* TI816X DEVICE ID register is at offset 0x600 from control base).
* TI81XX register for checking device ID (it adds 0x204 to tap base while
* TI81XX DEVICE ID register is at offset 0x600 from control base).
*/
#define TI816X_TAP_BASE (TI816X_CTRL_BASE + \
TI816X_CONTROL_DEVICE_ID - 0x204)
#define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \
TI81XX_CONTROL_DEVICE_ID - 0x204)

static struct omap_globals ti816x_globals = {
static struct omap_globals ti81xx_globals = {
.class = OMAP343X_CLASS,
.tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
.ctrl = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE),
.prm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
.cm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
.tap = OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE),
.ctrl = OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
.prm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
.cm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
};

void __init omap2_set_globals_ti816x(void)
void __init omap2_set_globals_ti81xx(void)
{
__omap2_set_globals(&ti816x_globals);
__omap2_set_globals(&ti81xx_globals);
}

void __init ti81xx_map_io(void)
{
omapti81xx_map_common_io();
}

#define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + \
TI81XX_CONTROL_DEVICE_ID - 0x204)

static struct omap_globals am33xx_globals = {
.class = AM335X_CLASS,
.tap = AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE),
.ctrl = AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE),
.prm = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
.cm = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
};

void __init omap2_set_globals_am33xx(void)
{
__omap2_set_globals(&am33xx_globals);
}

void __init am33xx_map_io(void)
{
omapam33xx_map_common_io();
}
#endif

Expand Down
23 changes: 17 additions & 6 deletions arch/arm/mach-omap2/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,18 @@ static inline void omap34xx_map_common_io(void)
}
#endif

#ifdef CONFIG_SOC_OMAPTI816X
extern void omapti816x_map_common_io(void);
#ifdef CONFIG_SOC_OMAPTI81XX
extern void omapti81xx_map_common_io(void);
#else
static inline void omapti816x_map_common_io(void)
static inline void omapti81xx_map_common_io(void)
{
}
#endif

#ifdef CONFIG_SOC_OMAPAM33XX
extern void omapam33xx_map_common_io(void);
#else
static inline void omapam33xx_map_common_io(void)
{
}
#endif
Expand All @@ -82,7 +90,7 @@ void omap35xx_init_early(void);
void omap3630_init_early(void);
void omap3_init_early(void); /* Do not use this one */
void am35xx_init_early(void);
void ti816x_init_early(void);
void ti81xx_init_early(void);
void omap4430_init_early(void);

/*
Expand All @@ -106,7 +114,8 @@ void omap2_set_globals_242x(void);
void omap2_set_globals_243x(void);
void omap2_set_globals_3xxx(void);
void omap2_set_globals_443x(void);
void omap2_set_globals_ti816x(void);
void omap2_set_globals_ti81xx(void);
void omap2_set_globals_am33xx(void);

/* These get called from omap2_set_globals_xxxx(), do not call these */
void omap2_set_globals_tap(struct omap_globals *);
Expand All @@ -117,7 +126,9 @@ void omap2_set_globals_prcm(struct omap_globals *);
void omap242x_map_io(void);
void omap243x_map_io(void);
void omap3_map_io(void);
void am33xx_map_io(void);
void omap4_map_io(void);
void ti81xx_map_io(void);

/**
* omap_test_timeout - busy-loop, testing a condition
Expand Down Expand Up @@ -146,7 +157,7 @@ extern struct device *omap4_get_dsp_device(void);

void omap2_init_irq(void);
void omap3_init_irq(void);
void ti816x_init_irq(void);
void ti81xx_init_irq(void);
extern int omap_irq_pending(void);
void omap_intc_save_context(void);
void omap_intc_restore_context(void);
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-omap2/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60

/* TI816X spefic control submodules */
#define TI816X_CONTROL_DEVCONF 0x600
/* TI81XX spefic control submodules */
#define TI81XX_CONTROL_DEVCONF 0x600

/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */

Expand Down Expand Up @@ -244,8 +244,8 @@
#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254

/* TI816X CONTROL_DEVCONF register offsets */
#define TI816X_CONTROL_DEVICE_ID (TI816X_CONTROL_DEVCONF + 0x000)
/* TI81XX CONTROL_DEVCONF register offsets */
#define TI81XX_CONTROL_DEVICE_ID (TI81XX_CONTROL_DEVCONF + 0x000)

/*
* REVISIT: This list of registers is not comprehensive - there are more
Expand Down
52 changes: 45 additions & 7 deletions arch/arm/mach-omap2/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void __init omap4_check_features(void)
}
}

static void __init ti816x_check_features(void)
static void __init ti81xx_check_features(void)
{
omap_features = OMAP3_HAS_NEON;
}
Expand Down Expand Up @@ -340,6 +340,29 @@ static void __init omap3_check_revision(const char **cpu_rev)
break;
}
break;
case 0xb944:
omap_revision = AM335X_REV_ES1_0;
*cpu_rev = "1.0";
case 0xb8f2:
switch (rev) {
case 0:
/* FALLTHROUGH */
case 1:
omap_revision = TI8148_REV_ES1_0;
*cpu_rev = "1.0";
break;
case 2:
omap_revision = TI8148_REV_ES2_0;
*cpu_rev = "2.0";
break;
case 3:
/* FALLTHROUGH */
default:
omap_revision = TI8148_REV_ES2_1;
*cpu_rev = "2.1";
break;
}
break;
default:
/* Unknown default to latest silicon rev as default */
omap_revision = OMAP3630_REV_ES1_2;
Expand Down Expand Up @@ -367,7 +390,7 @@ static void __init omap4_check_revision(void)
* Few initial 4430 ES2.0 samples IDCODE is same as ES1.0
* Use ARM register to detect the correct ES version
*/
if (!rev && (hawkeye != 0xb94e)) {
if (!rev && (hawkeye != 0xb94e) && (hawkeye != 0xb975)) {
idcode = read_cpuid(CPUID_ID);
rev = (idcode & 0xf) - 1;
}
Expand All @@ -389,8 +412,11 @@ static void __init omap4_check_revision(void)
omap_revision = OMAP4430_REV_ES2_1;
break;
case 4:
default:
omap_revision = OMAP4430_REV_ES2_2;
break;
case 6:
default:
omap_revision = OMAP4430_REV_ES2_3;
}
break;
case 0xb94e:
Expand All @@ -401,9 +427,17 @@ static void __init omap4_check_revision(void)
break;
}
break;
case 0xb975:
switch (rev) {
case 0:
default:
omap_revision = OMAP4470_REV_ES1_0;
break;
}
break;
default:
/* Unknown default to latest silicon rev as default */
omap_revision = OMAP4430_REV_ES2_2;
omap_revision = OMAP4430_REV_ES2_3;
}

pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
Expand Down Expand Up @@ -432,6 +466,10 @@ static void __init omap3_cpuinfo(const char *cpu_rev)
cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
} else if (cpu_is_ti816x()) {
cpu_name = "TI816X";
} else if (cpu_is_am335x()) {
cpu_name = "AM335X";
} else if (cpu_is_ti814x()) {
cpu_name = "TI814X";
} else if (omap3_has_iva() && omap3_has_sgx()) {
/* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
cpu_name = "OMAP3430/3530";
Expand Down Expand Up @@ -472,11 +510,11 @@ void __init omap2_check_revision(void)
} else if (cpu_is_omap34xx()) {
omap3_check_revision(&cpu_rev);

/* TI816X doesn't have feature register */
if (!cpu_is_ti816x())
/* TI81XX doesn't have feature register */
if (!cpu_is_ti81xx())
omap3_check_features();
else
ti816x_check_features();
ti81xx_check_features();

omap3_cpuinfo(cpu_rev);
return;
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mach-omap2/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ omap_uart_lsr: .word 0
beq 34f @ configure OMAP3UART4
cmp \rp, #OMAP4UART4 @ only on 44xx
beq 44f @ configure OMAP4UART4
cmp \rp, #TI816XUART1 @ ti816x UART offsets different
cmp \rp, #TI81XXUART1 @ ti81Xx UART offsets different
beq 81f @ configure UART1
cmp \rp, #TI816XUART2 @ ti816x UART offsets different
cmp \rp, #TI81XXUART2 @ ti81Xx UART offsets different
beq 82f @ configure UART2
cmp \rp, #TI816XUART3 @ ti816x UART offsets different
cmp \rp, #TI81XXUART3 @ ti81Xx UART offsets different
beq 83f @ configure UART3
cmp \rp, #ZOOM_UART @ only on zoom2/3
beq 95f @ configure ZOOM_UART
Expand All @@ -94,11 +94,11 @@ omap_uart_lsr: .word 0
b 98f
44: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
b 98f
81: mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
81: mov \rp, #UART_OFFSET(TI81XX_UART1_BASE)
b 98f
82: mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
82: mov \rp, #UART_OFFSET(TI81XX_UART2_BASE)
b 98f
83: mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
83: mov \rp, #UART_OFFSET(TI81XX_UART3_BASE)
b 98f

95: ldr \rp, =ZOOM_UART_BASE
Expand Down
Loading

0 comments on commit c971363

Please sign in to comment.