diff options
Diffstat (limited to 'arch/arm')
56 files changed, 2392 insertions, 250 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e39caa8b0c9..9e10882c81d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -43,10 +43,6 @@ config SYS_SUPPORTS_APM_EMULATION  config GENERIC_GPIO  	bool -config GENERIC_TIME -	bool -	default y -  config ARCH_USES_GETTIMEOFFSET  	bool  	default n diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h index 67af4b84198..08265993227 100644 --- a/arch/arm/include/asm/kgdb.h +++ b/arch/arm/include/asm/kgdb.h @@ -70,11 +70,11 @@ extern int kgdb_fault_expected;  #define _GP_REGS		16  #define _FP_REGS		8  #define _EXTRA_REGS		2 -#define GDB_MAX_REGS		(_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS) +#define DBG_MAX_REG_NUM		(_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)  #define KGDB_MAX_NO_CPUS	1  #define BUFMAX			400 -#define NUMREGBYTES		(GDB_MAX_REGS << 2) +#define NUMREGBYTES		(DBG_MAX_REG_NUM << 2)  #define NUMCRITREGBYTES		(32 << 2)  #define _R0			0 @@ -93,7 +93,7 @@ extern int kgdb_fault_expected;  #define _SPT			13  #define _LR			14  #define _PC			15 -#define _CPSR			(GDB_MAX_REGS - 1) +#define _CPSR			(DBG_MAX_REG_NUM - 1)  /*   * So that we can denote the end of a frame for tracing, diff --git a/arch/arm/include/asm/local64.h b/arch/arm/include/asm/local64.h new file mode 100644 index 00000000000..36c93b5cc23 --- /dev/null +++ b/arch/arm/include/asm/local64.h @@ -0,0 +1 @@ +#include <asm-generic/local64.h> diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c index c868a886411..778c2f7024f 100644 --- a/arch/arm/kernel/kgdb.c +++ b/arch/arm/kernel/kgdb.c @@ -10,57 +10,62 @@   *           Deepak Saxena <dsaxena@plexity.net>   */  #include <linux/irq.h> +#include <linux/kdebug.h>  #include <linux/kgdb.h>  #include <asm/traps.h> -/* Make a local copy of the registers passed into the handler (bletch) */ -void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *kernel_regs) +struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] =  { -	int regno; +	{ "r0", 4, offsetof(struct pt_regs, ARM_r0)}, +	{ "r1", 4, offsetof(struct pt_regs, ARM_r1)}, +	{ "r2", 4, offsetof(struct pt_regs, ARM_r2)}, +	{ "r3", 4, offsetof(struct pt_regs, ARM_r3)}, +	{ "r4", 4, offsetof(struct pt_regs, ARM_r4)}, +	{ "r5", 4, offsetof(struct pt_regs, ARM_r5)}, +	{ "r6", 4, offsetof(struct pt_regs, ARM_r6)}, +	{ "r7", 4, offsetof(struct pt_regs, ARM_r7)}, +	{ "r8", 4, offsetof(struct pt_regs, ARM_r8)}, +	{ "r9", 4, offsetof(struct pt_regs, ARM_r9)}, +	{ "r10", 4, offsetof(struct pt_regs, ARM_r10)}, +	{ "fp", 4, offsetof(struct pt_regs, ARM_fp)}, +	{ "ip", 4, offsetof(struct pt_regs, ARM_ip)}, +	{ "sp", 4, offsetof(struct pt_regs, ARM_sp)}, +	{ "lr", 4, offsetof(struct pt_regs, ARM_lr)}, +	{ "pc", 4, offsetof(struct pt_regs, ARM_pc)}, +	{ "f0", 12, -1 }, +	{ "f1", 12, -1 }, +	{ "f2", 12, -1 }, +	{ "f3", 12, -1 }, +	{ "f4", 12, -1 }, +	{ "f5", 12, -1 }, +	{ "f6", 12, -1 }, +	{ "f7", 12, -1 }, +	{ "fps", 4, -1 }, +	{ "cpsr", 4, offsetof(struct pt_regs, ARM_cpsr)}, +}; -	/* Initialize all to zero. */ -	for (regno = 0; regno < GDB_MAX_REGS; regno++) -		gdb_regs[regno] = 0; +char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) +{ +	if (regno >= DBG_MAX_REG_NUM || regno < 0) +		return NULL; -	gdb_regs[_R0]		= kernel_regs->ARM_r0; -	gdb_regs[_R1]		= kernel_regs->ARM_r1; -	gdb_regs[_R2]		= kernel_regs->ARM_r2; -	gdb_regs[_R3]		= kernel_regs->ARM_r3; -	gdb_regs[_R4]		= kernel_regs->ARM_r4; -	gdb_regs[_R5]		= kernel_regs->ARM_r5; -	gdb_regs[_R6]		= kernel_regs->ARM_r6; -	gdb_regs[_R7]		= kernel_regs->ARM_r7; -	gdb_regs[_R8]		= kernel_regs->ARM_r8; -	gdb_regs[_R9]		= kernel_regs->ARM_r9; -	gdb_regs[_R10]		= kernel_regs->ARM_r10; -	gdb_regs[_FP]		= kernel_regs->ARM_fp; -	gdb_regs[_IP]		= kernel_regs->ARM_ip; -	gdb_regs[_SPT]		= kernel_regs->ARM_sp; -	gdb_regs[_LR]		= kernel_regs->ARM_lr; -	gdb_regs[_PC]		= kernel_regs->ARM_pc; -	gdb_regs[_CPSR]		= kernel_regs->ARM_cpsr; +	if (dbg_reg_def[regno].offset != -1) +		memcpy(mem, (void *)regs + dbg_reg_def[regno].offset, +		       dbg_reg_def[regno].size); +	else +		memset(mem, 0, dbg_reg_def[regno].size); +	return dbg_reg_def[regno].name;  } -/* Copy local gdb registers back to kgdb regs, for later copy to kernel */ -void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *kernel_regs) +int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)  { -	kernel_regs->ARM_r0	= gdb_regs[_R0]; -	kernel_regs->ARM_r1	= gdb_regs[_R1]; -	kernel_regs->ARM_r2	= gdb_regs[_R2]; -	kernel_regs->ARM_r3	= gdb_regs[_R3]; -	kernel_regs->ARM_r4	= gdb_regs[_R4]; -	kernel_regs->ARM_r5	= gdb_regs[_R5]; -	kernel_regs->ARM_r6	= gdb_regs[_R6]; -	kernel_regs->ARM_r7	= gdb_regs[_R7]; -	kernel_regs->ARM_r8	= gdb_regs[_R8]; -	kernel_regs->ARM_r9	= gdb_regs[_R9]; -	kernel_regs->ARM_r10	= gdb_regs[_R10]; -	kernel_regs->ARM_fp	= gdb_regs[_FP]; -	kernel_regs->ARM_ip	= gdb_regs[_IP]; -	kernel_regs->ARM_sp	= gdb_regs[_SPT]; -	kernel_regs->ARM_lr	= gdb_regs[_LR]; -	kernel_regs->ARM_pc	= gdb_regs[_PC]; -	kernel_regs->ARM_cpsr	= gdb_regs[_CPSR]; +	if (regno >= DBG_MAX_REG_NUM || regno < 0) +		return -EINVAL; + +	if (dbg_reg_def[regno].offset != -1) +		memcpy((void *)regs + dbg_reg_def[regno].offset, mem, +		       dbg_reg_def[regno].size); +	return 0;  }  void @@ -176,6 +181,33 @@ void kgdb_roundup_cpus(unsigned long flags)         local_irq_disable();  } +static int __kgdb_notify(struct die_args *args, unsigned long cmd) +{ +	struct pt_regs *regs = args->regs; + +	if (kgdb_handle_exception(1, args->signr, cmd, regs)) +		return NOTIFY_DONE; +	return NOTIFY_STOP; +} +static int +kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr) +{ +	unsigned long flags; +	int ret; + +	local_irq_save(flags); +	ret = __kgdb_notify(ptr, cmd); +	local_irq_restore(flags); + +	return ret; +} + +static struct notifier_block kgdb_notifier = { +	.notifier_call	= kgdb_notify, +	.priority	= -INT_MAX, +}; + +  /**   *	kgdb_arch_init - Perform any architecture specific initalization.   * @@ -184,6 +216,11 @@ void kgdb_roundup_cpus(unsigned long flags)   */  int kgdb_arch_init(void)  { +	int ret = register_die_notifier(&kgdb_notifier); + +	if (ret != 0) +		return ret; +  	register_undef_hook(&kgdb_brkpt_hook);  	register_undef_hook(&kgdb_compiled_brkpt_hook); @@ -200,6 +237,7 @@ void kgdb_arch_exit(void)  {  	unregister_undef_hook(&kgdb_brkpt_hook);  	unregister_undef_hook(&kgdb_compiled_brkpt_hook); +	unregister_die_notifier(&kgdb_notifier);  }  /* diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index de12536d687..417c392ddf1 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c @@ -164,20 +164,20 @@ armpmu_event_set_period(struct perf_event *event,  			struct hw_perf_event *hwc,  			int idx)  { -	s64 left = atomic64_read(&hwc->period_left); +	s64 left = local64_read(&hwc->period_left);  	s64 period = hwc->sample_period;  	int ret = 0;  	if (unlikely(left <= -period)) {  		left = period; -		atomic64_set(&hwc->period_left, left); +		local64_set(&hwc->period_left, left);  		hwc->last_period = period;  		ret = 1;  	}  	if (unlikely(left <= 0)) {  		left += period; -		atomic64_set(&hwc->period_left, left); +		local64_set(&hwc->period_left, left);  		hwc->last_period = period;  		ret = 1;  	} @@ -185,7 +185,7 @@ armpmu_event_set_period(struct perf_event *event,  	if (left > (s64)armpmu->max_period)  		left = armpmu->max_period; -	atomic64_set(&hwc->prev_count, (u64)-left); +	local64_set(&hwc->prev_count, (u64)-left);  	armpmu->write_counter(idx, (u64)(-left) & 0xffffffff); @@ -204,18 +204,18 @@ armpmu_event_update(struct perf_event *event,  	u64 delta;  again: -	prev_raw_count = atomic64_read(&hwc->prev_count); +	prev_raw_count = local64_read(&hwc->prev_count);  	new_raw_count = armpmu->read_counter(idx); -	if (atomic64_cmpxchg(&hwc->prev_count, prev_raw_count, +	if (local64_cmpxchg(&hwc->prev_count, prev_raw_count,  			     new_raw_count) != prev_raw_count)  		goto again;  	delta = (new_raw_count << shift) - (prev_raw_count << shift);  	delta >>= shift; -	atomic64_add(delta, &event->count); -	atomic64_sub(delta, &hwc->period_left); +	local64_add(delta, &event->count); +	local64_sub(delta, &hwc->period_left);  	return new_raw_count;  } @@ -478,7 +478,7 @@ __hw_perf_event_init(struct perf_event *event)  	if (!hwc->sample_period) {  		hwc->sample_period  = armpmu->max_period;  		hwc->last_period    = hwc->sample_period; -		atomic64_set(&hwc->period_left, hwc->sample_period); +		local64_set(&hwc->period_left, hwc->sample_period);  	}  	err = 0; diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index 0316e201ada..71f90f86474 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig @@ -50,6 +50,11 @@ config ARCH_DAVINCI_DM365  	select AINTC  	select ARCH_DAVINCI_DMx +config ARCH_DAVINCI_TNETV107X +	select CPU_V6 +	select CP_INTC +	bool "TNETV107X based system" +  comment "DaVinci Board Type"  config MACH_DAVINCI_EVM @@ -173,6 +178,13 @@ config DA850_UI_RMII  endchoice +config MACH_TNETV107X +	bool "TI TNETV107X Reference Platform" +	default ARCH_DAVINCI_TNETV107X +	depends on ARCH_DAVINCI_TNETV107X +	help +	  Say Y here to select the TI TNETV107X Evaluation Module. +  config DAVINCI_MUX  	bool "DAVINCI multiplexing support"  	depends on ARCH_DAVINCI diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 6aac880eb79..eab4c0fd667 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -16,6 +16,8 @@ obj-$(CONFIG_ARCH_DAVINCI_DM646x)       += dm646x.o devices.o  obj-$(CONFIG_ARCH_DAVINCI_DM365)	+= dm365.o devices.o  obj-$(CONFIG_ARCH_DAVINCI_DA830)        += da830.o devices-da8xx.o  obj-$(CONFIG_ARCH_DAVINCI_DA850)        += da850.o devices-da8xx.o +obj-$(CONFIG_ARCH_DAVINCI_TNETV107X)    += tnetv107x.o devices-tnetv107x.o +obj-$(CONFIG_ARCH_DAVINCI_TNETV107X)    += gpio-tnetv107x.o  obj-$(CONFIG_AINTC)			+= irq.o  obj-$(CONFIG_CP_INTC)			+= cp_intc.o @@ -30,6 +32,7 @@ obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM)	+= board-dm646x-evm.o cdce949.o  obj-$(CONFIG_MACH_DAVINCI_DM365_EVM)	+= board-dm365-evm.o  obj-$(CONFIG_MACH_DAVINCI_DA830_EVM)	+= board-da830-evm.o  obj-$(CONFIG_MACH_DAVINCI_DA850_EVM)	+= board-da850-evm.o +obj-$(CONFIG_MACH_TNETV107X)		+= board-tnetv107x-evm.o  # Power Management  obj-$(CONFIG_CPU_FREQ)			+= cpufreq.o diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 212d97084bd..c3994f341e4 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -208,7 +208,7 @@ static struct snd_platform_data da830_evm_snd_data = {  	.num_serializer = ARRAY_SIZE(da830_iis_serializer_direction),  	.tdm_slots      = 2,  	.serial_dir     = da830_iis_serializer_direction, -	.eventq_no      = EVENTQ_0, +	.asp_chan_q     = EVENTQ_0,  	.version	= MCASP_VERSION_2,  	.txnumevt	= 1,  	.rxnumevt	= 1, @@ -494,12 +494,42 @@ static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = {  	.bus_delay	= 0,	/* usec */  }; +/* + * The following EDMA channels/slots are not being used by drivers (for + * example: Timer, GPIO, UART events etc) on da830/omap-l137 EVM, hence + * they are being reserved for codecs on the DSP side. + */ +static const s16 da830_dma_rsv_chans[][2] = { +	/* (offset, number) */ +	{ 8,  2}, +	{12,  2}, +	{24,  4}, +	{30,  2}, +	{-1, -1} +}; + +static const s16 da830_dma_rsv_slots[][2] = { +	/* (offset, number) */ +	{ 8,  2}, +	{12,  2}, +	{24,  4}, +	{30, 26}, +	{-1, -1} +}; + +static struct edma_rsv_info da830_edma_rsv[] = { +	{ +		.rsv_chans	= da830_dma_rsv_chans, +		.rsv_slots	= da830_dma_rsv_slots, +	}, +}; +  static __init void da830_evm_init(void)  {  	struct davinci_soc_info *soc_info = &davinci_soc_info;  	int ret; -	ret = da8xx_register_edma(); +	ret = da830_register_edma(da830_edma_rsv);  	if (ret)  		pr_warning("da830_evm_init: edma registration failed: %d\n",  				ret); diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b280efb1fa1..fdc2cc500fc 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -343,7 +343,7 @@ static struct snd_platform_data da850_evm_snd_data = {  	.num_serializer	= ARRAY_SIZE(da850_iis_serializer_direction),  	.tdm_slots	= 2,  	.serial_dir	= da850_iis_serializer_direction, -	.eventq_no	= EVENTQ_1, +	.asp_chan_q	= EVENTQ_1,  	.version	= MCASP_VERSION_2,  	.txnumevt	= 1,  	.rxnumevt	= 1, @@ -637,6 +637,56 @@ static int __init da850_evm_config_emac(void)  }  device_initcall(da850_evm_config_emac); +/* + * The following EDMA channels/slots are not being used by drivers (for + * example: Timer, GPIO, UART events etc) on da850/omap-l138 EVM, hence + * they are being reserved for codecs on the DSP side. + */ +static const s16 da850_dma0_rsv_chans[][2] = { +	/* (offset, number) */ +	{ 8,  6}, +	{24,  4}, +	{30,  2}, +	{-1, -1} +}; + +static const s16 da850_dma0_rsv_slots[][2] = { +	/* (offset, number) */ +	{ 8,  6}, +	{24,  4}, +	{30, 50}, +	{-1, -1} +}; + +static const s16 da850_dma1_rsv_chans[][2] = { +	/* (offset, number) */ +	{ 0, 28}, +	{30,  2}, +	{-1, -1} +}; + +static const s16 da850_dma1_rsv_slots[][2] = { +	/* (offset, number) */ +	{ 0, 28}, +	{30, 90}, +	{-1, -1} +}; + +static struct edma_rsv_info da850_edma_cc0_rsv = { +	.rsv_chans	= da850_dma0_rsv_chans, +	.rsv_slots	= da850_dma0_rsv_slots, +}; + +static struct edma_rsv_info da850_edma_cc1_rsv = { +	.rsv_chans	= da850_dma1_rsv_chans, +	.rsv_slots	= da850_dma1_rsv_slots, +}; + +static struct edma_rsv_info *da850_edma_rsv[2] = { +	&da850_edma_cc0_rsv, +	&da850_edma_cc1_rsv, +}; +  static __init void da850_evm_init(void)  {  	int ret; @@ -646,7 +696,7 @@ static __init void da850_evm_init(void)  		pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n",  				ret); -	ret = da8xx_register_edma(); +	ret = da850_register_edma(da850_edma_rsv);  	if (ret)  		pr_warning("da850_evm_init: edma registration failed: %d\n",  				ret); diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 6d8889342c9..4502f346b2b 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -323,7 +323,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = {  		.num_serializer = ARRAY_SIZE(dm646x_iis_serializer_direction),  		.tdm_slots      = 2,  		.serial_dir     = dm646x_iis_serializer_direction, -		.eventq_no      = EVENTQ_0, +		.asp_chan_q     = EVENTQ_0,  	},  	{  		.tx_dma_offset  = 0x400, @@ -332,7 +332,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = {  		.num_serializer = ARRAY_SIZE(dm646x_dit_serializer_direction),  		.tdm_slots      = 32,  		.serial_dir     = dm646x_dit_serializer_direction, -		.eventq_no      = EVENTQ_0, +		.asp_chan_q     = EVENTQ_0,  	},  }; @@ -721,6 +721,39 @@ static struct davinci_uart_config uart_config __initdata = {  #define DM646X_EVM_PHY_MASK		(0x2)  #define DM646X_EVM_MDIO_FREQUENCY	(2200000) /* PHY bus frequency */ +/* + * The following EDMA channels/slots are not being used by drivers (for + * example: Timer, GPIO, UART events etc) on dm646x, hence they are being + * reserved for codecs on the DSP side. + */ +static const s16 dm646x_dma_rsv_chans[][2] = { +	/* (offset, number) */ +	{ 0,  4}, +	{13,  3}, +	{24,  4}, +	{30,  2}, +	{54,  3}, +	{-1, -1} +}; + +static const s16 dm646x_dma_rsv_slots[][2] = { +	/* (offset, number) */ +	{ 0,  4}, +	{13,  3}, +	{24,  4}, +	{30,  2}, +	{54,  3}, +	{128, 384}, +	{-1, -1} +}; + +static struct edma_rsv_info dm646x_edma_rsv[] = { +	{ +		.rsv_chans	= dm646x_dma_rsv_chans, +		.rsv_slots	= dm646x_dma_rsv_slots, +	}, +}; +  static __init void evm_init(void)  {  	struct davinci_soc_info *soc_info = &davinci_soc_info; @@ -732,6 +765,8 @@ static __init void evm_init(void)  	platform_device_register(&davinci_nand_device); +	dm646x_init_edma(dm646x_edma_rsv); +  	if (HAS_ATA)  		davinci_init_ide(); diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c new file mode 100644 index 00000000000..fe2a9d9c8bb --- /dev/null +++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c @@ -0,0 +1,174 @@ +/* + * Texas Instruments TNETV107X EVM Board Support + * + * Copyright (C) 2010 Texas Instruments + * + * 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 version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + */ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/console.h> +#include <linux/dma-mapping.h> +#include <linux/interrupt.h> +#include <linux/gpio.h> +#include <linux/delay.h> +#include <linux/platform_device.h> +#include <linux/ratelimit.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <asm/mach/arch.h> +#include <asm/mach-types.h> + +#include <mach/irqs.h> +#include <mach/edma.h> +#include <mach/mux.h> +#include <mach/cp_intc.h> +#include <mach/tnetv107x.h> + +#define EVM_MMC_WP_GPIO		21 +#define EVM_MMC_CD_GPIO		24 + +static int initialize_gpio(int gpio, char *desc) +{ +	int ret; + +	ret = gpio_request(gpio, desc); +	if (ret < 0) { +		pr_err_ratelimited("cannot open %s gpio\n", desc); +		return -ENOSYS; +	} +	gpio_direction_input(gpio); +	return gpio; +} + +static int mmc_get_cd(int index) +{ +	static int gpio; + +	if (!gpio) +		gpio = initialize_gpio(EVM_MMC_CD_GPIO, "mmc card detect"); + +	if (gpio < 0) +		return gpio; + +	return gpio_get_value(gpio) ? 0 : 1; +} + +static int mmc_get_ro(int index) +{ +	static int gpio; + +	if (!gpio) +		gpio = initialize_gpio(EVM_MMC_WP_GPIO, "mmc write protect"); + +	if (gpio < 0) +		return gpio; + +	return gpio_get_value(gpio) ? 1 : 0; +} + +static struct davinci_mmc_config mmc_config = { +	.get_cd		= mmc_get_cd, +	.get_ro		= mmc_get_ro, +	.wires		= 4, +	.max_freq	= 50000000, +	.caps		= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, +	.version	= MMC_CTLR_VERSION_1, +}; + +static const short sdio1_pins[] __initdata = { +	TNETV107X_SDIO1_CLK_1,		TNETV107X_SDIO1_CMD_1, +	TNETV107X_SDIO1_DATA0_1,	TNETV107X_SDIO1_DATA1_1, +	TNETV107X_SDIO1_DATA2_1,	TNETV107X_SDIO1_DATA3_1, +	TNETV107X_GPIO21,		TNETV107X_GPIO24, +	-1 +}; + +static const short uart1_pins[] __initdata = { +	TNETV107X_UART1_RD,		TNETV107X_UART1_TD, +	-1 +}; + +static struct mtd_partition nand_partitions[] = { +	/* bootloader (U-Boot, etc) in first 12 sectors */ +	{ +		.name		= "bootloader", +		.offset		= 0, +		.size		= (12*SZ_128K), +		.mask_flags	= MTD_WRITEABLE,	/* force read-only */ +	}, +	/* bootloader params in the next sector */ +	{ +		.name		= "params", +		.offset		= MTDPART_OFS_NXTBLK, +		.size		= SZ_128K, +		.mask_flags	= MTD_WRITEABLE,	/* force read-only */ +	}, +	/* kernel */ +	{ +		.name		= "kernel", +		.offset		= MTDPART_OFS_NXTBLK, +		.size		= SZ_4M, +		.mask_flags	= 0, +	}, +	/* file system */ +	{ +		.name		= "filesystem", +		.offset		= MTDPART_OFS_NXTBLK, +		.size		= MTDPART_SIZ_FULL, +		.mask_flags	= 0, +	} +}; + +static struct davinci_nand_pdata nand_config = { +	.mask_cle	= 0x4000, +	.mask_ale	= 0x2000, +	.parts		= nand_partitions, +	.nr_parts	= ARRAY_SIZE(nand_partitions), +	.ecc_mode	= NAND_ECC_HW, +	.options	= NAND_USE_FLASH_BBT, +	.ecc_bits	= 1, +}; + +static struct davinci_uart_config serial_config __initconst = { +	.enabled_uarts	= BIT(1), +}; + +static struct tnetv107x_device_info evm_device_info __initconst = { +	.serial_config		= &serial_config, +	.mmc_config[1]		= &mmc_config,	/* controller 1 */ +	.nand_config[0]		= &nand_config,	/* chip select 0 */ +}; + +static __init void tnetv107x_evm_board_init(void) +{ +	davinci_cfg_reg_list(sdio1_pins); +	davinci_cfg_reg_list(uart1_pins); + +	tnetv107x_devices_init(&evm_device_info); +} + +#ifdef CONFIG_SERIAL_8250_CONSOLE +static int __init tnetv107x_evm_console_init(void) +{ +	return add_preferred_console("ttyS", 0, "115200"); +} +console_initcall(tnetv107x_evm_console_init); +#endif + +MACHINE_START(TNETV107X, "TNETV107X EVM") +	.phys_io	= TNETV107X_IO_BASE, +	.io_pg_offst	= (TNETV107X_IO_VIRT >> 18) & 0xfffc, +	.boot_params	= (TNETV107X_DDR_BASE + 0x100), +	.map_io		= tnetv107x_init, +	.init_irq	= cp_intc_init, +	.timer		= &davinci_timer, +	.init_machine	= tnetv107x_evm_board_init, +MACHINE_END diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 23e9eda5a37..ec23ab47362 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -1024,7 +1024,6 @@ static u8 da830_default_priorities[DA830_N_CP_INTC_IRQ] = {  	[IRQ_DA8XX_EVTOUT4]		= 7,  	[IRQ_DA8XX_EVTOUT5]		= 7,  	[IRQ_DA8XX_EVTOUT6]		= 7, -	[IRQ_DA8XX_EVTOUT6]		= 7,  	[IRQ_DA8XX_EVTOUT7]		= 7,  	[IRQ_DA8XX_CCINT0]		= 7,  	[IRQ_DA8XX_CCERRINT]		= 7, @@ -1042,11 +1041,7 @@ static u8 da830_default_priorities[DA830_N_CP_INTC_IRQ] = {  	[IRQ_DA8XX_TINT34_1]		= 7,  	[IRQ_DA8XX_UARTINT0]		= 7,  	[IRQ_DA8XX_KEYMGRINT]		= 7, -	[IRQ_DA8XX_SECINT]		= 7, -	[IRQ_DA8XX_SECKEYERR]		= 7,  	[IRQ_DA830_MPUERR]		= 7, -	[IRQ_DA830_IOPUERR]		= 7, -	[IRQ_DA830_BOOTCFGERR]		= 7,  	[IRQ_DA8XX_CHIPINT0]		= 7,  	[IRQ_DA8XX_CHIPINT1]		= 7,  	[IRQ_DA8XX_CHIPINT2]		= 7, diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 6b8331bf8cf..68ed58a4825 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -643,7 +643,6 @@ static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {  	[IRQ_DA8XX_EVTOUT4]		= 7,  	[IRQ_DA8XX_EVTOUT5]		= 7,  	[IRQ_DA8XX_EVTOUT6]		= 7, -	[IRQ_DA8XX_EVTOUT6]		= 7,  	[IRQ_DA8XX_EVTOUT7]		= 7,  	[IRQ_DA8XX_CCINT0]		= 7,  	[IRQ_DA8XX_CCERRINT]		= 7, @@ -661,27 +660,7 @@ static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {  	[IRQ_DA8XX_TINT34_1]		= 7,  	[IRQ_DA8XX_UARTINT0]		= 7,  	[IRQ_DA8XX_KEYMGRINT]		= 7, -	[IRQ_DA8XX_SECINT]		= 7, -	[IRQ_DA8XX_SECKEYERR]		= 7,  	[IRQ_DA850_MPUADDRERR0]		= 7, -	[IRQ_DA850_MPUPROTERR0]		= 7, -	[IRQ_DA850_IOPUADDRERR0]	= 7, -	[IRQ_DA850_IOPUPROTERR0]	= 7, -	[IRQ_DA850_IOPUADDRERR1]	= 7, -	[IRQ_DA850_IOPUPROTERR1]	= 7, -	[IRQ_DA850_IOPUADDRERR2]	= 7, -	[IRQ_DA850_IOPUPROTERR2]	= 7, -	[IRQ_DA850_BOOTCFG_ADDR_ERR]	= 7, -	[IRQ_DA850_BOOTCFG_PROT_ERR]	= 7, -	[IRQ_DA850_MPUADDRERR1]		= 7, -	[IRQ_DA850_MPUPROTERR1]		= 7, -	[IRQ_DA850_IOPUADDRERR3]	= 7, -	[IRQ_DA850_IOPUPROTERR3]	= 7, -	[IRQ_DA850_IOPUADDRERR4]	= 7, -	[IRQ_DA850_IOPUPROTERR4]	= 7, -	[IRQ_DA850_IOPUADDRERR5]	= 7, -	[IRQ_DA850_IOPUPROTERR5]	= 7, -	[IRQ_DA850_MIOPU_BOOTCFG_ERR]	= 7,  	[IRQ_DA8XX_CHIPINT0]		= 7,  	[IRQ_DA8XX_CHIPINT1]		= 7,  	[IRQ_DA8XX_CHIPINT2]		= 7, @@ -722,8 +701,6 @@ static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {  	[IRQ_DA8XX_EHRPWM1]		= 7,  	[IRQ_DA8XX_EHRPWM1TZ]		= 7,  	[IRQ_DA850_SATAINT]		= 7, -	[IRQ_DA850_TINT12_2]		= 7, -	[IRQ_DA850_TINT34_2]		= 7,  	[IRQ_DA850_TINTALL_2]		= 7,  	[IRQ_DA8XX_ECAP0]		= 7,  	[IRQ_DA8XX_ECAP1]		= 7, @@ -751,8 +728,6 @@ static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {  	[IRQ_DA850_CCINT1]		= 7,  	[IRQ_DA850_CCERRINT1]		= 7,  	[IRQ_DA850_TCERRINT2]		= 7, -	[IRQ_DA850_TINT12_3]		= 7, -	[IRQ_DA850_TINT34_3]		= 7,  	[IRQ_DA850_TINTALL_3]		= 7,  	[IRQ_DA850_MCBSP0RINT]		= 7,  	[IRQ_DA850_MCBSP0XINT]		= 7, diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 8cda729be27..52bc7b1c6ca 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -111,19 +111,21 @@ static const s8 da850_queue_priority_mapping[][2] = {  	{-1, -1}  }; -static struct edma_soc_info da830_edma_info[] = { -	{ -		.n_channel		= 32, -		.n_region		= 4, -		.n_slot			= 128, -		.n_tc			= 2, -		.n_cc			= 1, -		.queue_tc_mapping	= da8xx_queue_tc_mapping, -		.queue_priority_mapping	= da8xx_queue_priority_mapping, -	}, +static struct edma_soc_info da830_edma_cc0_info = { +	.n_channel		= 32, +	.n_region		= 4, +	.n_slot			= 128, +	.n_tc			= 2, +	.n_cc			= 1, +	.queue_tc_mapping	= da8xx_queue_tc_mapping, +	.queue_priority_mapping	= da8xx_queue_priority_mapping, +}; + +static struct edma_soc_info *da830_edma_info[EDMA_MAX_CC] = { +	&da830_edma_cc0_info,  }; -static struct edma_soc_info da850_edma_info[] = { +static struct edma_soc_info da850_edma_cc_info[] = {  	{  		.n_channel		= 32,  		.n_region		= 4, @@ -144,6 +146,11 @@ static struct edma_soc_info da850_edma_info[] = {  	},  }; +static struct edma_soc_info *da850_edma_info[EDMA_MAX_CC] = { +	&da850_edma_cc_info[0], +	&da850_edma_cc_info[1], +}; +  static struct resource da830_edma_resources[] = {  	{  		.name	= "edma_cc0", @@ -248,18 +255,21 @@ static struct platform_device da850_edma_device = {  	.resource	= da850_edma_resources,  }; -int __init da8xx_register_edma(void) +int __init da830_register_edma(struct edma_rsv_info *rsv)  { -	struct platform_device *pdev; +	da830_edma_cc0_info.rsv = rsv; -	if (cpu_is_davinci_da830()) -		pdev = &da830_edma_device; -	else if (cpu_is_davinci_da850()) -		pdev = &da850_edma_device; -	else -		return -ENODEV; +	return platform_device_register(&da830_edma_device); +} -	return platform_device_register(pdev); +int __init da850_register_edma(struct edma_rsv_info *rsv[2]) +{ +	if (rsv) { +		da850_edma_cc_info[0].rsv = rsv[0]; +		da850_edma_cc_info[1].rsv = rsv[1]; +	} + +	return platform_device_register(&da850_edma_device);  }  static struct resource da8xx_i2c_resources0[] = { diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c new file mode 100644 index 00000000000..2718a3a90df --- /dev/null +++ b/arch/arm/mach-davinci/devices-tnetv107x.c @@ -0,0 +1,320 @@ +/* + * Texas Instruments TNETV107X SoC devices + * + * Copyright (C) 2010 Texas Instruments + * + * 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 version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + */ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/dma-mapping.h> +#include <linux/clk.h> +#include <linux/slab.h> + +#include <mach/common.h> +#include <mach/irqs.h> +#include <mach/edma.h> +#include <mach/tnetv107x.h> + +#include "clock.h" + +/* Base addresses for on-chip devices */ +#define TNETV107X_TPCC_BASE			0x01c00000 +#define TNETV107X_TPTC0_BASE			0x01c10000 +#define TNETV107X_TPTC1_BASE			0x01c10400 +#define TNETV107X_WDOG_BASE			0x08086700 +#define TNETV107X_SDIO0_BASE			0x08088700 +#define TNETV107X_SDIO1_BASE			0x08088800 +#define TNETV107X_ASYNC_EMIF_CNTRL_BASE		0x08200000 +#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE	0x30000000 +#define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE	0x40000000 +#define TNETV107X_ASYNC_EMIF_DATA_CE2_BASE	0x44000000 +#define TNETV107X_ASYNC_EMIF_DATA_CE3_BASE	0x48000000 + +/* TNETV107X specific EDMA3 information */ +#define EDMA_TNETV107X_NUM_DMACH	64 +#define EDMA_TNETV107X_NUM_TCC		64 +#define EDMA_TNETV107X_NUM_PARAMENTRY	128 +#define EDMA_TNETV107X_NUM_EVQUE	2 +#define EDMA_TNETV107X_NUM_TC		2 +#define EDMA_TNETV107X_CHMAP_EXIST	0 +#define EDMA_TNETV107X_NUM_REGIONS	4 +#define TNETV107X_DMACH2EVENT_MAP0	0x3C0CE000u +#define TNETV107X_DMACH2EVENT_MAP1	0x000FFFFFu + +#define TNETV107X_DMACH_SDIO0_RX		26 +#define TNETV107X_DMACH_SDIO0_TX		27 +#define TNETV107X_DMACH_SDIO1_RX		28 +#define TNETV107X_DMACH_SDIO1_TX		29 + +static const s8 edma_tc_mapping[][2] = { +	/* event queue no	TC no	*/ +	{	 0,		 0	}, +	{	 1,		 1	}, +	{	-1,		-1	} +}; + +static const s8 edma_priority_mapping[][2] = { +	/* event queue no	Prio	*/ +	{	 0,		 3	}, +	{	 1,		 7	}, +	{	-1,		-1	} +}; + +static struct edma_soc_info edma_cc0_info = { +	.n_channel		= EDMA_TNETV107X_NUM_DMACH, +	.n_region		= EDMA_TNETV107X_NUM_REGIONS, +	.n_slot			= EDMA_TNETV107X_NUM_PARAMENTRY, +	.n_tc			= EDMA_TNETV107X_NUM_TC, +	.n_cc			= 1, +	.queue_tc_mapping	= edma_tc_mapping, +	.queue_priority_mapping	= edma_priority_mapping, +}; + +static struct edma_soc_info *tnetv107x_edma_info[EDMA_MAX_CC] = { +	&edma_cc0_info, +}; + +static struct resource edma_resources[] = { +	{ +		.name	= "edma_cc0", +		.start	= TNETV107X_TPCC_BASE, +		.end	= TNETV107X_TPCC_BASE + SZ_32K - 1, +		.flags	= IORESOURCE_MEM, +	}, +	{ +		.name	= "edma_tc0", +		.start	= TNETV107X_TPTC0_BASE, +		.end	= TNETV107X_TPTC0_BASE + SZ_1K - 1, +		.flags	= IORESOURCE_MEM, +	}, +	{ +		.name	= "edma_tc1", +		.start	= TNETV107X_TPTC1_BASE, +		.end	= TNETV107X_TPTC1_BASE + SZ_1K - 1, +		.flags	= IORESOURCE_MEM, +	}, +	{ +		.name	= "edma0", +		.start	= IRQ_TNETV107X_TPCC, +		.flags	= IORESOURCE_IRQ, +	}, +	{ +		.name	= "edma0_err", +		.start	= IRQ_TNETV107X_TPCC_ERR, +		.flags	= IORESOURCE_IRQ, +	}, +}; + +static struct platform_device edma_device = { +	.name		= "edma", +	.id		= -1, +	.num_resources	= ARRAY_SIZE(edma_resources), +	.resource	= edma_resources, +	.dev.platform_data = tnetv107x_edma_info, +}; + +static struct plat_serial8250_port serial_data[] = { +	{ +		.mapbase	= TNETV107X_UART0_BASE, +		.irq		= IRQ_TNETV107X_UART0, +		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | +					UPF_FIXED_TYPE | UPF_IOREMAP, +		.type		= PORT_AR7, +		.iotype		= UPIO_MEM32, +		.regshift	= 2, +	}, +	{ +		.mapbase	= TNETV107X_UART1_BASE, +		.irq		= IRQ_TNETV107X_UART1, +		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | +					UPF_FIXED_TYPE | UPF_IOREMAP, +		.type		= PORT_AR7, +		.iotype		= UPIO_MEM32, +		.regshift	= 2, +	}, +	{ +		.mapbase	= TNETV107X_UART2_BASE, +		.irq		= IRQ_TNETV107X_UART2, +		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | +					UPF_FIXED_TYPE | UPF_IOREMAP, +		.type		= PORT_AR7, +		.iotype		= UPIO_MEM32, +		.regshift	= 2, +	}, +	{ +		.flags	= 0, +	}, +}; + +struct platform_device tnetv107x_serial_device = { +	.name			= "serial8250", +	.id			= PLAT8250_DEV_PLATFORM, +	.dev.platform_data	= serial_data, +}; + +static struct resource mmc0_resources[] = { +	{ /* Memory mapped registers */ +		.start	= TNETV107X_SDIO0_BASE, +		.end	= TNETV107X_SDIO0_BASE + 0x0ff, +		.flags	= IORESOURCE_MEM +	}, +	{ /* MMC interrupt */ +		.start	= IRQ_TNETV107X_MMC0, +		.flags	= IORESOURCE_IRQ +	}, +	{ /* SDIO interrupt */ +		.start	= IRQ_TNETV107X_SDIO0, +		.flags	= IORESOURCE_IRQ +	}, +	{ /* DMA RX */ +		.start	= EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO0_RX), +		.flags	= IORESOURCE_DMA +	}, +	{ /* DMA TX */ +		.start	= EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO0_TX), +		.flags	= IORESOURCE_DMA +	}, +}; + +static struct resource mmc1_resources[] = { +	{ /* Memory mapped registers */ +		.start	= TNETV107X_SDIO1_BASE, +		.end	= TNETV107X_SDIO1_BASE + 0x0ff, +		.flags	= IORESOURCE_MEM +	}, +	{ /* MMC interrupt */ +		.start	= IRQ_TNETV107X_MMC1, +		.flags	= IORESOURCE_IRQ +	}, +	{ /* SDIO interrupt */ +		.start	= IRQ_TNETV107X_SDIO1, +		.flags	= IORESOURCE_IRQ +	}, +	{ /* DMA RX */ +		.start	= EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_RX), +		.flags	= IORESOURCE_DMA +	}, +	{ /* DMA TX */ +		.start	= EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_TX), +		.flags	= IORESOURCE_DMA +	}, +}; + +static u64 mmc0_dma_mask = DMA_BIT_MASK(32); +static u64 mmc1_dma_mask = DMA_BIT_MASK(32); + +static struct platform_device mmc_devices[2] = { +	{ +		.name		= "davinci_mmc", +		.id		= 0, +		.dev		= { +			.dma_mask		= &mmc0_dma_mask, +			.coherent_dma_mask	= DMA_BIT_MASK(32), +		}, +		.num_resources	= ARRAY_SIZE(mmc0_resources), +		.resource	= mmc0_resources +	}, +	{ +		.name		= "davinci_mmc", +		.id		= 1, +		.dev		= { +			.dma_mask		= &mmc1_dma_mask, +			.coherent_dma_mask	= DMA_BIT_MASK(32), +		}, +		.num_resources	= ARRAY_SIZE(mmc1_resources), +		.resource	= mmc1_resources +	}, +}; + +static const u32 emif_windows[] = { +	TNETV107X_ASYNC_EMIF_DATA_CE0_BASE, TNETV107X_ASYNC_EMIF_DATA_CE1_BASE, +	TNETV107X_ASYNC_EMIF_DATA_CE2_BASE, TNETV107X_ASYNC_EMIF_DATA_CE3_BASE, +}; + +static const u32 emif_window_sizes[] = { SZ_256M, SZ_64M, SZ_64M, SZ_64M }; + +static struct resource wdt_resources[] = { +	{ +		.start	= TNETV107X_WDOG_BASE, +		.end	= TNETV107X_WDOG_BASE + SZ_4K - 1, +		.flags	= IORESOURCE_MEM, +	}, +}; + +struct platform_device tnetv107x_wdt_device = { +	.name		= "tnetv107x_wdt", +	.id		= 0, +	.num_resources	= ARRAY_SIZE(wdt_resources), +	.resource	= wdt_resources, +}; + +static int __init nand_init(int chipsel, struct davinci_nand_pdata *data) +{ +	struct resource res[2]; +	struct platform_device *pdev; +	u32	range; +	int	ret; + +	/* Figure out the resource range from the ale/cle masks */ +	range = max(data->mask_cle, data->mask_ale); +	range = PAGE_ALIGN(range + 4) - 1; + +	if (range >= emif_window_sizes[chipsel]) +		return -EINVAL; + +	pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); +	if (!pdev) +		return -ENOMEM; + +	pdev->name		= "davinci_nand"; +	pdev->id		= chipsel; +	pdev->dev.platform_data	= data; + +	memset(res, 0, sizeof(res)); + +	res[0].start	= emif_windows[chipsel]; +	res[0].end	= res[0].start + range; +	res[0].flags	= IORESOURCE_MEM; + +	res[1].start	= TNETV107X_ASYNC_EMIF_CNTRL_BASE; +	res[1].end	= res[1].start + SZ_4K - 1; +	res[1].flags	= IORESOURCE_MEM; + +	ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); +	if (ret < 0) { +		kfree(pdev); +		return ret; +	} + +	return platform_device_register(pdev); +} + +void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) +{ +	int i; + +	platform_device_register(&edma_device); +	platform_device_register(&tnetv107x_wdt_device); + +	if (info->serial_config) +		davinci_serial_init(info->serial_config); + +	for (i = 0; i < 2; i++) +		if (info->mmc_config[i]) { +			mmc_devices[i].dev.platform_data = info->mmc_config[i]; +			platform_device_register(&mmc_devices[i]); +		} + +	for (i = 0; i < 4; i++) +		if (info->nand_config[i]) +			nand_init(i, info->nand_config[i]); +} diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 383478116ef..3d996b659ff 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -591,16 +591,18 @@ queue_priority_mapping[][2] = {  	{-1, -1},  }; -static struct edma_soc_info dm355_edma_info[] = { -	{ -		.n_channel		= 64, -		.n_region		= 4, -		.n_slot			= 128, -		.n_tc			= 2, -		.n_cc			= 1, -		.queue_tc_mapping	= queue_tc_mapping, -		.queue_priority_mapping	= queue_priority_mapping, -	}, +static struct edma_soc_info edma_cc0_info = { +	.n_channel		= 64, +	.n_region		= 4, +	.n_slot			= 128, +	.n_tc			= 2, +	.n_cc			= 1, +	.queue_tc_mapping	= queue_tc_mapping, +	.queue_priority_mapping	= queue_priority_mapping, +}; + +static struct edma_soc_info *dm355_edma_info[EDMA_MAX_CC] = { +       &edma_cc0_info,  };  static struct resource edma_resources[] = { diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index a146849d78f..6b6f4c64370 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -822,17 +822,19 @@ dm365_queue_priority_mapping[][2] = {  	{-1, -1},  }; -static struct edma_soc_info dm365_edma_info[] = { -	{ -		.n_channel		= 64, -		.n_region		= 4, -		.n_slot			= 256, -		.n_tc			= 4, -		.n_cc			= 1, -		.queue_tc_mapping	= dm365_queue_tc_mapping, -		.queue_priority_mapping	= dm365_queue_priority_mapping, -		.default_queue		= EVENTQ_3, -	}, +static struct edma_soc_info edma_cc0_info = { +	.n_channel		= 64, +	.n_region		= 4, +	.n_slot			= 256, +	.n_tc			= 4, +	.n_cc			= 1, +	.queue_tc_mapping	= dm365_queue_tc_mapping, +	.queue_priority_mapping	= dm365_queue_priority_mapping, +	.default_queue		= EVENTQ_3, +}; + +static struct edma_soc_info *dm365_edma_info[EDMA_MAX_CC] = { +	&edma_cc0_info,  };  static struct resource edma_resources[] = { @@ -1020,6 +1022,8 @@ static struct davinci_timer_info dm365_timer_info = {  	.clocksource_id	= T0_TOP,  }; +#define DM365_UART1_BASE	(IO_PHYS + 0x106000) +  static struct plat_serial8250_port dm365_serial_platform_data[] = {  	{  		.mapbase	= DAVINCI_UART0_BASE, @@ -1030,7 +1034,7 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = {  		.regshift	= 2,  	},  	{ -		.mapbase	= DAVINCI_UART1_BASE, +		.mapbase	= DM365_UART1_BASE,  		.irq		= IRQ_UARTINT1,  		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |  				  UPF_IOREMAP, diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 7ad15208b84..40fec315c99 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -492,16 +492,18 @@ queue_priority_mapping[][2] = {  	{-1, -1},  }; -static struct edma_soc_info dm644x_edma_info[] = { -	{ -		.n_channel		= 64, -		.n_region		= 4, -		.n_slot			= 128, -		.n_tc			= 2, -		.n_cc			= 1, -		.queue_tc_mapping	= queue_tc_mapping, -		.queue_priority_mapping	= queue_priority_mapping, -	}, +static struct edma_soc_info edma_cc0_info = { +	.n_channel		= 64, +	.n_region		= 4, +	.n_slot			= 128, +	.n_tc			= 2, +	.n_cc			= 1, +	.queue_tc_mapping	= queue_tc_mapping, +	.queue_priority_mapping	= queue_priority_mapping, +}; + +static struct edma_soc_info *dm644x_edma_info[EDMA_MAX_CC] = { +	&edma_cc0_info,  };  static struct resource edma_resources[] = { diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 94045656cff..e4a3df1872a 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -529,16 +529,18 @@ dm646x_queue_priority_mapping[][2] = {  	{-1, -1},  }; -static struct edma_soc_info dm646x_edma_info[] = { -	{ -		.n_channel		= 64, -		.n_region		= 6,	/* 0-1, 4-7 */ -		.n_slot			= 512, -		.n_tc			= 4, -		.n_cc			= 1, -		.queue_tc_mapping	= dm646x_queue_tc_mapping, -		.queue_priority_mapping	= dm646x_queue_priority_mapping, -	}, +static struct edma_soc_info edma_cc0_info = { +	.n_channel		= 64, +	.n_region		= 6,	/* 0-1, 4-7 */ +	.n_slot			= 512, +	.n_tc			= 4, +	.n_cc			= 1, +	.queue_tc_mapping	= dm646x_queue_tc_mapping, +	.queue_priority_mapping	= dm646x_queue_priority_mapping, +}; + +static struct edma_soc_info *dm646x_edma_info[EDMA_MAX_CC] = { +	&edma_cc0_info,  };  static struct resource edma_resources[] = { @@ -877,6 +879,13 @@ void dm646x_setup_vpif(struct vpif_display_config *display_config,  	platform_device_register(&vpif_capture_dev);  } +int __init dm646x_init_edma(struct edma_rsv_info *rsv) +{ +	edma_cc0_info.rsv = rsv; + +	return platform_device_register(&dm646x_edma_device); +} +  void __init dm646x_init(void)  {  	dm646x_board_setup_refclk(&ref_clk); @@ -888,7 +897,6 @@ static int __init dm646x_init_devices(void)  	if (!cpu_is_davinci_dm646x())  		return 0; -	platform_device_register(&dm646x_edma_device);  	platform_device_register(&dm646x_emac_device);  	return 0;  } diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c index d33827aadda..2ede598b77d 100644 --- a/arch/arm/mach-davinci/dma.c +++ b/arch/arm/mach-davinci/dma.c @@ -99,8 +99,6 @@  #define EDMA_MAX_DMACH           64  #define EDMA_MAX_PARAMENTRY     512 -#define EDMA_MAX_CC               2 -  /*****************************************************************************/ @@ -207,6 +205,18 @@ static inline void edma_parm_or(unsigned ctlr, int offset, int param_no,  	edma_or(ctlr, EDMA_PARM + offset + (param_no << 5), or);  } +static inline void set_bits(int offset, int len, unsigned long *p) +{ +	for (; len > 0; len--) +		set_bit(offset + (len - 1), p); +} + +static inline void clear_bits(int offset, int len, unsigned long *p) +{ +	for (; len > 0; len--) +		clear_bit(offset + (len - 1), p); +} +  /*****************************************************************************/  /* actual number of DMA channels and slots on this silicon */ @@ -1376,11 +1386,13 @@ EXPORT_SYMBOL(edma_clear_event);  static int __init edma_probe(struct platform_device *pdev)  { -	struct edma_soc_info	*info = pdev->dev.platform_data; +	struct edma_soc_info	**info = pdev->dev.platform_data;  	const s8		(*queue_priority_mapping)[2];  	const s8		(*queue_tc_mapping)[2]; -	int			i, j, found = 0; +	int			i, j, off, ln, found = 0;  	int			status = -1; +	const s16		(*rsv_chans)[2]; +	const s16		(*rsv_slots)[2];  	int			irq[EDMA_MAX_CC] = {0, 0};  	int			err_irq[EDMA_MAX_CC] = {0, 0};  	struct resource		*r[EDMA_MAX_CC] = {NULL}; @@ -1395,7 +1407,7 @@ static int __init edma_probe(struct platform_device *pdev)  		sprintf(res_name, "edma_cc%d", j);  		r[j] = platform_get_resource_byname(pdev, IORESOURCE_MEM,  						res_name); -		if (!r[j]) { +		if (!r[j] || !info[j]) {  			if (found)  				break;  			else @@ -1426,13 +1438,14 @@ static int __init edma_probe(struct platform_device *pdev)  		}  		memset(edma_cc[j], 0, sizeof(struct edma)); -		edma_cc[j]->num_channels = min_t(unsigned, info[j].n_channel, +		edma_cc[j]->num_channels = min_t(unsigned, info[j]->n_channel,  							EDMA_MAX_DMACH); -		edma_cc[j]->num_slots = min_t(unsigned, info[j].n_slot, +		edma_cc[j]->num_slots = min_t(unsigned, info[j]->n_slot,  							EDMA_MAX_PARAMENTRY); -		edma_cc[j]->num_cc = min_t(unsigned, info[j].n_cc, EDMA_MAX_CC); +		edma_cc[j]->num_cc = min_t(unsigned, info[j]->n_cc, +							EDMA_MAX_CC); -		edma_cc[j]->default_queue = info[j].default_queue; +		edma_cc[j]->default_queue = info[j]->default_queue;  		if (!edma_cc[j]->default_queue)  			edma_cc[j]->default_queue = EVENTQ_1; @@ -1447,6 +1460,31 @@ static int __init edma_probe(struct platform_device *pdev)  		memset(edma_cc[j]->edma_unused, 0xff,  			sizeof(edma_cc[j]->edma_unused)); +		if (info[j]->rsv) { + +			/* Clear the reserved channels in unused list */ +			rsv_chans = info[j]->rsv->rsv_chans; +			if (rsv_chans) { +				for (i = 0; rsv_chans[i][0] != -1; i++) { +					off = rsv_chans[i][0]; +					ln = rsv_chans[i][1]; +					clear_bits(off, ln, +						edma_cc[j]->edma_unused); +				} +			} + +			/* Set the reserved slots in inuse list */ +			rsv_slots = info[j]->rsv->rsv_slots; +			if (rsv_slots) { +				for (i = 0; rsv_slots[i][0] != -1; i++) { +					off = rsv_slots[i][0]; +					ln = rsv_slots[i][1]; +					set_bits(off, ln, +						edma_cc[j]->edma_inuse); +				} +			} +		} +  		sprintf(irq_name, "edma%d", j);  		irq[j] = platform_get_irq_byname(pdev, irq_name);  		edma_cc[j]->irq_res_start = irq[j]; @@ -1476,8 +1514,8 @@ static int __init edma_probe(struct platform_device *pdev)  		for (i = 0; i < edma_cc[j]->num_channels; i++)  			map_dmach_queue(j, i, EVENTQ_1); -		queue_tc_mapping = info[j].queue_tc_mapping; -		queue_priority_mapping = info[j].queue_priority_mapping; +		queue_tc_mapping = info[j]->queue_tc_mapping; +		queue_priority_mapping = info[j]->queue_priority_mapping;  		/* Event queue to TC mapping */  		for (i = 0; queue_tc_mapping[i][0] != -1; i++) @@ -1496,7 +1534,7 @@ static int __init edma_probe(struct platform_device *pdev)  		if (edma_read(j, EDMA_CCCFG) & CHMAP_EXIST)  			map_dmach_param(j); -		for (i = 0; i < info[j].n_region; i++) { +		for (i = 0; i < info[j]->n_region; i++) {  			edma_write_array2(j, EDMA_DRAE, i, 0, 0x0);  			edma_write_array2(j, EDMA_DRAE, i, 1, 0x0);  			edma_write_array(j, EDMA_QRAE, i, 0x0); diff --git a/arch/arm/mach-davinci/gpio-tnetv107x.c b/arch/arm/mach-davinci/gpio-tnetv107x.c new file mode 100644 index 00000000000..d10298620e2 --- /dev/null +++ b/arch/arm/mach-davinci/gpio-tnetv107x.c @@ -0,0 +1,205 @@ +/* + * Texas Instruments TNETV107X GPIO Controller + * + * Copyright (C) 2010 Texas Instruments + * + * 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 version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + */ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/gpio.h> + +#include <mach/common.h> +#include <mach/tnetv107x.h> + +struct tnetv107x_gpio_regs { +	u32	idver; +	u32	data_in[3]; +	u32	data_out[3]; +	u32	direction[3]; +	u32	enable[3]; +}; + +#define gpio_reg_index(gpio)	((gpio) >> 5) +#define gpio_reg_bit(gpio)	BIT((gpio) & 0x1f) + +#define gpio_reg_rmw(reg, mask, val)	\ +	__raw_writel((__raw_readl(reg) & ~(mask)) | (val), (reg)) + +#define gpio_reg_set_bit(reg, gpio)	\ +	gpio_reg_rmw((reg) + gpio_reg_index(gpio), 0, gpio_reg_bit(gpio)) + +#define gpio_reg_clear_bit(reg, gpio)	\ +	gpio_reg_rmw((reg) + gpio_reg_index(gpio), gpio_reg_bit(gpio), 0) + +#define gpio_reg_get_bit(reg, gpio)	\ +	(__raw_readl((reg) + gpio_reg_index(gpio)) & gpio_reg_bit(gpio)) + +#define chip2controller(chip)		\ +	container_of(chip, struct davinci_gpio_controller, chip) + +#define TNETV107X_GPIO_CTLRS	DIV_ROUND_UP(TNETV107X_N_GPIO, 32) + +static struct davinci_gpio_controller chips[TNETV107X_GPIO_CTLRS]; + +static int tnetv107x_gpio_request(struct gpio_chip *chip, unsigned offset) +{ +	struct davinci_gpio_controller *ctlr = chip2controller(chip); +	struct tnetv107x_gpio_regs __iomem *regs = ctlr->regs; +	unsigned gpio = chip->base + offset; +	unsigned long flags; + +	spin_lock_irqsave(&ctlr->lock, flags); + +	gpio_reg_set_bit(®s->enable, gpio); + +	spin_unlock_irqrestore(&ctlr->lock, flags); + +	return 0; +} + +static void tnetv107x_gpio_free(struct gpio_chip *chip, unsigned offset) +{ +	struct davinci_gpio_controller *ctlr = chip2controller(chip); +	struct tnetv107x_gpio_regs __iomem *regs = ctlr->regs; +	unsigned gpio = chip->base + offset; +	unsigned long flags; + +	spin_lock_irqsave(&ctlr->lock, flags); + +	gpio_reg_clear_bit(®s->enable, gpio); + +	spin_unlock_irqrestore(&ctlr->lock, flags); +} + +static int tnetv107x_gpio_dir_in(struct gpio_chip *chip, unsigned offset) +{ +	struct davinci_gpio_controller *ctlr = chip2controller(chip); +	struct tnetv107x_gpio_regs __iomem *regs = ctlr->regs; +	unsigned gpio = chip->base + offset; +	unsigned long flags; + +	spin_lock_irqsave(&ctlr->lock, flags); + +	gpio_reg_set_bit(®s->direction, gpio); + +	spin_unlock_irqrestore(&ctlr->lock, flags); + +	return 0; +} + +static int tnetv107x_gpio_dir_out(struct gpio_chip *chip, +		unsigned offset, int value) +{ +	struct davinci_gpio_controller *ctlr = chip2controller(chip); +	struct tnetv107x_gpio_regs __iomem *regs = ctlr->regs; +	unsigned gpio = chip->base + offset; +	unsigned long flags; + +	spin_lock_irqsave(&ctlr->lock, flags); + +	if (value) +		gpio_reg_set_bit(®s->data_out, gpio); +	else +		gpio_reg_clear_bit(®s->data_out, gpio); + +	gpio_reg_clear_bit(®s->direction, gpio); + +	spin_unlock_irqrestore(&ctlr->lock, flags); + +	return 0; +} + +static int tnetv107x_gpio_get(struct gpio_chip *chip, unsigned offset) +{ +	struct davinci_gpio_controller *ctlr = chip2controller(chip); +	struct tnetv107x_gpio_regs __iomem *regs = ctlr->regs; +	unsigned gpio = chip->base + offset; +	int ret; + +	ret = gpio_reg_get_bit(®s->data_in, gpio); + +	return ret ? 1 : 0; +} + +static void tnetv107x_gpio_set(struct gpio_chip *chip, +		unsigned offset, int value) +{ +	struct davinci_gpio_controller *ctlr = chip2controller(chip); +	struct tnetv107x_gpio_regs __iomem *regs = ctlr->regs; +	unsigned gpio = chip->base + offset; +	unsigned long flags; + +	spin_lock_irqsave(&ctlr->lock, flags); + +	if (value) +		gpio_reg_set_bit(®s->data_out, gpio); +	else +		gpio_reg_clear_bit(®s->data_out, gpio); + +	spin_unlock_irqrestore(&ctlr->lock, flags); +} + +static int __init tnetv107x_gpio_setup(void) +{ +	int i, base; +	unsigned ngpio; +	struct davinci_soc_info *soc_info = &davinci_soc_info; +	struct tnetv107x_gpio_regs *regs; +	struct davinci_gpio_controller *ctlr; + +	if (soc_info->gpio_type != GPIO_TYPE_TNETV107X) +		return 0; + +	ngpio = soc_info->gpio_num; +	if (ngpio == 0) { +		pr_err("GPIO setup:  how many GPIOs?\n"); +		return -EINVAL; +	} + +	if (WARN_ON(TNETV107X_N_GPIO < ngpio)) +		ngpio = TNETV107X_N_GPIO; + +	regs = ioremap(soc_info->gpio_base, SZ_4K); +	if (WARN_ON(!regs)) +		return -EINVAL; + +	for (i = 0, base = 0; base < ngpio; i++, base += 32) { +		ctlr = &chips[i]; + +		ctlr->chip.label	= "tnetv107x"; +		ctlr->chip.can_sleep	= 0; +		ctlr->chip.base		= base; +		ctlr->chip.ngpio	= ngpio - base; +		if (ctlr->chip.ngpio > 32) +			ctlr->chip.ngpio = 32; + +		ctlr->chip.request		= tnetv107x_gpio_request; +		ctlr->chip.free			= tnetv107x_gpio_free; +		ctlr->chip.direction_input	= tnetv107x_gpio_dir_in; +		ctlr->chip.get			= tnetv107x_gpio_get; +		ctlr->chip.direction_output	= tnetv107x_gpio_dir_out; +		ctlr->chip.set			= tnetv107x_gpio_set; + +		spin_lock_init(&ctlr->lock); + +		ctlr->regs	= regs; +		ctlr->set_data	= ®s->data_out[i]; +		ctlr->clr_data	= ®s->data_out[i]; +		ctlr->in_data	= ®s->data_in[i]; + +		gpiochip_add(&ctlr->chip); +	} + +	soc_info->gpio_ctlrs = chips; +	soc_info->gpio_ctlrs_num = DIV_ROUND_UP(ngpio, 32); +	return 0; +} +pure_initcall(tnetv107x_gpio_setup); diff --git a/arch/arm/mach-davinci/include/mach/asp.h b/arch/arm/mach-davinci/include/mach/asp.h index 834725f1e81..9aa240909a2 100644 --- a/arch/arm/mach-davinci/include/mach/asp.h +++ b/arch/arm/mach-davinci/include/mach/asp.h @@ -52,7 +52,8 @@  struct snd_platform_data {  	u32 tx_dma_offset;  	u32 rx_dma_offset; -	enum dma_event_q eventq_no;	/* event queue number */ +	enum dma_event_q asp_chan_q;	/* event queue number for ASP channel */ +	enum dma_event_q ram_chan_q;	/* event queue number for RAM channel */  	unsigned int codec_fmt;  	/*  	 * Allowing this is more efficient and eliminates left and right swaps @@ -63,6 +64,49 @@ struct snd_platform_data {  	unsigned sram_size_playback;  	unsigned sram_size_capture; +	/* +	 * If McBSP peripheral gets the clock from an external pin, +	 * there are three chooses, that are MCBSP_CLKX, MCBSP_CLKR +	 * and MCBSP_CLKS. +	 * Depending on different hardware connections it is possible +	 * to use this setting to change the behaviour of McBSP +	 * driver. The dm365_clk_input_pin enum is available for dm365 +	 */ +	int clk_input_pin; + +	/* +	 * This flag works when both clock and FS are outputs for the cpu +	 * and makes clock more accurate (FS is not symmetrical and the +	 * clock is very fast. +	 * The clock becoming faster is named +	 * i2s continuous serial clock (I2S_SCK) and it is an externally +	 * visible bit clock. +	 * +	 * first line : WordSelect +	 * second line : ContinuousSerialClock +	 * third line: SerialData +	 * +	 * SYMMETRICAL APPROACH: +	 *   _______________________          LEFT +	 * _|         RIGHT         |______________________| +	 *     _   _         _   _   _   _         _   _ +	 *   _| |_| |_ x16 _| |_| |_| |_| |_ x16 _| |_| |_ +	 *     _   _         _   _   _   _         _   _ +	 *   _/ \_/ \_ ... _/ \_/ \_/ \_/ \_ ... _/ \_/ \_ +	 *    \_/ \_/       \_/ \_/ \_/ \_/       \_/ \_/ +	 * +	 * ACCURATE CLOCK APPROACH: +	 *   ______________          LEFT +	 * _|     RIGHT    |_______________________________| +	 *     _         _   _         _   _   _   _   _   _ +	 *   _| |_ x16 _| |_| |_ x16 _| |_| |_| |_| |_| |_| | +	 *     _         _   _          _      dummy cycles +	 *   _/ \_ ... _/ \_/ \_  ... _/ \__________________ +	 *    \_/       \_/ \_/        \_/ +	 * +	 */ +	bool i2s_accurate_sck; +  	/* McASP specific fields */  	int tdm_slots;  	u8 op_mode; @@ -78,6 +122,11 @@ enum {  	MCASP_VERSION_2,	/* DA8xx/OMAPL1x */  }; +enum dm365_clk_input_pin { +	MCBSP_CLKR = 0,		/* DM365 */ +	MCBSP_CLKS, +}; +  #define INACTIVE_MODE	0  #define TX_MODE		1  #define RX_MODE		2 diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index 1b31a9aa8fb..3c07059f526 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -67,7 +67,8 @@ extern void __iomem *da8xx_syscfg1_base;  void __init da830_init(void);  void __init da850_init(void); -int da8xx_register_edma(void); +int da830_register_edma(struct edma_rsv_info *rsv); +int da850_register_edma(struct edma_rsv_info *rsv[2]);  int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);  int da8xx_register_watchdog(void);  int da8xx_register_usb20(unsigned mA, unsigned potpgt); diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S index 3cd93a801d9..f761dfdb868 100644 --- a/arch/arm/mach-davinci/include/mach/debug-macro.S +++ b/arch/arm/mach-davinci/include/mach/debug-macro.S @@ -17,22 +17,50 @@   */  #include <linux/serial_reg.h> + +#include <asm/memory.h> + +#include <mach/serial.h> +  #define UART_SHIFT	2 +		.pushsection .data +davinci_uart_phys:	.word	0 +davinci_uart_virt:	.word	0 +		.popsection +  		.macro addruart, rx, tmp + +		/* Use davinci_uart_phys/virt if already configured */ +10:		mrc	p15, 0, \rx, c1, c0 +		tst	\rx, #1			@ MMU enabled? +		ldreq	\rx, =__virt_to_phys(davinci_uart_phys) +		ldrne	\rx, =davinci_uart_virt +		ldr	\rx, [\rx] +		cmp	\rx, #0			@ is port configured? +		bne	99f			@ already configured +  		mrc	p15, 0, \rx, c1, c0  		tst	\rx, #1			@ MMU enabled? -		moveq	\rx, #0x01000000	@ physical base address -		movne	\rx, #0xfe000000	@ virtual base -#if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx) -#error Cannot enable DaVinci and DA8XX platforms concurrently -#elif defined(CONFIG_MACH_DAVINCI_DA830_EVM) || \ -	defined(CONFIG_MACH_DAVINCI_DA850_EVM) -		orr	\rx, \rx, #0x00d00000	@ physical base address -		orr	\rx, \rx, #0x0000d000	@ of UART 2 -#else -		orr	\rx, \rx, #0x00c20000   @ UART 0 -#endif + +		/* Copy uart phys address from decompressor uart info */ +		ldreq	\tmp, =__virt_to_phys(davinci_uart_phys) +		ldrne	\tmp, =davinci_uart_phys +		ldreq	\rx, =DAVINCI_UART_INFO +		ldrne	\rx, =__phys_to_virt(DAVINCI_UART_INFO) +		ldr	\rx, [\rx, #0] +		str	\rx, [\tmp] + +		/* Copy uart virt address from decompressor uart info */ +		ldreq	\tmp, =__virt_to_phys(davinci_uart_virt) +		ldrne	\tmp, =davinci_uart_virt +		ldreq	\rx, =DAVINCI_UART_INFO +		ldrne	\rx, =__phys_to_virt(DAVINCI_UART_INFO) +		ldr	\rx, [\rx, #4] +		str	\rx, [\tmp] + +		b	10b +99:  		.endm  		.macro	senduart,rd,rx diff --git a/arch/arm/mach-davinci/include/mach/dm646x.h b/arch/arm/mach-davinci/include/mach/dm646x.h index add6f794a36..0a27ee9a70e 100644 --- a/arch/arm/mach-davinci/include/mach/dm646x.h +++ b/arch/arm/mach-davinci/include/mach/dm646x.h @@ -32,6 +32,7 @@ void __init dm646x_init(void);  void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);  void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);  void __init dm646x_board_setup_refclk(struct clk *clk); +int __init dm646x_init_edma(struct edma_rsv_info *rsv);  void dm646x_video_init(void); diff --git a/arch/arm/mach-davinci/include/mach/edma.h b/arch/arm/mach-davinci/include/mach/edma.h index ced3092af5b..dc10ef6cf57 100644 --- a/arch/arm/mach-davinci/include/mach/edma.h +++ b/arch/arm/mach-davinci/include/mach/edma.h @@ -230,6 +230,8 @@ enum sync_dimension {  #define EDMA_CONT_PARAMS_FIXED_EXACT	 1002  #define EDMA_CONT_PARAMS_FIXED_NOT_EXACT 1003 +#define EDMA_MAX_CC               2 +  /* alloc/free DMA channels and their dedicated parameter RAM slots */  int edma_alloc_channel(int channel,  	void (*callback)(unsigned channel, u16 ch_status, void *data), @@ -269,6 +271,12 @@ void edma_clear_event(unsigned channel);  void edma_pause(unsigned channel);  void edma_resume(unsigned channel); +struct edma_rsv_info { + +	const s16	(*rsv_chans)[2]; +	const s16	(*rsv_slots)[2]; +}; +  /* platform_data for EDMA driver */  struct edma_soc_info { @@ -280,6 +288,9 @@ struct edma_soc_info {  	unsigned	n_cc;  	enum dma_event_q	default_queue; +	/* Resource reservation for other cores */ +	struct edma_rsv_info	*rsv; +  	const s8	(*queue_tc_mapping)[2];  	const s8	(*queue_priority_mapping)[2];  }; diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h index 504cc180a60..fbece126c2b 100644 --- a/arch/arm/mach-davinci/include/mach/gpio.h +++ b/arch/arm/mach-davinci/include/mach/gpio.h @@ -25,6 +25,7 @@  enum davinci_gpio_type {  	GPIO_TYPE_DAVINCI = 0, +	GPIO_TYPE_TNETV107X,  };  /* @@ -87,9 +88,13 @@ static inline u32 __gpio_mask(unsigned gpio)  	return 1 << (gpio % 32);  } -/* The get/set/clear functions will inline when called with constant +/* + * The get/set/clear functions will inline when called with constant   * parameters referencing built-in GPIOs, for low-overhead bitbanging.   * + * gpio_set_value() will inline only on traditional Davinci style controllers + * with distinct set/clear registers. + *   * Otherwise, calls with variable parameters or referencing external   * GPIOs (e.g. on GPIO expander chips) use outlined functions.   */ @@ -100,12 +105,15 @@ static inline void gpio_set_value(unsigned gpio, int value)  		u32				mask;  		ctlr = __gpio_to_controller(gpio); -		mask = __gpio_mask(gpio); -		if (value) -			__raw_writel(mask, ctlr->set_data); -		else -			__raw_writel(mask, ctlr->clr_data); -		return; + +		if (ctlr->set_data != ctlr->clr_data) { +			mask = __gpio_mask(gpio); +			if (value) +				__raw_writel(mask, ctlr->set_data); +			else +				__raw_writel(mask, ctlr->clr_data); +			return; +		}  	}  	__gpio_set_value(gpio, value); diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index f6c4f34909a..8051110b8ac 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h @@ -11,8 +11,19 @@  #ifndef __ASM_ARCH_SERIAL_H  #define __ASM_ARCH_SERIAL_H +#include <asm/memory.h> +  #include <mach/hardware.h> +/* + * Stolen area that contains debug uart physical and virtual addresses.  These + * addresses are filled in by the uncompress.h code, and are used by the debug + * macros in debug-macro.S. + * + * This area sits just below the page tables (see arch/arm/kernel/head.S). + */ +#define DAVINCI_UART_INFO	(PHYS_OFFSET + 0x3ff8) +  #define DAVINCI_UART0_BASE	(IO_PHYS + 0x20000)  #define DAVINCI_UART1_BASE	(IO_PHYS + 0x20400)  #define DAVINCI_UART2_BASE	(IO_PHYS + 0x20800) @@ -21,16 +32,26 @@  #define DA8XX_UART1_BASE	(IO_PHYS + 0x10c000)  #define DA8XX_UART2_BASE	(IO_PHYS + 0x10d000) +#define TNETV107X_UART0_BASE	0x08108100 +#define TNETV107X_UART1_BASE	0x08088400 +#define TNETV107X_UART2_BASE	0x08108300 + +#define TNETV107X_UART0_VIRT	IOMEM(0xfee08100) +#define TNETV107X_UART1_VIRT	IOMEM(0xfed88400) +#define TNETV107X_UART2_VIRT	IOMEM(0xfee08300) +  /* DaVinci UART register offsets */  #define UART_DAVINCI_PWREMU		0x0c  #define UART_DM646X_SCR			0x10  #define UART_DM646X_SCR_TX_WATERMARK	0x08 +#ifndef __ASSEMBLY__  struct davinci_uart_config {  	/* Bit field of UARTs present; bit 0 --> UART1 */  	unsigned int enabled_uarts;  };  extern int davinci_serial_init(struct davinci_uart_config *); +#endif  #endif /* __ASM_ARCH_SERIAL_H */ diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h new file mode 100644 index 00000000000..c7206473312 --- /dev/null +++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h @@ -0,0 +1,55 @@ +/* + * Texas Instruments TNETV107X SoC Specific Defines + * + * Copyright (C) 2010 Texas Instruments + * + * 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 version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + */ +#ifndef __ASM_ARCH_DAVINCI_TNETV107X_H +#define __ASM_ARCH_DAVINCI_TNETV107X_H + +#include <asm/sizes.h> + +#define TNETV107X_DDR_BASE	0x80000000 + +/* + * Fixed mapping for early init starts here. If low-level debug is enabled, + * this area also gets mapped via io_pg_offset and io_phys by the boot code. + * To fit in with the io_pg_offset calculation, the io base address selected + * here _must_ be a multiple of 2^20. + */ +#define TNETV107X_IO_BASE	0x08000000 +#define TNETV107X_IO_VIRT	(IO_VIRT + SZ_1M) + +#define TNETV107X_N_GPIO	65 + +#ifndef __ASSEMBLY__ + +#include <linux/serial_8250.h> +#include <mach/mmc.h> +#include <mach/nand.h> +#include <mach/serial.h> + +struct tnetv107x_device_info { +	struct davinci_uart_config	*serial_config; +	struct davinci_mmc_config	*mmc_config[2];  /* 2 controllers */ +	struct davinci_nand_pdata	*nand_config[4]; /* 4 chipsels */ +}; + +extern struct platform_device tnetv107x_wdt_device; +extern struct platform_device tnetv107x_serial_device; + +extern void __init tnetv107x_init(void); +extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *); +extern void __init tnetv107x_irq_init(void); + +#endif + +#endif /* __ASM_ARCH_DAVINCI_TNETV107X_H */ diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index 33796b4db17..15a6192ad6e 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h @@ -1,8 +1,17 @@  /*   * Serial port stubs for kernel decompress status messages   * - *  Author:     Anant Gole - * (C) Copyright (C) 2006, Texas Instruments, Inc + * Initially based on: + * arch/arm/plat-omap/include/mach/uncompress.h + * + * Original copyrights follow. + * + * Copyright (C) 2000 RidgeRun, Inc. + * Author: Greg Lonnon <glonnon@ridgerun.com> + * + * Rewritten by: + * Author: <source@mvista.com> + * 2004 (c) MontaVista Software, Inc.   *   * This file is licensed under the terms of the GNU General Public License   * version 2. This program is licensed "as is" without any warranty of any @@ -11,30 +20,17 @@  #include <linux/types.h>  #include <linux/serial_reg.h> -#include <mach/serial.h>  #include <asm/mach-types.h> -extern unsigned int __machine_arch_type; +#include <mach/serial.h>  static u32 *uart; - -static u32 *get_uart_base(void) -{ -	if (__machine_arch_type == MACH_TYPE_DAVINCI_DA830_EVM || -		__machine_arch_type == MACH_TYPE_DAVINCI_DA850_EVM) -		return (u32 *)DA8XX_UART2_BASE; -	else -		return (u32 *)DAVINCI_UART0_BASE; -} +static u32 *uart_info = (u32 *)(DAVINCI_UART_INFO);  /* PORT_16C550A, in polled non-fifo mode */ -  static void putc(char c)  { -	if (!uart) -		uart = get_uart_base(); -  	while (!(uart[UART_LSR] & UART_LSR_THRE))  		barrier();  	uart[UART_TX] = c; @@ -42,12 +38,61 @@ static void putc(char c)  static inline void flush(void)  { -	if (!uart) -		uart = get_uart_base(); -  	while (!(uart[UART_LSR] & UART_LSR_THRE))  		barrier();  } -#define arch_decomp_setup() +static inline void set_uart_info(u32 phys, void * __iomem virt) +{ +	uart = (u32 *)phys; +	uart_info[0] = phys; +	uart_info[1] = (u32)virt; +} + +#define _DEBUG_LL_ENTRY(machine, phys, virt)			\ +	if (machine_is_##machine()) {				\ +		set_uart_info(phys, virt);			\ +		break;						\ +	} + +#define DEBUG_LL_DAVINCI(machine, port)				\ +	_DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE,	\ +			IO_ADDRESS(DAVINCI_UART##port##_BASE)) + +#define DEBUG_LL_DA8XX(machine, port)				\ +	_DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE,	\ +			IO_ADDRESS(DA8XX_UART##port##_BASE)) + +#define DEBUG_LL_TNETV107X(machine, port)			\ +	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE,	\ +			TNETV107X_UART##port##_VIRT) + +static inline void __arch_decomp_setup(unsigned long arch_id) +{ +	/* +	 * Initialize the port based on the machine ID from the bootloader. +	 * Note that we're using macros here instead of switch statement +	 * as machine_is functions are optimized out for the boards that +	 * are not selected. +	 */ +	do { +		/* Davinci boards */ +		DEBUG_LL_DAVINCI(davinci_evm,		0); +		DEBUG_LL_DAVINCI(sffsdr,		0); +		DEBUG_LL_DAVINCI(neuros_osd2,		0); +		DEBUG_LL_DAVINCI(davinci_dm355_evm,	0); +		DEBUG_LL_DAVINCI(dm355_leopard,		0); +		DEBUG_LL_DAVINCI(davinci_dm6467_evm,	0); +		DEBUG_LL_DAVINCI(davinci_dm365_evm,	0); + +		/* DA8xx boards */ +		DEBUG_LL_DA8XX(davinci_da830_evm,	2); +		DEBUG_LL_DA8XX(davinci_da850_evm,	2); + +		/* TNETV107x boards */ +		DEBUG_LL_TNETV107X(tnetv107x,		1); +	} while (0); +} + +#define arch_decomp_setup()	__arch_decomp_setup(arch_id)  #define arch_decomp_wdog() diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c new file mode 100644 index 00000000000..864e60482c5 --- /dev/null +++ b/arch/arm/mach-davinci/tnetv107x.c @@ -0,0 +1,753 @@ +/* + * Texas Instruments TNETV107X SoC Support + * + * Copyright (C) 2010 Texas Instruments + * + * 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 version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + */ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> +#include <linux/err.h> +#include <linux/platform_device.h> + +#include <asm/mach/map.h> + +#include <mach/common.h> +#include <mach/time.h> +#include <mach/cputype.h> +#include <mach/psc.h> +#include <mach/cp_intc.h> +#include <mach/irqs.h> +#include <mach/gpio.h> +#include <mach/hardware.h> +#include <mach/tnetv107x.h> + +#include "clock.h" +#include "mux.h" + +/* Base addresses for on-chip devices */ +#define TNETV107X_INTC_BASE			0x03000000 +#define TNETV107X_TIMER0_BASE			0x08086500 +#define TNETV107X_TIMER1_BASE			0x08086600 +#define TNETV107X_CHIP_CFG_BASE			0x08087000 +#define TNETV107X_GPIO_BASE			0x08088000 +#define TNETV107X_CLOCK_CONTROL_BASE		0x0808a000 +#define TNETV107X_PSC_BASE			0x0808b000 + +/* Reference clock frequencies */ +#define OSC_FREQ_ONCHIP		(24000 * 1000) +#define OSC_FREQ_OFFCHIP_SYS	(25000 * 1000) +#define OSC_FREQ_OFFCHIP_ETH	(25000 * 1000) +#define OSC_FREQ_OFFCHIP_TDM	(19200 * 1000) + +#define N_PLLS	3 + +/* Clock Control Registers */ +struct clk_ctrl_regs { +	u32	pll_bypass; +	u32	_reserved0; +	u32	gem_lrst; +	u32	_reserved1; +	u32	pll_unlock_stat; +	u32	sys_unlock; +	u32	eth_unlock; +	u32	tdm_unlock; +}; + +/* SSPLL Registers */ +struct sspll_regs { +	u32	modes; +	u32	post_div; +	u32	pre_div; +	u32	mult_factor; +	u32	divider_range; +	u32	bw_divider; +	u32	spr_amount; +	u32	spr_rate_div; +	u32	diag; +}; + +/* Watchdog Timer Registers */ +struct wdt_regs { +	u32	kick_lock; +	u32	kick; +	u32	change_lock; +	u32	change ; +	u32	disable_lock; +	u32	disable; +	u32	prescale_lock; +	u32	prescale; +}; + +static struct clk_ctrl_regs __iomem *clk_ctrl_regs; + +static struct sspll_regs __iomem *sspll_regs[N_PLLS]; +static int sspll_regs_base[N_PLLS] = { 0x40, 0x80, 0xc0 }; + +/* PLL bypass bit shifts in clk_ctrl_regs->pll_bypass register */ +static u32 bypass_mask[N_PLLS] = { BIT(0), BIT(2), BIT(1) }; + +/* offchip (external) reference clock frequencies */ +static u32 pll_ext_freq[] = { +	OSC_FREQ_OFFCHIP_SYS, +	OSC_FREQ_OFFCHIP_TDM, +	OSC_FREQ_OFFCHIP_ETH +}; + +/* PSC control registers */ +static u32 psc_regs[] __initconst = { TNETV107X_PSC_BASE }; + +/* Host map for interrupt controller */ +static u32 intc_host_map[] = { 0x01010000, 0x01010101, -1 }; + +static unsigned long clk_sspll_recalc(struct clk *clk); + +/* Level 1 - the PLLs */ +#define define_pll_clk(cname, pll, divmask, base)	\ +	static struct pll_data pll_##cname##_data = {	\ +		.num		= pll,			\ +		.div_ratio_mask	= divmask,		\ +		.phys_base	= base +		\ +			TNETV107X_CLOCK_CONTROL_BASE,	\ +	};						\ +	static struct clk pll_##cname##_clk = {		\ +		.name		= "pll_" #cname "_clk",	\ +		.pll_data	= &pll_##cname##_data,	\ +		.flags		= CLK_PLL,		\ +		.recalc		= clk_sspll_recalc,	\ +	} + +define_pll_clk(sys, 0, 0x1ff, 0x600); +define_pll_clk(tdm, 1, 0x0ff, 0x200); +define_pll_clk(eth, 2, 0x0ff, 0x400); + +/* Level 2 - divided outputs from the PLLs */ +#define define_pll_div_clk(pll, cname, div)		\ +	static struct clk pll##_##cname##_clk = {	\ +		.name		= #pll "_" #cname "_clk",\ +		.parent		= &pll_##pll##_clk,	\ +		.flags		= CLK_PLL,		\ +		.div_reg	= PLLDIV##div,		\ +	} + +define_pll_div_clk(sys, arm1176,	1); +define_pll_div_clk(sys, dsp,		2); +define_pll_div_clk(sys, ddr,		3); +define_pll_div_clk(sys, full,		4); +define_pll_div_clk(sys, lcd,		5); +define_pll_div_clk(sys, vlynq_ref,	6); +define_pll_div_clk(sys, tsc,		7); +define_pll_div_clk(sys, half,		8); + +define_pll_div_clk(eth, 5mhz,		1); +define_pll_div_clk(eth, 50mhz,		2); +define_pll_div_clk(eth, 125mhz,		3); +define_pll_div_clk(eth, 250mhz,		4); +define_pll_div_clk(eth, 25mhz,		5); + +define_pll_div_clk(tdm, 0,		1); +define_pll_div_clk(tdm, extra,		2); +define_pll_div_clk(tdm, 1,		3); + + +/* Level 3 - LPSC gated clocks */ +#define __lpsc_clk(cname, _parent, mod, flg)		\ +	static struct clk clk_##cname = {		\ +		.name		= #cname,		\ +		.parent		= &_parent,		\ +		.lpsc		= TNETV107X_LPSC_##mod,\ +		.flags		= flg,			\ +	} + +#define lpsc_clk_enabled(cname, parent, mod)		\ +	__lpsc_clk(cname, parent, mod, ALWAYS_ENABLED) + +#define lpsc_clk(cname, parent, mod)			\ +	__lpsc_clk(cname, parent, mod, 0) + +lpsc_clk_enabled(arm,		sys_arm1176_clk, ARM); +lpsc_clk_enabled(gem,		sys_dsp_clk,	GEM); +lpsc_clk_enabled(ddr2_phy,	sys_ddr_clk,	DDR2_PHY); +lpsc_clk_enabled(tpcc,		sys_full_clk,	TPCC); +lpsc_clk_enabled(tptc0,		sys_full_clk,	TPTC0); +lpsc_clk_enabled(tptc1,		sys_full_clk,	TPTC1); +lpsc_clk_enabled(ram,		sys_full_clk,	RAM); +lpsc_clk_enabled(aemif,		sys_full_clk,	AEMIF); +lpsc_clk_enabled(chipcfg,	sys_half_clk,	CHIP_CFG); +lpsc_clk_enabled(rom,		sys_half_clk,	ROM); +lpsc_clk_enabled(secctl,	sys_half_clk,	SECCTL); +lpsc_clk_enabled(keymgr,	sys_half_clk,	KEYMGR); +lpsc_clk_enabled(gpio,		sys_half_clk,	GPIO); +lpsc_clk_enabled(debugss,	sys_half_clk,	DEBUGSS); +lpsc_clk_enabled(system,	sys_half_clk,	SYSTEM); +lpsc_clk_enabled(ddr2_vrst,	sys_ddr_clk,	DDR2_EMIF1_VRST); +lpsc_clk_enabled(ddr2_vctl_rst,	sys_ddr_clk,	DDR2_EMIF2_VCTL_RST); +lpsc_clk_enabled(wdt_arm,	sys_half_clk,	WDT_ARM); + +lpsc_clk(mbx_lite,	sys_arm1176_clk,	MBX_LITE); +lpsc_clk(ethss,		eth_125mhz_clk,		ETHSS); +lpsc_clk(tsc,		sys_tsc_clk,		TSC); +lpsc_clk(uart0,		sys_half_clk,		UART0); +lpsc_clk(uart1,		sys_half_clk,		UART1); +lpsc_clk(uart2,		sys_half_clk,		UART2); +lpsc_clk(pktsec,	sys_half_clk,		PKTSEC); +lpsc_clk(keypad,	sys_half_clk,		KEYPAD); +lpsc_clk(mdio,		sys_half_clk,		MDIO); +lpsc_clk(sdio0,		sys_half_clk,		SDIO0); +lpsc_clk(sdio1,		sys_half_clk,		SDIO1); +lpsc_clk(timer0,	sys_half_clk,		TIMER0); +lpsc_clk(timer1,	sys_half_clk,		TIMER1); +lpsc_clk(wdt_dsp,	sys_half_clk,		WDT_DSP); +lpsc_clk(ssp,		sys_half_clk,		SSP); +lpsc_clk(tdm0,		tdm_0_clk,		TDM0); +lpsc_clk(tdm1,		tdm_1_clk,		TDM1); +lpsc_clk(vlynq,		sys_vlynq_ref_clk,	VLYNQ); +lpsc_clk(mcdma,		sys_half_clk,		MCDMA); +lpsc_clk(usb0,		sys_half_clk,		USB0); +lpsc_clk(usb1,		sys_half_clk,		USB1); +lpsc_clk(usbss,		sys_half_clk,		USBSS); +lpsc_clk(ethss_rgmii,	eth_250mhz_clk,		ETHSS_RGMII); +lpsc_clk(imcop,		sys_dsp_clk,		IMCOP); +lpsc_clk(spare,		sys_half_clk,		SPARE); + +/* LCD needs a full power down to clear controller state */ +__lpsc_clk(lcd, sys_lcd_clk, LCD, PSC_SWRSTDISABLE); + + +/* Level 4 - leaf clocks for LPSC modules shared across drivers */ +static struct clk clk_rng = { .name = "rng", .parent = &clk_pktsec }; +static struct clk clk_pka = { .name = "pka", .parent = &clk_pktsec }; + +static struct clk_lookup clks[] = { +	CLK(NULL,		"pll_sys_clk",		&pll_sys_clk), +	CLK(NULL,		"pll_eth_clk",		&pll_eth_clk), +	CLK(NULL,		"pll_tdm_clk",		&pll_tdm_clk), +	CLK(NULL,		"sys_arm1176_clk",	&sys_arm1176_clk), +	CLK(NULL,		"sys_dsp_clk",		&sys_dsp_clk), +	CLK(NULL,		"sys_ddr_clk",		&sys_ddr_clk), +	CLK(NULL,		"sys_full_clk",		&sys_full_clk), +	CLK(NULL,		"sys_lcd_clk",		&sys_lcd_clk), +	CLK(NULL,		"sys_vlynq_ref_clk",	&sys_vlynq_ref_clk), +	CLK(NULL,		"sys_tsc_clk",		&sys_tsc_clk), +	CLK(NULL,		"sys_half_clk",		&sys_half_clk), +	CLK(NULL,		"eth_5mhz_clk",		ð_5mhz_clk), +	CLK(NULL,		"eth_50mhz_clk",	ð_50mhz_clk), +	CLK(NULL,		"eth_125mhz_clk",	ð_125mhz_clk), +	CLK(NULL,		"eth_250mhz_clk",	ð_250mhz_clk), +	CLK(NULL,		"eth_25mhz_clk",	ð_25mhz_clk), +	CLK(NULL,		"tdm_0_clk",		&tdm_0_clk), +	CLK(NULL,		"tdm_extra_clk",	&tdm_extra_clk), +	CLK(NULL,		"tdm_1_clk",		&tdm_1_clk), +	CLK(NULL,		"clk_arm",		&clk_arm), +	CLK(NULL,		"clk_gem",		&clk_gem), +	CLK(NULL,		"clk_ddr2_phy",		&clk_ddr2_phy), +	CLK(NULL,		"clk_tpcc",		&clk_tpcc), +	CLK(NULL,		"clk_tptc0",		&clk_tptc0), +	CLK(NULL,		"clk_tptc1",		&clk_tptc1), +	CLK(NULL,		"clk_ram",		&clk_ram), +	CLK(NULL,		"clk_mbx_lite",		&clk_mbx_lite), +	CLK("tnetv107x-fb.0",	NULL,			&clk_lcd), +	CLK(NULL,		"clk_ethss",		&clk_ethss), +	CLK(NULL,		"aemif",		&clk_aemif), +	CLK(NULL,		"clk_chipcfg",		&clk_chipcfg), +	CLK("tnetv107x-ts.0",	NULL,			&clk_tsc), +	CLK(NULL,		"clk_rom",		&clk_rom), +	CLK(NULL,		"uart2",		&clk_uart2), +	CLK(NULL,		"clk_pktsec",		&clk_pktsec), +	CLK("tnetv107x-rng.0",	NULL,			&clk_rng), +	CLK("tnetv107x-pka.0",	NULL,			&clk_pka), +	CLK(NULL,		"clk_secctl",		&clk_secctl), +	CLK(NULL,		"clk_keymgr",		&clk_keymgr), +	CLK("tnetv107x-keypad.0", NULL,			&clk_keypad), +	CLK(NULL,		"clk_gpio",		&clk_gpio), +	CLK(NULL,		"clk_mdio",		&clk_mdio), +	CLK("davinci_mmc.0",	NULL,			&clk_sdio0), +	CLK(NULL,		"uart0",		&clk_uart0), +	CLK(NULL,		"uart1",		&clk_uart1), +	CLK(NULL,		"timer0",		&clk_timer0), +	CLK(NULL,		"timer1",		&clk_timer1), +	CLK("tnetv107x_wdt.0",	NULL,			&clk_wdt_arm), +	CLK(NULL,		"clk_wdt_dsp",		&clk_wdt_dsp), +	CLK("ti-ssp.0",		NULL,			&clk_ssp), +	CLK(NULL,		"clk_tdm0",		&clk_tdm0), +	CLK(NULL,		"clk_vlynq",		&clk_vlynq), +	CLK(NULL,		"clk_mcdma",		&clk_mcdma), +	CLK(NULL,		"clk_usb0",		&clk_usb0), +	CLK(NULL,		"clk_tdm1",		&clk_tdm1), +	CLK(NULL,		"clk_debugss",		&clk_debugss), +	CLK(NULL,		"clk_ethss_rgmii",	&clk_ethss_rgmii), +	CLK(NULL,		"clk_system",		&clk_system), +	CLK(NULL,		"clk_imcop",		&clk_imcop), +	CLK(NULL,		"clk_spare",		&clk_spare), +	CLK("davinci_mmc.1",	NULL,			&clk_sdio1), +	CLK(NULL,		"clk_usb1",		&clk_usb1), +	CLK(NULL,		"clk_usbss",		&clk_usbss), +	CLK(NULL,		"clk_ddr2_vrst",	&clk_ddr2_vrst), +	CLK(NULL,		"clk_ddr2_vctl_rst",	&clk_ddr2_vctl_rst), +	CLK(NULL,		NULL,			NULL), +}; + +static const struct mux_config pins[] = { +#ifdef CONFIG_DAVINCI_MUX +	MUX_CFG(TNETV107X, ASR_A00,		0, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO32,		0, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A01,		0, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO33,		0, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A02,		0, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO34,		0, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A03,		0, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO35,		0, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A04,		0, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO36,		0, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A05,		0, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO37,		0, 25, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A06,		1, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO38,		1, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A07,		1, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO39,		1, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A08,		1, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO40,		1, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A09,		1, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO41,		1, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A10,		1, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO42,		1, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A11,		1, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, BOOT_STRP_0,		1, 25, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A12,		2, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, BOOT_STRP_1,		2, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A13,		2, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO43,		2, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A14,		2, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO44,		2, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A15,		2, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO45,		2, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A16,		2, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO46,		2, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A17,		2, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO47,		2, 25, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_A18,		3, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO48,		3, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO1_DATA3_0,	3, 0, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_A19,		3, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO49,		3, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO1_DATA2_0,	3, 5, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_A20,		3, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO50,		3, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO1_DATA1_0,	3, 10, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_A21,		3, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO51,		3, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO1_DATA0_0,	3, 15, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_A22,		3, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO52,		3, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO1_CMD_0,		3, 20, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_A23,		3, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO53,		3, 25, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO1_CLK_0,		3, 25, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_BA_1,		4, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO54,		4, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SYS_PLL_CLK,		4, 0, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_CS0,		4, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, ASR_CS1,		4, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, ASR_CS2,		4, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM_PLL_CLK,		4, 15, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_CS3,		4, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, ETH_PHY_CLK,		4, 20, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, ASR_D00,		4, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO55,		4, 25, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D01,		5, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO56,		5, 0, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D02,		5, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO57,		5, 5, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D03,		5, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO58,		5, 10, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D04,		5, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO59_0,		5, 15, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D05,		5, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO60_0,		5, 20, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D06,		5, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO61_0,		5, 25, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D07,		6, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO62_0,		6, 0, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D08,		6, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO63_0,		6, 5, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D09,		6, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO64_0,		6, 10, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D10,		6, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SDIO1_DATA3_1,	6, 15, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D11,		6, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SDIO1_DATA2_1,	6, 20, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D12,		6, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SDIO1_DATA1_1,	6, 25, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D13,		7, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SDIO1_DATA0_1,	7, 0, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D14,		7, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SDIO1_CMD_1,		7, 5, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_D15,		7, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SDIO1_CLK_1,		7, 10, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_OE,		7, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, BOOT_STRP_2,		7, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_RNW,		7, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO29_0,		7, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_WAIT,		7, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO30_0,		7, 25, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_WE,		8, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, BOOT_STRP_3,		8, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, ASR_WE_DQM0,		8, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO31,		8, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD17_0,		8, 5, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, ASR_WE_DQM1,		8, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, ASR_BA0_0,		8, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, VLYNQ_CLK,		9, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO14,		9, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD19_0,		9, 0, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, VLYNQ_RXD0,		9, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO15,		9, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD20_0,		9, 5, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, VLYNQ_RXD1,		9, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO16,		9, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD21_0,		9, 10, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, VLYNQ_TXD0,		9, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO17,		9, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD22_0,		9, 15, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, VLYNQ_TXD1,		9, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO18,		9, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD23_0,		9, 20, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, SDIO0_CLK,		10, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO19,		10, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO0_CMD,		10, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO20,		10, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO0_DATA0,		10, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO21,		10, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO0_DATA1,		10, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO22,		10, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO0_DATA2,		10, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO23,		10, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SDIO0_DATA3,		10, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO24,		10, 25, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, EMU0,		11, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, EMU1,		11, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, RTCK,		12, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TRST_N,		12, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TCK,			12, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDI,			12, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDO,			12, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TMS,			12, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM1_CLK,		13, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM1_RX,		13, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM1_TX,		13, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM1_FS,		13, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_R0,		14, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_R1,		14, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_R2,		14, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_R3,		14, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_R4,		14, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_R5,		14, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_R6,		15, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO12,		15, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, KEYPAD_R7,		15, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO10,		15, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, KEYPAD_C0,		15, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_C1,		15, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_C2,		15, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_C3,		15, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_C4,		16, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_C5,		16, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, KEYPAD_C6,		16, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO13,		16, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, TEST_CLK_IN,		16, 10, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, KEYPAD_C7,		16, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO11,		16, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, SSP0_0,		17, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SCC_DCLK,		17, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD20_1,		17, 0, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, SSP0_1,		17, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SCC_CS_N,		17, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD21_1,		17, 5, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, SSP0_2,		17, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SCC_D,		17, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD22_1,		17, 10, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, SSP0_3,		17, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, SCC_RESETN,		17, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, LCD_PD23_1,		17, 15, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, SSP1_0,		18, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO25,		18, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, UART2_CTS,		18, 0, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, SSP1_1,		18, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO26,		18, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, UART2_RD,		18, 5, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, SSP1_2,		18, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO27,		18, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, UART2_RTS,		18, 10, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, SSP1_3,		18, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO28,		18, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, UART2_TD,		18, 15, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, UART0_CTS,		19, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, UART0_RD,		19, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, UART0_RTS,		19, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, UART0_TD,		19, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, UART1_RD,		19, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, UART1_TD,		19, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_AC_NCS,		20, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_HSYNC_RNW,	20, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_VSYNC_A0,	20, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_MCLK,		20, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD16_0,		20, 15, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PCLK_E,		20, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD00,		20, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD01,		21, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD02,		21, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD03,		21, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD04,		21, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD05,		21, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD06,		21, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD07,		22, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD08,		22, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO59_1,		22, 5, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PD09,		22, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO60_1,		22, 10, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PD10,		22, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, ASR_BA0_1,		22, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, GPIO61_1,		22, 15, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PD11,		22, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO62_1,		22, 20, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PD12,		22, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO63_1,		22, 25, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PD13,		23, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO64_1,		23, 0, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PD14,		23, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO29_1,		23, 5, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, LCD_PD15,		23, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO30_1,		23, 10, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, EINT0,		24, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO08,		24, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, EINT1,		24, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, GPIO09,		24, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, GPIO00,		24, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD20_2,		24, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, TDM_CLK_IN_2,	24, 10, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, GPIO01,		24, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD21_2,		24, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, 24M_CLK_OUT_1,	24, 15, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, GPIO02,		24, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD22_2,		24, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, GPIO03,		24, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD23_2,		24, 25, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, GPIO04,		25, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD16_1,		25, 0, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, USB0_RXERR,		25, 0, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, GPIO05,		25, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD17_1,		25, 5, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, TDM_CLK_IN_1,	25, 5, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, GPIO06,		25, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD18,		25, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, 24M_CLK_OUT_2,	25, 10, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, GPIO07,		25, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, LCD_PD19_1,		25, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, USB1_RXERR,		25, 15, 0x1f, 0x0c, false) +	MUX_CFG(TNETV107X, ETH_PLL_CLK,		25, 15, 0x1f, 0x1c, false) +	MUX_CFG(TNETV107X, MDIO,		26, 0, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, MDC,			26, 5, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, AIC_MUTE_STAT_N,	26, 10, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM0_CLK,		26, 10, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, AIC_HNS_EN_N,	26, 15, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM0_FS,		26, 15, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, AIC_HDS_EN_STAT_N,	26, 20, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM0_TX,		26, 20, 0x1f, 0x04, false) +	MUX_CFG(TNETV107X, AIC_HNF_EN_STAT_N,	26, 25, 0x1f, 0x00, false) +	MUX_CFG(TNETV107X, TDM0_RX,		26, 25, 0x1f, 0x04, false) +#endif +}; + +/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ +static u8 irq_prios[TNETV107X_N_CP_INTC_IRQ] = { +	/* fill in default priority 7 */ +	[0 ... (TNETV107X_N_CP_INTC_IRQ - 1)]	= 7, +	/* now override as needed, e.g. [xxx] = 5 */ +}; + +/* Contents of JTAG ID register used to identify exact cpu type */ +static struct davinci_id ids[] = { +	{ +		.variant	= 0x0, +		.part_no	= 0xb8a1, +		.manufacturer	= 0x017, +		.cpu_id		= DAVINCI_CPU_ID_TNETV107X, +		.name		= "tnetv107x rev1.0", +	}, +}; + +static struct davinci_timer_instance timer_instance[2] = { +	{ +		.base		= TNETV107X_TIMER0_BASE, +		.bottom_irq	= IRQ_TNETV107X_TIMER_0_TINT12, +		.top_irq	= IRQ_TNETV107X_TIMER_0_TINT34, +	}, +	{ +		.base		= TNETV107X_TIMER1_BASE, +		.bottom_irq	= IRQ_TNETV107X_TIMER_1_TINT12, +		.top_irq	= IRQ_TNETV107X_TIMER_1_TINT34, +	}, +}; + +static struct davinci_timer_info timer_info = { +	.timers		= timer_instance, +	.clockevent_id	= T0_BOT, +	.clocksource_id	= T0_TOP, +}; + +/* + * TNETV107X platforms do not use the static mappings from Davinci + * IO_PHYS/IO_VIRT. This SOC's interesting MMRs are at different addresses, + * and changing IO_PHYS would break away from existing Davinci SOCs. + * + * The primary impact of the current model is that IO_ADDRESS() is not to be + * used to map registers on TNETV107X. + * + * 1.	The first chunk is for INTC:  This needs to be mapped in via iotable + *	because ioremap() does not seem to be operational at the time when + *	irqs are initialized.  Without this, consistent dma init bombs. + * + * 2.	The second chunk maps in register areas that need to be populated into + *	davinci_soc_info.  Note that alignment restrictions come into play if + *	low-level debug is enabled (see note in <mach/tnetv107x.h>). + */ +static struct map_desc io_desc[] = { +	{	/* INTC */ +		.virtual	= IO_VIRT, +		.pfn		= __phys_to_pfn(TNETV107X_INTC_BASE), +		.length		= SZ_16K, +		.type		= MT_DEVICE +	}, +	{	/* Most of the rest */ +		.virtual	= TNETV107X_IO_VIRT, +		.pfn		= __phys_to_pfn(TNETV107X_IO_BASE), +		.length		= IO_SIZE - SZ_1M, +		.type		= MT_DEVICE +	}, +}; + +static unsigned long clk_sspll_recalc(struct clk *clk) +{ +	int		pll; +	unsigned long	mult = 0, prediv = 1, postdiv = 1; +	unsigned long	ref = OSC_FREQ_ONCHIP, ret; +	u32		tmp; + +	if (WARN_ON(!clk->pll_data)) +		return clk->rate; + +	if (!clk_ctrl_regs) { +		void __iomem *tmp; + +		tmp = ioremap(TNETV107X_CLOCK_CONTROL_BASE, SZ_4K); + +		if (WARN(!tmp, "failed ioremap for clock control regs\n")) +			return clk->parent ? clk->parent->rate : 0; + +		for (pll = 0; pll < N_PLLS; pll++) +			sspll_regs[pll] = tmp + sspll_regs_base[pll]; + +		clk_ctrl_regs = tmp; +	} + +	pll = clk->pll_data->num; + +	tmp = __raw_readl(&clk_ctrl_regs->pll_bypass); +	if (!(tmp & bypass_mask[pll])) { +		mult	= __raw_readl(&sspll_regs[pll]->mult_factor); +		prediv	= __raw_readl(&sspll_regs[pll]->pre_div) + 1; +		postdiv	= __raw_readl(&sspll_regs[pll]->post_div) + 1; +	} + +	tmp = __raw_readl(clk->pll_data->base + PLLCTL); +	if (tmp & PLLCTL_CLKMODE) +		ref = pll_ext_freq[pll]; + +	clk->pll_data->input_rate = ref; + +	tmp = __raw_readl(clk->pll_data->base + PLLCTL); +	if (!(tmp & PLLCTL_PLLEN)) +		return ref; + +	ret = ref; +	if (mult) +		ret += ((unsigned long long)ref * mult) / 256; + +	ret /= (prediv * postdiv); + +	return ret; +} + +static void tnetv107x_watchdog_reset(struct platform_device *pdev) +{ +	struct wdt_regs __iomem *regs; + +	regs = ioremap(pdev->resource[0].start, SZ_4K); + +	/* disable watchdog */ +	__raw_writel(0x7777, ®s->disable_lock); +	__raw_writel(0xcccc, ®s->disable_lock); +	__raw_writel(0xdddd, ®s->disable_lock); +	__raw_writel(0, ®s->disable); + +	/* program prescale */ +	__raw_writel(0x5a5a, ®s->prescale_lock); +	__raw_writel(0xa5a5, ®s->prescale_lock); +	__raw_writel(0, ®s->prescale); + +	/* program countdown */ +	__raw_writel(0x6666, ®s->change_lock); +	__raw_writel(0xbbbb, ®s->change_lock); +	__raw_writel(1, ®s->change); + +	/* enable watchdog */ +	__raw_writel(0x7777, ®s->disable_lock); +	__raw_writel(0xcccc, ®s->disable_lock); +	__raw_writel(0xdddd, ®s->disable_lock); +	__raw_writel(1, ®s->disable); + +	/* kick */ +	__raw_writel(0x5555, ®s->kick_lock); +	__raw_writel(0xaaaa, ®s->kick_lock); +	__raw_writel(1, ®s->kick); +} + +static struct davinci_soc_info tnetv107x_soc_info = { +	.io_desc		= io_desc, +	.io_desc_num		= ARRAY_SIZE(io_desc), +	.ids			= ids, +	.ids_num		= ARRAY_SIZE(ids), +	.jtag_id_reg		= TNETV107X_CHIP_CFG_BASE + 0x018, +	.cpu_clks		= clks, +	.psc_bases		= psc_regs, +	.psc_bases_num		= ARRAY_SIZE(psc_regs), +	.pinmux_base		= TNETV107X_CHIP_CFG_BASE + 0x150, +	.pinmux_pins		= pins, +	.pinmux_pins_num	= ARRAY_SIZE(pins), +	.intc_type		= DAVINCI_INTC_TYPE_CP_INTC, +	.intc_base		= TNETV107X_INTC_BASE, +	.intc_irq_prios		= irq_prios, +	.intc_irq_num		= TNETV107X_N_CP_INTC_IRQ, +	.intc_host_map		= intc_host_map, +	.gpio_base		= TNETV107X_GPIO_BASE, +	.gpio_type		= GPIO_TYPE_TNETV107X, +	.gpio_num		= TNETV107X_N_GPIO, +	.timer_info		= &timer_info, +	.serial_dev		= &tnetv107x_serial_device, +	.reset			= tnetv107x_watchdog_reset, +	.reset_device		= &tnetv107x_wdt_device, +}; + +void __init tnetv107x_init(void) +{ +	davinci_common_init(&tnetv107x_soc_info); +} diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 7f3039761d9..8bf3cec98cf 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c @@ -43,7 +43,8 @@ static unsigned long get_uart_rate(struct clk *clk);  static int set_keytchclk_rate(struct clk *clk, unsigned long rate);  static int set_div_rate(struct clk *clk, unsigned long rate); - +static int set_i2s_sclk_rate(struct clk *clk, unsigned long rate); +static int set_i2s_lrclk_rate(struct clk *clk, unsigned long rate);  static struct clk clk_xtali = {  	.rate		= EP93XX_EXT_CLK_RATE, @@ -112,6 +113,29 @@ static struct clk clk_video = {  	.set_rate	= set_div_rate,  }; +static struct clk clk_i2s_mclk = { +	.sw_locked	= 1, +	.enable_reg	= EP93XX_SYSCON_I2SCLKDIV, +	.enable_mask	= EP93XX_SYSCON_CLKDIV_ENABLE, +	.set_rate	= set_div_rate, +}; + +static struct clk clk_i2s_sclk = { +	.sw_locked	= 1, +	.parent		= &clk_i2s_mclk, +	.enable_reg	= EP93XX_SYSCON_I2SCLKDIV, +	.enable_mask	= EP93XX_SYSCON_I2SCLKDIV_SENA, +	.set_rate	= set_i2s_sclk_rate, +}; + +static struct clk clk_i2s_lrclk = { +	.sw_locked	= 1, +	.parent		= &clk_i2s_sclk, +	.enable_reg	= EP93XX_SYSCON_I2SCLKDIV, +	.enable_mask	= EP93XX_SYSCON_I2SCLKDIV_SENA, +	.set_rate	= set_i2s_lrclk_rate, +}; +  /* DMA Clocks */  static struct clk clk_m2p0 = {  	.parent		= &clk_h, @@ -191,6 +215,9 @@ static struct clk_lookup clocks[] = {  	INIT_CK("ep93xx-keypad",	NULL,		&clk_keypad),  	INIT_CK("ep93xx-fb",		NULL,		&clk_video),  	INIT_CK("ep93xx-spi.0",		NULL,		&clk_spi), +	INIT_CK("ep93xx-i2s",		"mclk",		&clk_i2s_mclk), +	INIT_CK("ep93xx-i2s",		"sclk",		&clk_i2s_sclk), +	INIT_CK("ep93xx-i2s",		"lrclk",	&clk_i2s_lrclk),  	INIT_CK(NULL,			"pwm_clk",	&clk_pwm),  	INIT_CK(NULL,			"m2p0",		&clk_m2p0),  	INIT_CK(NULL,			"m2p1",		&clk_m2p1), @@ -401,6 +428,44 @@ static int set_div_rate(struct clk *clk, unsigned long rate)  	return 0;  } +static int set_i2s_sclk_rate(struct clk *clk, unsigned long rate) +{ +	unsigned val = __raw_readl(clk->enable_reg); + +	if (rate == clk_i2s_mclk.rate / 2) +		ep93xx_syscon_swlocked_write(val & ~EP93XX_I2SCLKDIV_SDIV,  +					     clk->enable_reg); +	else if (rate == clk_i2s_mclk.rate / 4) +		ep93xx_syscon_swlocked_write(val | EP93XX_I2SCLKDIV_SDIV,  +					     clk->enable_reg); +	else +		return -EINVAL; + +	clk_i2s_sclk.rate = rate; +	return 0; +} + +static int set_i2s_lrclk_rate(struct clk *clk, unsigned long rate) +{ +	unsigned val = __raw_readl(clk->enable_reg) &  +		~EP93XX_I2SCLKDIV_LRDIV_MASK; +	 +	if (rate == clk_i2s_sclk.rate / 32) +		ep93xx_syscon_swlocked_write(val | EP93XX_I2SCLKDIV_LRDIV32, +					     clk->enable_reg); +	else if (rate == clk_i2s_sclk.rate / 64) +		ep93xx_syscon_swlocked_write(val | EP93XX_I2SCLKDIV_LRDIV64, +					     clk->enable_reg); +	else if (rate == clk_i2s_sclk.rate / 128) +		ep93xx_syscon_swlocked_write(val | EP93XX_I2SCLKDIV_LRDIV128, +					     clk->enable_reg); +	else +		return -EINVAL; + +	clk_i2s_lrclk.rate = rate; +	return 0; +} +  int clk_set_rate(struct clk *clk, unsigned long rate)  {  	if (clk->set_rate) diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 8e37a045188..4cb55d3902f 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -758,6 +758,73 @@ void ep93xx_keypad_release_gpio(struct platform_device *pdev)  }  EXPORT_SYMBOL(ep93xx_keypad_release_gpio); +/************************************************************************* + * EP93xx I2S audio peripheral handling + *************************************************************************/ +static struct resource ep93xx_i2s_resource[] = { +	{ +		.start	= EP93XX_I2S_PHYS_BASE, +		.end	= EP93XX_I2S_PHYS_BASE + 0x100 - 1, +		.flags	= IORESOURCE_MEM, +	}, +}; + +static struct platform_device ep93xx_i2s_device = { +	.name		= "ep93xx-i2s", +	.id		= -1, +	.num_resources	= ARRAY_SIZE(ep93xx_i2s_resource), +	.resource	= ep93xx_i2s_resource, +}; + +void __init ep93xx_register_i2s(void) +{ +	platform_device_register(&ep93xx_i2s_device); +} + +#define EP93XX_SYSCON_DEVCFG_I2S_MASK	(EP93XX_SYSCON_DEVCFG_I2SONSSP | \ +					 EP93XX_SYSCON_DEVCFG_I2SONAC97) + +#define EP93XX_I2SCLKDIV_MASK		(EP93XX_SYSCON_I2SCLKDIV_ORIDE | \ +					 EP93XX_SYSCON_I2SCLKDIV_SPOL) + +int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config) +{ +	unsigned val; + +	/* Sanity check */ +	if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK) +		return -EINVAL; +	if (i2s_config & ~EP93XX_I2SCLKDIV_MASK) +		return -EINVAL; + +	/* Must have only one of I2SONSSP/I2SONAC97 set */ +	if ((i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONSSP) == +	    (i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONAC97)) +		return -EINVAL; + +	ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2S_MASK); +	ep93xx_devcfg_set_bits(i2s_pins); + +	/* +	 * This is potentially racy with the clock api for i2s_mclk, sclk and  +	 * lrclk. Since the i2s driver is the only user of those clocks we +	 * rely on it to prevent parallel use of this function and the  +	 * clock api for the i2s clocks. +	 */ +	val = __raw_readl(EP93XX_SYSCON_I2SCLKDIV); +	val &= ~EP93XX_I2SCLKDIV_MASK; +	val |= i2s_config; +	ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV); + +	return 0; +} +EXPORT_SYMBOL(ep93xx_i2s_acquire); + +void ep93xx_i2s_release(void) +{ +	ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2S_MASK); +} +EXPORT_SYMBOL(ep93xx_i2s_release);  extern void ep93xx_gpio_init(void); diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index b1e096f0c2d..c54b3e56ba6 100644 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h @@ -93,6 +93,7 @@  /* APB peripherals */  #define EP93XX_TIMER_BASE		EP93XX_APB_IOMEM(0x00010000) +#define EP93XX_I2S_PHYS_BASE		EP93XX_APB_PHYS(0x00020000)  #define EP93XX_I2S_BASE			EP93XX_APB_IOMEM(0x00020000)  #define EP93XX_SECURITY_BASE		EP93XX_APB_IOMEM(0x00030000) @@ -194,6 +195,15 @@  #define EP93XX_SYSCON_CLKDIV_ESEL	(1<<14)  #define EP93XX_SYSCON_CLKDIV_PSEL	(1<<13)  #define EP93XX_SYSCON_CLKDIV_PDIV_SHIFT	8 +#define EP93XX_SYSCON_I2SCLKDIV		EP93XX_SYSCON_REG(0x8c) +#define EP93XX_SYSCON_I2SCLKDIV_SENA	(1<<31) +#define EP93XX_SYSCON_I2SCLKDIV_ORIDE   (1<<29) +#define EP93XX_SYSCON_I2SCLKDIV_SPOL	(1<<19) +#define EP93XX_I2SCLKDIV_SDIV		(1 << 16) +#define EP93XX_I2SCLKDIV_LRDIV32	(0 << 17) +#define EP93XX_I2SCLKDIV_LRDIV64	(1 << 17) +#define EP93XX_I2SCLKDIV_LRDIV128 	(2 << 17) +#define EP93XX_I2SCLKDIV_LRDIV_MASK 	(3 << 17)  #define EP93XX_SYSCON_KEYTCHCLKDIV	EP93XX_SYSCON_REG(0x90)  #define EP93XX_SYSCON_KEYTCHCLKDIV_TSEN	(1<<31)  #define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV	(1<<16) diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index a6c09176334..3330b36d79e 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h @@ -58,6 +58,9 @@ void ep93xx_pwm_release_gpio(struct platform_device *pdev);  void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data);  int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);  void ep93xx_keypad_release_gpio(struct platform_device *pdev); +void ep93xx_register_i2s(void); +int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config); +void ep93xx_i2s_release(void);  void ep93xx_init_devices(void);  extern struct sys_timer ep93xx_timer; diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index 38deaee4039..a12c8930129 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c @@ -157,6 +157,7 @@ static void __init snappercl15_init_machine(void)  	ep93xx_register_i2c(&snappercl15_i2c_gpio_data, snappercl15_i2c_data,  			    ARRAY_SIZE(snappercl15_i2c_data));  	ep93xx_register_fb(&snappercl15_fb_info); +	ep93xx_register_i2s();  	platform_device_register(&snappercl15_nand_device);  } diff --git a/arch/arm/mach-imx/dma-v1.c b/arch/arm/mach-imx/dma-v1.c index fd1d9197d06..3e8c47c63ba 100644 --- a/arch/arm/mach-imx/dma-v1.c +++ b/arch/arm/mach-imx/dma-v1.c @@ -310,7 +310,7 @@ imx_dma_setup_sg(int channel,  	imxdma->resbytes = dma_length;  	if (!sg || !sgcount) { -		printk(KERN_ERR "imxdma%d: imx_dma_setup_sg epty sg list\n", +		printk(KERN_ERR "imxdma%d: imx_dma_setup_sg empty sg list\n",  		       channel);  		return -EINVAL;  	} @@ -760,7 +760,6 @@ EXPORT_SYMBOL(imx_dma_free);   * @name: the driver/caller own non-%NULL identification   *   * This function tries to find a free channel in the specified priority group - * This function tries to find a free channel in the specified priority group   * if the priority cannot be achieved it tries to look for free channel   * in the higher and then even lower priority groups.   * diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 9dd67c7b445..1c82d4290da 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -25,6 +25,7 @@  #include <asm/mach/time.h>  #include <mach/kirkwood.h>  #include <mach/bridge-regs.h> +#include <plat/audio.h>  #include <plat/cache-feroceon-l2.h>  #include <plat/ehci-orion.h>  #include <plat/mvsdio.h> @@ -871,6 +872,42 @@ struct sys_timer kirkwood_timer = {  	.init = kirkwood_timer_init,  }; +/***************************************************************************** + * Audio + ****************************************************************************/ +static struct resource kirkwood_i2s_resources[] = { +	[0] = { +		.start  = AUDIO_PHYS_BASE, +		.end    = AUDIO_PHYS_BASE + SZ_16K - 1, +		.flags  = IORESOURCE_MEM, +	}, +	[1] = { +		.start  = IRQ_KIRKWOOD_I2S, +		.end    = IRQ_KIRKWOOD_I2S, +		.flags  = IORESOURCE_IRQ, +	}, +}; + +static struct kirkwood_asoc_platform_data kirkwood_i2s_data = { +	.dram        = &kirkwood_mbus_dram_info, +	.burst       = 128, +}; + +static struct platform_device kirkwood_i2s_device = { +	.name		= "kirkwood-i2s", +	.id		= -1, +	.num_resources	= ARRAY_SIZE(kirkwood_i2s_resources), +	.resource	= kirkwood_i2s_resources, +	.dev		= { +		.platform_data	= &kirkwood_i2s_data, +	}, +}; + +void __init kirkwood_audio_init(void) +{ +	kirkwood_clk_ctrl |= CGC_AUDIO; +	platform_device_register(&kirkwood_i2s_device); +}  /*****************************************************************************   * General @@ -939,6 +976,7 @@ void __init kirkwood_init(void)  	kirkwood_spi_plat_data.tclk = kirkwood_tclk;  	kirkwood_uart0_data[0].uartclk = kirkwood_tclk;  	kirkwood_uart1_data[0].uartclk = kirkwood_tclk; +	kirkwood_i2s_data.tclk = kirkwood_tclk;  	/*  	 * Disable propagation of mbus errors to the CPU local bus, diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 5b2c1c18d64..95bb0a73adf 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -17,6 +17,7 @@ struct mv_sata_platform_data;  struct mvsdio_platform_data;  struct mtd_partition;  struct mtd_info; +struct kirkwood_asoc_platform_data;  #define KW_PCIE0	(1 << 0)  #define KW_PCIE1	(1 << 1) @@ -46,6 +47,7 @@ void kirkwood_uart0_init(void);  void kirkwood_uart1_init(void);  void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);  void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *)); +void kirkwood_audio_init(void);  extern int kirkwood_tclk;  extern struct sys_timer kirkwood_timer; diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index d141af4c274..93fc2ec95e7 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h @@ -111,6 +111,9 @@  #define SDIO_PHYS_BASE		(KIRKWOOD_REGS_PHYS_BASE | 0x90000) +#define AUDIO_PHYS_BASE		(KIRKWOOD_REGS_PHYS_BASE | 0xA0000) +#define AUDIO_VIRT_BASE		(KIRKWOOD_REGS_VIRT_BASE | 0xA0000) +  /*   * Supported devices and revisions.   */ diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c index fd64cd2b4e0..fd06be61881 100644 --- a/arch/arm/mach-kirkwood/openrd-setup.c +++ b/arch/arm/mach-kirkwood/openrd-setup.c @@ -15,6 +15,7 @@  #include <linux/mtd/partitions.h>  #include <linux/ata_platform.h>  #include <linux/mv643xx_eth.h> +#include <linux/i2c.h>  #include <asm/mach-types.h>  #include <asm/mach/arch.h>  #include <mach/kirkwood.h> @@ -60,6 +61,12 @@ static unsigned int openrd_mpp_config[] __initdata = {  	0  }; +static struct i2c_board_info i2c_board_info[] __initdata = { +	{ +		I2C_BOARD_INFO("cs42l51", 0x4a), +	}, +}; +  static void __init openrd_init(void)  {  	/* @@ -86,6 +93,12 @@ static void __init openrd_init(void)  	kirkwood_sdio_init(&openrd_mvsdio_data);  	kirkwood_i2c_init(); + +	if (machine_is_openrd_client()) { +		i2c_register_board_info(0, i2c_board_info, +			ARRAY_SIZE(i2c_board_info)); +		kirkwood_audio_init(); +	}  }  static int __init openrd_pci_init(void) diff --git a/arch/arm/mach-msm/acpuclock-arm11.c b/arch/arm/mach-msm/acpuclock-arm11.c index af5e85b91d0..f060a3959a7 100644 --- a/arch/arm/mach-msm/acpuclock-arm11.c +++ b/arch/arm/mach-msm/acpuclock-arm11.c @@ -98,7 +98,7 @@ struct clkctl_acpu_speed {  /*   * ACPU speed table. Complete table is shown but certain speeds are commented - * out to optimized speed switching. Initalize loops_per_jiffy to 0. + * out to optimized speed switching. Initialize loops_per_jiffy to 0.   *   * Table stepping up/down is optimized for 256mhz jumps while staying on the   * same PLL. @@ -494,7 +494,7 @@ uint32_t acpuclk_get_switch_time(void)   * Clock driver initialization   *---------------------------------------------------------------------------*/ -/* Initalize the lpj field in the acpu_freq_tbl. */ +/* Initialize the lpj field in the acpu_freq_tbl. */  static void __init lpj_init(void)  {  	int i; diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index b32ccd954a1..ed8d330522f 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c @@ -463,7 +463,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)  	}  	if (!ret) {  		/* -		 * Switch the parent clock in the heirarchy, and make sure +		 * Switch the parent clock in the hierarchy, and make sure  		 * that the new parent's usecount is correct.  Note: we  		 * enable the new parent before disabling the old to avoid  		 * any unnecessary hardware disable->enable transitions. diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 87aa4c9597c..467aae24578 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c @@ -134,7 +134,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {  		.rx_irq		= INT_24XX_MCBSP1_IRQ_RX,  		.tx_irq		= INT_24XX_MCBSP1_IRQ_TX,  		.ops		= &omap2_mcbsp_ops, -		.buffer_size	= 0x6F, +		.buffer_size	= 0x80, /* The FIFO has 128 locations */  	},  	{  		.phys_base	= OMAP34XX_MCBSP2_BASE, @@ -144,7 +144,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {  		.rx_irq		= INT_24XX_MCBSP2_IRQ_RX,  		.tx_irq		= INT_24XX_MCBSP2_IRQ_TX,  		.ops		= &omap2_mcbsp_ops, -		.buffer_size	= 0x3FF, +		.buffer_size	= 0x500, /* The FIFO has 1024 + 256 locations */  	},  	{  		.phys_base	= OMAP34XX_MCBSP3_BASE, @@ -154,7 +154,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {  		.rx_irq		= INT_24XX_MCBSP3_IRQ_RX,  		.tx_irq		= INT_24XX_MCBSP3_IRQ_TX,  		.ops		= &omap2_mcbsp_ops, -		.buffer_size	= 0x6F, +		.buffer_size	= 0x80, /* The FIFO has 128 locations */  	},  	{  		.phys_base	= OMAP34XX_MCBSP4_BASE, @@ -163,7 +163,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {  		.rx_irq		= INT_24XX_MCBSP4_IRQ_RX,  		.tx_irq		= INT_24XX_MCBSP4_IRQ_TX,  		.ops		= &omap2_mcbsp_ops, -		.buffer_size	= 0x6F, +		.buffer_size	= 0x80, /* The FIFO has 128 locations */  	},  	{  		.phys_base	= OMAP34XX_MCBSP5_BASE, @@ -172,7 +172,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {  		.rx_irq		= INT_24XX_MCBSP5_IRQ_RX,  		.tx_irq		= INT_24XX_MCBSP5_IRQ_TX,  		.ops		= &omap2_mcbsp_ops, -		.buffer_size	= 0x6F, +		.buffer_size	= 0x80, /* The FIFO has 128 locations */  	},  };  #define OMAP34XX_MCBSP_PDATA_SZ		ARRAY_SIZE(omap34xx_mcbsp_pdata) diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index d522cd70bf5..ba53191ae4c 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -60,7 +60,7 @@  #define SDRC_DLLA_CTRL_V	OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)          .text -/* Function to aquire the semaphore in scratchpad */ +/* Function to acquire the semaphore in scratchpad */  ENTRY(lock_scratchpad_sem)  	stmfd	sp!, {lr}	@ save registers on stack  wait_sem: diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 5d5f330c5d9..16e682d5dbb 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c @@ -11,7 +11,7 @@   * published by the Free Software Foundation.   *   * ChangeLog: - *  2006 Pavel Machek <pavel@suse.cz> + *  2006 Pavel Machek <pavel@ucw.cz>   *  03-06-2004 John Lenz <lenz@cs.wisc.edu>   *  06-04-2002 Chris Larson <kergoth@digitalnemesis.net>   *  04-16-2001 Lineo Japan,Inc. ... diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index 5f34eb674d6..653b3e0ab7b 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c @@ -1561,13 +1561,6 @@ static void __init u300_init_check_chip(void)  	printk(KERN_INFO "Initializing U300 system on %s baseband chip " \  	       "(chip ID 0x%04x)\n", chipname, val); -#ifdef CONFIG_MACH_U300_BS26 -	if ((val & 0xFF00U) != 0xc800) { -		printk(KERN_ERR "Platform configured for BS25/BS26 " \ -		       "with DB3150 but %s detected, expect problems!", -		       chipname); -	} -#endif  #ifdef CONFIG_MACH_U300_BS330  	if ((val & 0xFF00U) != 0xd800) {  		printk(KERN_ERR "Platform configured for BS330 " \ diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c index 5f61fd45a0c..d92790140fe 100644 --- a/arch/arm/mach-u300/gpio.c +++ b/arch/arm/mach-u300/gpio.c @@ -523,7 +523,7 @@ static void gpio_set_initial_values(void)  	/*  	 * Put all pins that are set to either 'GPIO_OUT' or 'GPIO_NOT_USED' -	 * to output and 'GPIO_IN' to input for each port. And initalize +	 * to output and 'GPIO_IN' to input for each port. And initialize  	 * default value on outputs.  	 */  	for (i = 0; i < U300_GPIO_NUM_PORTS; i++) { diff --git a/arch/arm/plat-mxc/include/mach/ssi.h b/arch/arm/plat-mxc/include/mach/ssi.h index c34ded523f1..63f3c280423 100644 --- a/arch/arm/plat-mxc/include/mach/ssi.h +++ b/arch/arm/plat-mxc/include/mach/ssi.h @@ -10,6 +10,9 @@ struct imx_ssi_platform_data {  	unsigned int flags;  #define IMX_SSI_DMA            (1 << 0)  #define IMX_SSI_USE_AC97       (1 << 1) +#define IMX_SSI_NET            (1 << 2) +#define IMX_SSI_SYN            (1 << 3) +#define IMX_SSI_USE_I2S_SLAVE  (1 << 4)  	void (*ac97_reset) (struct snd_ac97 *ac97);  	void (*ac97_warm_reset)(struct snd_ac97 *ac97);  }; diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index 975744f10a5..b4ff6a11a8f 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h @@ -473,6 +473,7 @@ void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);  void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold);  u16 omap_mcbsp_get_max_tx_threshold(unsigned int id);  u16 omap_mcbsp_get_max_rx_threshold(unsigned int id); +u16 omap_mcbsp_get_fifo_size(unsigned int id);  u16 omap_mcbsp_get_tx_delay(unsigned int id);  u16 omap_mcbsp_get_rx_delay(unsigned int id);  int omap_mcbsp_get_dma_op_mode(unsigned int id); @@ -483,6 +484,7 @@ static inline void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)  { }  static inline u16 omap_mcbsp_get_max_tx_threshold(unsigned int id) { return 0; }  static inline u16 omap_mcbsp_get_max_rx_threshold(unsigned int id) { return 0; } +static inline u16 omap_mcbsp_get_fifo_size(unsigned int id) { return 0; }  static inline u16 omap_mcbsp_get_tx_delay(unsigned int id) { return 0; }  static inline u16 omap_mcbsp_get_rx_delay(unsigned int id) { return 0; }  static inline int omap_mcbsp_get_dma_op_mode(unsigned int id) { return 0; } diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index 7e669c9744d..e31496e35b0 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c @@ -481,9 +481,9 @@ int omap_st_is_enabled(unsigned int id)  EXPORT_SYMBOL(omap_st_is_enabled);  /* - * omap_mcbsp_set_tx_threshold configures how to deal - * with transmit threshold. the threshold value and handler can be - * configure in here. + * omap_mcbsp_set_rx_threshold configures the transmit threshold in words. + * The threshold parameter is 1 based, and it is converted (threshold - 1) + * for the THRSH2 register.   */  void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)  { @@ -498,14 +498,15 @@ void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)  	}  	mcbsp = id_to_mcbsp_ptr(id); -	MCBSP_WRITE(mcbsp, THRSH2, threshold); +	if (threshold && threshold <= mcbsp->max_tx_thres) +		MCBSP_WRITE(mcbsp, THRSH2, threshold - 1);  }  EXPORT_SYMBOL(omap_mcbsp_set_tx_threshold);  /* - * omap_mcbsp_set_rx_threshold configures how to deal - * with receive threshold. the threshold value and handler can be - * configure in here. + * omap_mcbsp_set_rx_threshold configures the receive threshold in words. + * The threshold parameter is 1 based, and it is converted (threshold - 1) + * for the THRSH1 register.   */  void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)  { @@ -520,7 +521,8 @@ void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)  	}  	mcbsp = id_to_mcbsp_ptr(id); -	MCBSP_WRITE(mcbsp, THRSH1, threshold); +	if (threshold && threshold <= mcbsp->max_rx_thres) +		MCBSP_WRITE(mcbsp, THRSH1, threshold - 1);  }  EXPORT_SYMBOL(omap_mcbsp_set_rx_threshold); @@ -560,8 +562,20 @@ u16 omap_mcbsp_get_max_rx_threshold(unsigned int id)  }  EXPORT_SYMBOL(omap_mcbsp_get_max_rx_threshold); -#define MCBSP2_FIFO_SIZE	0x500 /* 1024 + 256 locations */ -#define MCBSP1345_FIFO_SIZE	0x80  /* 128 locations */ +u16 omap_mcbsp_get_fifo_size(unsigned int id) +{ +	struct omap_mcbsp *mcbsp; + +	if (!omap_mcbsp_check_valid_id(id)) { +		printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); +		return -ENODEV; +	} +	mcbsp = id_to_mcbsp_ptr(id); + +	return mcbsp->pdata->buffer_size; +} +EXPORT_SYMBOL(omap_mcbsp_get_fifo_size); +  /*   * omap_mcbsp_get_tx_delay returns the number of used slots in the McBSP FIFO   */ @@ -580,10 +594,7 @@ u16 omap_mcbsp_get_tx_delay(unsigned int id)  	buffstat = MCBSP_READ(mcbsp, XBUFFSTAT);  	/* Number of slots are different in McBSP ports */ -	if (mcbsp->id == 2) -		return MCBSP2_FIFO_SIZE - buffstat; -	else -		return MCBSP1345_FIFO_SIZE - buffstat; +	return mcbsp->pdata->buffer_size - buffstat;  }  EXPORT_SYMBOL(omap_mcbsp_get_tx_delay); @@ -1683,8 +1694,16 @@ static inline void __devinit omap34xx_device_init(struct omap_mcbsp *mcbsp)  {  	mcbsp->dma_op_mode = MCBSP_DMA_MODE_ELEMENT;  	if (cpu_is_omap34xx()) { -		mcbsp->max_tx_thres = max_thres(mcbsp); -		mcbsp->max_rx_thres = max_thres(mcbsp); +		/* +		 * Initially configure the maximum thresholds to a safe value. +		 * The McBSP FIFO usage with these values should not go under +		 * 16 locations. +		 * If the whole FIFO without safety buffer is used, than there +		 * is a possibility that the DMA will be not able to push the +		 * new data on time, causing channel shifts in runtime. +		 */ +		mcbsp->max_tx_thres = max_thres(mcbsp) - 0x10; +		mcbsp->max_rx_thres = max_thres(mcbsp) - 0x10;  		/*  		 * REVISIT: Set dmap_op_mode to THRESHOLD as default  		 * for mcbsp2 instances. diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h new file mode 100644 index 00000000000..9cf1f781329 --- /dev/null +++ b/arch/arm/plat-orion/include/plat/audio.h @@ -0,0 +1,11 @@ +#ifndef __PLAT_AUDIO_H +#define __PLAT_AUDIO_H + +#include <linux/mbus.h> + +struct kirkwood_asoc_platform_data { +	u32 tclk; +	struct mbus_dram_target_info *dram; +	int burst; +}; +#endif diff --git a/arch/arm/plat-s3c24xx/clock.c b/arch/arm/plat-s3c24xx/clock.c index 8474d05274b..931d26d1a54 100644 --- a/arch/arm/plat-s3c24xx/clock.c +++ b/arch/arm/plat-s3c24xx/clock.c @@ -43,7 +43,7 @@  #include <plat/cpu.h>  #include <plat/pll.h> -/* initalise all the clocks */ +/* initialise all the clocks */  void __init_or_cpufreq s3c24xx_setup_clocks(unsigned long fclk,  					   unsigned long hclk, diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 8bf79f3efdf..90a20512d68 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c @@ -391,7 +391,7 @@ void __init s3c_disable_clocks(struct clk *clkp, int nr_clks)  		(clkp->enable)(clkp, 0);  } -/* initalise all the clocks */ +/* initialise all the clocks */  int __init s3c24xx_register_baseclocks(unsigned long xtal)  { diff --git a/arch/arm/plat-samsung/include/plat/keypad.h b/arch/arm/plat-samsung/include/plat/keypad.h new file mode 100644 index 00000000000..3a70c125fe5 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/keypad.h @@ -0,0 +1,43 @@ +/* + * Samsung Platform - Keypad platform data definitions + * + * Copyright (C) 2010 Samsung Electronics Co.Ltd + * Author: Joonyoung Shim <jy0922.shim@samsung.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. + */ + +#ifndef __PLAT_SAMSUNG_KEYPAD_H +#define __PLAT_SAMSUNG_KEYPAD_H + +#include <linux/input/matrix_keypad.h> + +#define SAMSUNG_MAX_ROWS	8 +#define SAMSUNG_MAX_COLS	8 + +/** + * struct samsung_keypad_platdata - Platform device data for Samsung Keypad. + * @keymap_data: pointer to &matrix_keymap_data. + * @rows: number of keypad row supported. + * @cols: number of keypad col supported. + * @no_autorepeat: disable key autorepeat. + * @wakeup: controls whether the device should be set up as wakeup source. + * @cfg_gpio: configure the GPIO. + * + * Initialisation data specific to either the machine or the platform + * for the device driver to use or call-back when configuring gpio. + */ +struct samsung_keypad_platdata { +	const struct matrix_keymap_data	*keymap_data; +	unsigned int rows; +	unsigned int cols; +	bool no_autorepeat; +	bool wakeup; + +	void (*cfg_gpio)(unsigned int rows, unsigned int cols); +}; + +#endif /* __PLAT_SAMSUNG_KEYPAD_H */ diff --git a/arch/arm/plat-spear/padmux.c b/arch/arm/plat-spear/padmux.c index d2aab3adcde..555eec6dc1c 100644 --- a/arch/arm/plat-spear/padmux.c +++ b/arch/arm/plat-spear/padmux.c @@ -66,7 +66,7 @@ static int pmx_mode_set(struct pmx_mode *mode)   * If peripheral is not supported by current mode then request is rejected.   * Conflicts between peripherals are not handled and peripherals will be   * enabled in the order they are present in pmx_dev array. - * In case of conflicts last peripheral enalbed will be present. + * In case of conflicts last peripheral enabled will be present.   * Returns -ve on Err otherwise 0   */  static int pmx_devs_enable(struct pmx_dev **devs, u8 count)  |