Skip to content

Commit 13dda80

Browse files
committed
Merge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci
* 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci: (40 commits) DaVinci DM365: Adding support for SPI EEPROM DaVinci DM365: Adding DM365 SPI support DaVinci DM355: Modifications to DM355 SPI support DaVinci: SPI: Adding header file for SPI support. davinci: dm646x: CDCE clocks: davinci_clk converted to clk_lookup davinci: clkdev cleanup: remove clk_lookup wrapper, use clkdev_add_table() DaVinci: DM365: Voice codec support for the DM365 SoC davinci: clock: let clk->set_rate function sleep Add SDA and SCL pin numbers to i2c platform data davinci: da8xx/omap-l1xx: Add EDMA platform data for da850/omap-l138 davinci: build list of unused EDMA events dynamically davinci: Fix edma_alloc_channel api for EDMA_CHANNEL_ANY case davinci: Keep count of channel controllers on a platform davinci: Correct return value of edma_alloc_channel api davinci: add CDCE949 support on DM6467 EVM davinci: add support for CDCE949 clock synthesizer davinci: da850/omap-l138 EVM: register for suspend support davinci: da850/omap-l138: add support for SoC suspend davinci: add power management support DaVinci: DM365: Changing default queue for DM365. ...
2 parents 379e3a8 + 5f19daa commit 13dda80

42 files changed

Lines changed: 1534 additions & 295 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/mach-davinci/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,14 @@ config MACH_DAVINCI_DM6467_EVM
9191
bool "TI DM6467 EVM"
9292
default ARCH_DAVINCI_DM646x
9393
depends on ARCH_DAVINCI_DM646x
94+
select MACH_DAVINCI_DM6467TEVM
9495
help
9596
Configure this option to specify the whether the board used
9697
for development is a DM6467 EVM
9798

99+
config MACH_DAVINCI_DM6467TEVM
100+
bool
101+
98102
config MACH_DAVINCI_DM365_EVM
99103
bool "TI DM365 EVM"
100104
default ARCH_DAVINCI_DM365

‎arch/arm/mach-davinci/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o
2626
obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o
2727
obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o
2828
obj-$(CONFIG_MACH_DM355_LEOPARD) += board-dm355-leopard.o
29-
obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o
29+
obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o cdce949.o
3030
obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o
3131
obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o
3232
obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o
3333

3434
# Power Management
3535
obj-$(CONFIG_CPU_FREQ) += cpufreq.o
3636
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
37+
obj-$(CONFIG_SUSPEND) += pm.o sleep.o

‎arch/arm/mach-davinci/board-da830-evm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static __init void da830_evm_usb_init(void)
112112
* Set up USB clock/mode in the CFGCHIP2 register.
113113
* FYI: CFGCHIP2 is 0x0000ef00 initially.
114114
*/
115-
cfgchip2 = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG));
115+
cfgchip2 = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
116116

117117
/* USB2.0 PHY reference clock is 24 MHz */
118118
cfgchip2 &= ~CFGCHIP2_REFFREQ;
@@ -139,7 +139,7 @@ static __init void da830_evm_usb_init(void)
139139
cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN;
140140
#endif
141141

