diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-01 16:05:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-01 16:05:40 -0500 |
commit | 13dda80e48439b446d0bc9bab34b91484bc8f533 (patch) | |
tree | e8037122d65fe2a5dd8f633a7648b2597640a2ce /arch/arm/mach-davinci/board-dm646x-evm.c | |
parent | 379e3a820da171cb1d97e8dccd736a69cebfb7c0 (diff) | |
parent | 5f19daa16ffca55db5b0253eba2bd0f71ee7f7f4 (diff) |
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.
...
Diffstat (limited to 'arch/arm/mach-davinci/board-dm646x-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-dm646x-evm.c | 143 |
1 files changed, 99 insertions, 44 deletions
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 8d0b0e01c59b..5ba3cb2daaa0 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/mtd/mtd.h> | 30 | #include <linux/mtd/mtd.h> |
31 | #include <linux/mtd/nand.h> | 31 | #include <linux/mtd/nand.h> |
32 | #include <linux/mtd/partitions.h> | 32 | #include <linux/mtd/partitions.h> |
33 | #include <linux/clk.h> | ||
33 | 34 | ||
34 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
35 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
@@ -39,54 +40,13 @@ | |||
39 | #include <mach/serial.h> | 40 | #include <mach/serial.h> |
40 | #include <mach/i2c.h> | 41 | #include <mach/i2c.h> |
41 | #include <mach/nand.h> | 42 | #include <mach/nand.h> |
43 | #include <mach/clock.h> | ||
44 | #include <mach/cdce949.h> | ||
42 | 45 | ||
43 | #if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \ | 46 | #include "clock.h" |
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 | ||
52 | 47 | ||
53 | #define NAND_BLOCK_SIZE SZ_128K | 48 | #define NAND_BLOCK_SIZE SZ_128K |
54 | 49 | ||
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 | |||
90 | /* Note: We are setting first partition as 'bootloader' constituting UBL, U-Boot | 50 | /* Note: We are setting first partition as 'bootloader' constituting UBL, U-Boot |
91 | * and U-Boot environment this avoids dependency on any particular combination | 51 | * and U-Boot environment this avoids dependency on any particular combination |
92 | * of UBL, U-Boot or flashing tools etc. | 52 | * of UBL, U-Boot or flashing tools etc. |
@@ -120,6 +80,9 @@ static struct davinci_nand_pdata davinci_nand_data = { | |||
120 | .options = 0, | 80 | .options = 0, |
121 | }; | 81 | }; |
122 | 82 | ||
83 | #define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x20008000 | ||
84 | #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x42000000 | ||
85 | |||
123 | static struct resource davinci_nand_resources[] = { | 86 | static struct resource davinci_nand_resources[] = { |
124 | { | 87 | { |
125 | .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE, | 88 | .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE, |
@@ -144,6 +107,17 @@ static struct platform_device davinci_nand_device = { | |||
144 | }, | 107 | }, |
145 | }; | 108 | }; |
146 | 109 | ||
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 | |||
147 | /* CPLD Register 0 Client: used for I/O Control */ | 121 | /* CPLD Register 0 Client: used for I/O Control */ |
148 | static int cpld_reg0_probe(struct i2c_client *client, | 122 | static int cpld_reg0_probe(struct i2c_client *client, |
149 | const struct i2c_device_id *id) | 123 | const struct i2c_device_id *id) |
@@ -417,6 +391,9 @@ static struct i2c_board_info __initdata i2c_info[] = { | |||
417 | { | 391 | { |
418 | I2C_BOARD_INFO("cpld_video", 0x3b), | 392 | I2C_BOARD_INFO("cpld_video", 0x3b), |
419 | }, | 393 | }, |
394 | { | ||
395 | I2C_BOARD_INFO("cdce949", 0x6c), | ||
396 | }, | ||
420 | }; | 397 | }; |
421 | 398 | ||
422 | static struct davinci_i2c_platform_data i2c_pdata = { | 399 | static struct davinci_i2c_platform_data i2c_pdata = { |
@@ -424,6 +401,30 @@ static struct davinci_i2c_platform_data i2c_pdata = { | |||
424 | .bus_delay = 0 /* usec */, | 401 | .bus_delay = 0 /* usec */, |
425 | }; | 402 | }; |
426 | 403 | ||
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 | |||
427 | static int set_vpif_clock(int mux_mode, int hd) | 428 | static int set_vpif_clock(int mux_mode, int hd) |
428 | { | 429 | { |
429 | unsigned long flags; | 430 | unsigned long flags; |
@@ -685,11 +686,44 @@ static void __init evm_init_i2c(void) | |||
685 | evm_init_video(); | 686 | evm_init_video(); |
686 | } | 687 | } |
687 | 688 | ||
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 | |||
688 | static void __init davinci_map_io(void) | 714 | static void __init davinci_map_io(void) |
689 | { | 715 | { |
690 | dm646x_init(); | 716 | dm646x_init(); |
717 | cdce_clk_init(); | ||
691 | } | 718 | } |
692 | 719 | ||
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 | |||
693 | static __init void evm_init(void) | 727 | static __init void evm_init(void) |
694 | { | 728 | { |
695 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 729 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
@@ -713,6 +747,17 @@ static __init void davinci_dm646x_evm_irq_init(void) | |||
713 | davinci_irq_init(); | 747 | davinci_irq_init(); |
714 | } | 748 | } |
715 | 749 | ||
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 | |||
716 | MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") | 761 | MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") |
717 | .phys_io = IO_PHYS, | 762 | .phys_io = IO_PHYS, |
718 | .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, | 763 | .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, |
@@ -723,3 +768,13 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") | |||
723 | .init_machine = evm_init, | 768 | .init_machine = evm_init, |
724 | MACHINE_END | 769 | MACHINE_END |
725 | 770 | ||
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 | |||