142-
__raw_writel(cfgchip2, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG));
142+
__raw_writel(cfgchip2, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
143143

144144
/* USB_REFCLKIN is not used. */
145145
ret = davinci_cfg_reg(DA830_USB0_DRVVBUS);

‎arch/arm/mach-davinci/board-da850-evm.c‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,20 @@
4646

4747
static struct mtd_partition da850_evm_norflash_partition[] = {
4848
{
49-
.name = "NOR filesystem",
49+
.name = "bootloaders + env",
5050
.offset = 0,
51+
.size = SZ_512K,
52+
.mask_flags = MTD_WRITEABLE,
53+
},
54+
{
55+
.name = "kernel",
56+
.offset = MTDPART_OFS_APPEND,
57+
.size = SZ_2M,
58+
.mask_flags = 0,
59+
},
60+
{
61+
.name = "filesystem",
62+
.offset = MTDPART_OFS_APPEND,
5163
.size = MTDPART_SIZ_FULL,
5264
.mask_flags = 0,
5365
},
@@ -77,6 +89,18 @@ static struct platform_device da850_evm_norflash_device = {
7789
.resource = da850_evm_norflash_resource,
7890
};
7991

92+
static struct davinci_pm_config da850_pm_pdata = {
93+
.sleepcount = 128,
94+
};
95+
96+
static struct platform_device da850_pm_device = {
97+
.name = "pm-davinci",
98+
.dev = {
99+
.platform_data = &da850_pm_pdata,
100+
},
101+
.id = -1,
102+
};
103+
80104
/* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash
81105
* (128K blocks). It may be used instead of the (default) SPI flash
82106
* to boot, using TI's tools to install the secondary boot loader
@@ -119,6 +143,7 @@ static struct davinci_nand_pdata da850_evm_nandflash_data = {
119143
.parts = da850_evm_nandflash_partition,
120144
.nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition),
121145
.ecc_mode = NAND_ECC_HW,
146+
.ecc_bits = 4,
122147
.options = NAND_USE_FLASH_BBT,
123148
};
124149

@@ -537,7 +562,7 @@ static int __init da850_evm_config_emac(void)
537562
if (!machine_is_davinci_da850_evm())
538563
return 0;
539564

540-
cfg_chip3_base = DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG);
565+
cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG);
541566

542567
val = __raw_readl(cfg_chip3_base);
543568

@@ -696,6 +721,11 @@ static __init void da850_evm_init(void)
696721
if (ret)
697722
pr_warning("da850_evm_init: cpuidle registration failed: %d\n",
698723
ret);
724+
725+
ret = da850_register_pm(&da850_pm_device);
726+
if (ret)
727+
pr_warning("da850_evm_init: suspend registration failed: %d\n",
728+
ret);
699729
}
700730

701731
#ifdef CONFIG_SERIAL_8250_CONSOLE

‎arch/arm/mach-davinci/board-dm355-evm.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ static struct platform_device davinci_nand_device = {
111111
static struct davinci_i2c_platform_data i2c_pdata = {
112112
.bus_freq = 400 /* kHz */,
113113
.bus_delay = 0 /* usec */,
114+
.sda_pin = 15,
115+
.scl_pin = 14,
114116
};
115117

116118
static struct snd_platform_data dm355_evm_snd_data;

‎arch/arm/mach-davinci/board-dm365-evm.c‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <linux/mtd/partitions.h>
2525
#include <linux/mtd/nand.h>
2626
#include <linux/input.h>
27+
#include <linux/spi/spi.h>
28+
#include <linux/spi/eeprom.h>
2729

2830
#include <asm/mach-types.h>
2931
#include <asm/mach/arch.h>
@@ -571,6 +573,24 @@ static void __init dm365_evm_map_io(void)
571573
dm365_init();
572574
}
573575

576+
static struct spi_eeprom at25640 = {
577+
.byte_len = SZ_64K / 8,
578+
.name = "at25640",
579+
.page_size = 32,
580+
.flags = EE_ADDR2,
581+
};
582+
583+
static struct spi_board_info dm365_evm_spi_info[] __initconst = {
584+
{
585+
.modalias = "at25",
586+
.platform_data = &at25640,
587+
.max_speed_hz = 10 * 1000 * 1000,
588+
.bus_num = 0,
589+
.chip_select = 0,
590+
.mode = SPI_MODE_0,
591+
},
592+
};
593+
574594
static __init void dm365_evm_init(void)
575595
{
576596
evm_init_i2c();
@@ -587,6 +607,9 @@ static __init void dm365_evm_init(void)
587607
dm365_init_asp(&dm365_evm_snd_data);
588608
dm365_init_rtc();
589609
dm365_init_ks(&dm365evm_ks_data);
610+
611+
dm365_init_spi0(BIT(0), dm365_evm_spi_info,
612+
ARRAY_SIZE(dm365_evm_spi_info));
590613
}
591614

592615
static __init void dm365_evm_irq_init(void)

‎arch/arm/mach-davinci/board-dm644x-evm.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ static struct i2c_board_info __initdata i2c_info[] = {
629629
static struct davinci_i2c_platform_data i2c_pdata = {
630630
.bus_freq = 20 /* kHz */,
631631
.bus_delay = 100 /* usec */,
632+
.sda_pin = 44,
633+
.scl_pin = 43,
632634
};
633635

634636
static void __init evm_init_i2c(void)

‎arch/arm/mach-davinci/board-dm646x-evm.c‎

Lines changed: 99 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/mtd/mtd.h>
3131
#include <linux/mtd/nand.h>
3232
#include <linux/mtd/partitions.h>
33+
#include <linux/clk.h>
3334

3435
#include <asm/mach-types.h>
3536
#include <asm/mach/arch.h>
@@ -39,54 +40,13 @@
3940
#include <mach/serial.h>
4041
#include <mach/i2c.h>
4142
#include <mach/nand.h>
43+
#include <mach/clock.h>
44+
#include <mach/cdce949.h>
4245

43-
#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
44-
defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
45-
#define HAS_ATA 1
46-
#else
47-
#define HAS_ATA 0
48-
#endif
49-
50-
#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x20008000
51-
#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x42000000
46+
#include "clock.h"
5247

5348
#define NAND_BLOCK_SIZE SZ_128K
5449

55-
/* CPLD Register 0 bits to control ATA */
56-
#define DM646X_EVM_ATA_RST BIT(0)
57-
#define DM646X_EVM_ATA_PWD BIT(1)
58-
59-
#define DM646X_EVM_PHY_MASK (0x2)
60-
#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
61-
62-
#define VIDCLKCTL_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x38)
63-
#define VSCLKDIS_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x6c)
64-
#define VCH2CLK_MASK (BIT_MASK(10) | BIT_MASK(9) | BIT_MASK(8))
65-
#define VCH2CLK_SYSCLK8 (BIT(9))
66-
#define VCH2CLK_AUXCLK (BIT(9) | BIT(8))
67-
#define VCH3CLK_MASK (BIT_MASK(14) | BIT_MASK(13) | BIT_MASK(12))
68-
#define VCH3CLK_SYSCLK8 (BIT(13))
69-
#define VCH3CLK_AUXCLK (BIT(14) | BIT(13))
70-
71-
#define VIDCH2CLK (BIT(10))
72-
#define VIDCH3CLK (BIT(11))
73-
#define VIDCH1CLK (BIT(4))
74-
#define TVP7002_INPUT (BIT(4))
75-
#define TVP5147_INPUT (~BIT(4))
76-
#define VPIF_INPUT_ONE_CHANNEL (BIT(5))
77-
#define VPIF_INPUT_TWO_CHANNEL (~BIT(5))
78-
#define TVP5147_CH0 "tvp514x-0"
79-
#define TVP5147_CH1 "tvp514x-1"
80-
81-
static void __iomem *vpif_vidclkctl_reg;
82-
static void __iomem *vpif_vsclkdis_reg;
83-
/* spin lock for updating above registers */
84-
static spinlock_t vpif_reg_lock;
85-
86-
static struct davinci_uart_config uart_config __initdata = {
87-
.enabled_uarts = (1 << 0),
88-
};
89-
9050
/* Note: We are setting first partition as 'bootloader' constituting UBL, U-Boot
9151
* and U-Boot environment this avoids dependency on any particular combination
9252
* of UBL, U-Boot or flashing tools etc.
@@ -120,6 +80,9 @@ static struct davinci_nand_pdata davinci_nand_data = {
12080
.options = 0,
12181
};
12282

83+
#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x20008000
84+
#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x42000000
85+
12386
static struct resource davinci_nand_resources[] = {
12487
{
12588
.start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
@@ -144,6 +107,17 @@ static struct platform_device davinci_nand_device = {
144107
},
145108
};
146109

110+
#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
111+
defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
112+
#define HAS_ATA 1
113+
#else
114+
#define HAS_ATA 0
115+
#endif
116+
117+
/* CPLD Register 0 bits to control ATA */
118+
#define DM646X_EVM_ATA_RST BIT(0)
119+
#define DM646X_EVM_ATA_PWD BIT(1)
120+
147121
/* CPLD Register 0 Client: used for I/O Control */
148122
static int cpld_reg0_probe(struct i2c_client *client,
149123
const struct i2c_device_id *id)
@@ -417,13 +391,40 @@ static struct i2c_board_info __initdata i2c_info[] = {
417391
{
418392
I2C_BOARD_INFO("cpld_video", 0x3b),
419393
},
394+
{
395+
I2C_BOARD_INFO("cdce949", 0x6c),
396+
},
420397
};
421398

422399
static struct davinci_i2c_platform_data i2c_pdata = {
423400
.bus_freq = 100 /* kHz */,
424401
.bus_delay = 0 /* usec */,
425402
};
426403

404+
#define VIDCLKCTL_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x38)
405+
#define VSCLKDIS_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x6c)
406+
#define VCH2CLK_MASK (BIT_MASK(10) | BIT_MASK(9) | BIT_MASK(8))
407+
#define VCH2CLK_SYSCLK8 (BIT(9))
408+
#define VCH2CLK_AUXCLK (BIT(9) | BIT(8))
409+
#define VCH3CLK_MASK (BIT_MASK(14) | BIT_MASK(13) | BIT_MASK(12))
410+
#define VCH3CLK_SYSCLK8 (BIT(13))
411+
#define VCH3CLK_AUXCLK (BIT(14) | BIT(13))
412+
413+
#define VIDCH2CLK (BIT(10))
414+
#define VIDCH3CLK (BIT(11))
415+
#define VIDCH1CLK (BIT(4))
416+
#define TVP7002_INPUT (BIT(4))
417+
#define TVP5147_INPUT (~BIT(4))
418+
#define VPIF_INPUT_ONE_CHANNEL (BIT(5))
419+
#define VPIF_INPUT_TWO_CHANNEL (~BIT(5))
420+
#define TVP5147_CH0 "tvp514x-0"
421+
#define TVP5147_CH1 "tvp514x-1"
422+
423+
static void __iomem *vpif_vidclkctl_reg;
424+
static void __iomem *vpif_vsclkdis_reg;
425+
/* spin lock for updating above registers */
426+
static spinlock_t vpif_reg_lock;
427+
427428
static int set_vpif_clock(int mux_mode, int hd)
428429
{
429430
unsigned long flags;
@@ -685,11 +686,44 @@ static void __init evm_init_i2c(void)
685686
evm_init_video();
686687
}
687688

689+
#define CDCE949_XIN_RATE 27000000
690+
691+
/* CDCE949 support - "lpsc" field is overridden to work as clock number */
692+
static struct clk cdce_clk_in = {
693+
.name = "cdce_xin",
694+
.rate = CDCE949_XIN_RATE,
695+
};
696+
697+
static struct clk_lookup cdce_clks[] = {
698+
CLK(NULL, "xin", &cdce_clk_in),
699+
CLK(NULL, NULL, NULL),
700+
};
701+
702+
static void __init cdce_clk_init(void)
703+
{
704+
struct clk_lookup *c;
705+
struct clk *clk;
706+
707+
for (c = cdce_clks; c->clk; c++) {
708+
clk = c->clk;
709+
clkdev_add(c);
710+
clk_register(clk);
711+
}
712+
}
713+
688714
static void __init davinci_map_io(void)
689715
{
690716
dm646x_init();
717+
cdce_clk_init();
691718
}
692719

720+
static struct davinci_uart_config uart_config __initdata = {
721+
.enabled_uarts = (1 << 0),
722+
};
723+
724+
#define DM646X_EVM_PHY_MASK (0x2)
725+
#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
726+
693727
static __init void evm_init(void)
694728
{
695729
struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -713,6 +747,17 @@ static __init void davinci_dm646x_evm_irq_init(void)
713747
davinci_irq_init();
714748
}
715749

750+
#define DM646X_EVM_REF_FREQ 27000000
751+
#define DM6467T_EVM_REF_FREQ 33000000
752+
753+
void __init dm646x_board_setup_refclk(struct clk *clk)
754+
{
755+
if (machine_is_davinci_dm6467tevm())
756+
clk->rate = DM6467T_EVM_REF_FREQ;
757+
else
758+
clk->rate = DM646X_EVM_REF_FREQ;
759+
}
760+
716761
MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
717762
.phys_io = IO_PHYS,
718763
.io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
@@ -723,3 +768,13 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
723768
.init_machine = evm_init,
724769
MACHINE_END
725770

771+
MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
772+
.phys_io = IO_PHYS,
773+
.io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
774+
.boot_params = (0x80000100),
775+
.map_io = davinci_map_io,
776+
.init_irq = davinci_dm646x_evm_irq_init,
777+
.timer = &davinci_timer,
778+
.init_machine = evm_init,
779+
MACHINE_END
780+

0 commit comments

Comments
 (0)