Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6

+187 -25
+37 -21
arch/arm/mach-mx25/clock.c
··· 119 119 return get_rate_per(8); 120 120 } 121 121 122 + static unsigned long get_rate_gpt(struct clk *clk) 123 + { 124 + return get_rate_per(5); 125 + } 126 + 122 127 static unsigned long get_rate_otg(struct clk *clk) 123 128 { 124 129 return 48000000; /* FIXME */ ··· 149 144 __raw_writel(reg, clk->enable_reg); 150 145 } 151 146 152 - #define DEFINE_CLOCK(name, i, er, es, gr, sr) \ 147 + #define DEFINE_CLOCK(name, i, er, es, gr, sr, s) \ 153 148 static struct clk name = { \ 154 149 .id = i, \ 155 150 .enable_reg = CRM_BASE + er, \ ··· 158 153 .set_rate = sr, \ 159 154 .enable = clk_cgcr_enable, \ 160 155 .disable = clk_cgcr_disable, \ 156 + .secondary = s, \ 161 157 } 162 158 163 - DEFINE_CLOCK(gpt_clk, 0, CCM_CGCR0, 5, get_rate_ipg, NULL); 164 - DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL); 165 - DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL); 166 - DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL); 167 - DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL); 168 - DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL); 169 - DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL); 170 - DEFINE_CLOCK(uart4_clk, 0, CCM_CGCR2, 17, get_rate_uart, NULL); 171 - DEFINE_CLOCK(uart5_clk, 0, CCM_CGCR2, 18, get_rate_uart, NULL); 172 - DEFINE_CLOCK(nfc_clk, 0, CCM_CGCR0, 8, get_rate_nfc, NULL); 173 - DEFINE_CLOCK(usbotg_clk, 0, CCM_CGCR0, 28, get_rate_otg, NULL); 174 - DEFINE_CLOCK(pwm1_clk, 0, CCM_CGCR1, 31, get_rate_ipg, NULL); 175 - DEFINE_CLOCK(pwm2_clk, 0, CCM_CGCR2, 0, get_rate_ipg, NULL); 176 - DEFINE_CLOCK(pwm3_clk, 0, CCM_CGCR2, 1, get_rate_ipg, NULL); 177 - DEFINE_CLOCK(pwm4_clk, 0, CCM_CGCR2, 2, get_rate_ipg, NULL); 178 - DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL); 179 - DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL); 180 - DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL); 181 - DEFINE_CLOCK(fec_clk, 0, CCM_CGCR0, 23, get_rate_ipg, NULL); 159 + DEFINE_CLOCK(gpt_clk, 0, CCM_CGCR0, 5, get_rate_gpt, NULL, NULL); 160 + DEFINE_CLOCK(uart_per_clk, 0, CCM_CGCR0, 15, get_rate_uart, NULL, NULL); 161 + DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL, NULL); 162 + DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); 163 + DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); 164 + DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); 165 + DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk); 166 + DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk); 167 + DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk); 168 + DEFINE_CLOCK(uart4_clk, 0, CCM_CGCR2, 17, get_rate_uart, NULL, &uart_per_clk); 169 + DEFINE_CLOCK(uart5_clk, 0, CCM_CGCR2, 18, get_rate_uart, NULL, &uart_per_clk); 170 + DEFINE_CLOCK(nfc_clk, 0, CCM_CGCR0, 8, get_rate_nfc, NULL, NULL); 171 + DEFINE_CLOCK(usbotg_clk, 0, CCM_CGCR0, 28, get_rate_otg, NULL, NULL); 172 + DEFINE_CLOCK(pwm1_clk, 0, CCM_CGCR1, 31, get_rate_ipg, NULL, NULL); 173 + DEFINE_CLOCK(pwm2_clk, 0, CCM_CGCR2, 0, get_rate_ipg, NULL, NULL); 174 + DEFINE_CLOCK(pwm3_clk, 0, CCM_CGCR2, 1, get_rate_ipg, NULL, NULL); 175 + DEFINE_CLOCK(pwm4_clk, 0, CCM_CGCR2, 2, get_rate_ipg, NULL, NULL); 176 + DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL, NULL); 177 + DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL, NULL); 178 + DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL); 179 + DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk); 182 180 183 181 #define _REGISTER_CLOCK(d, n, c) \ 184 182 { \ ··· 216 208 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 217 209 }; 218 210 219 - int __init mx25_clocks_init(unsigned long fref) 211 + int __init mx25_clocks_init(void) 220 212 { 221 213 int i; 222 214 223 215 for (i = 0; i < ARRAY_SIZE(lookups); i++) 224 216 clkdev_add(&lookups[i]); 217 + 218 + /* Turn off all clocks except the ones we need to survive, namely: 219 + * EMI, GPIO1-3 (CCM_CGCR1[18:16]), GPT1, IOMUXC (CCM_CGCR1[27]), IIM, 220 + * SCC 221 + */ 222 + __raw_writel((1 << 19), CRM_BASE + CCM_CGCR0); 223 + __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1); 224 + __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2); 225 225 226 226 mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); 227 227
+1 -1
arch/arm/mach-mx25/mx25pdk.c
··· 91 91 92 92 static void __init mx25pdk_timer_init(void) 93 93 { 94 - mx25_clocks_init(26000000); 94 + mx25_clocks_init(); 95 95 } 96 96 97 97 static struct sys_timer mx25pdk_timer = {
+4
arch/arm/mach-mx3/mx31ads.c
··· 173 173 } 174 174 175 175 static struct irq_chip expio_irq_chip = { 176 + .name = "EXPIO(CPLD)", 176 177 .ack = expio_ack_irq, 177 178 .mask = expio_mask_irq, 178 179 .unmask = expio_unmask_irq, ··· 303 302 .min_uV = 2800000, 304 303 .max_uV = 2800000, 305 304 .valid_modes_mask = REGULATOR_MODE_NORMAL, 305 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 306 306 .apply_uV = 1, 307 307 }, 308 308 }; ··· 324 322 .min_uV = 3300000, 325 323 .max_uV = 3300000, 326 324 .valid_modes_mask = REGULATOR_MODE_NORMAL, 325 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 327 326 .apply_uV = 1, 328 327 }, 329 328 .num_consumer_supplies = ARRAY_SIZE(ldo2_consumers), ··· 462 459 463 460 static struct wm8350_platform_data __initdata mx31_wm8350_pdata = { 464 461 .init = mx31_wm8350_init, 462 + .irq_base = MXC_BOARD_IRQ_START + MXC_MAX_EXP_IO_LINES, 465 463 }; 466 464 #endif 467 465
+137
arch/arm/plat-mxc/audmux-v2.c
··· 23 23 #include <linux/err.h> 24 24 #include <linux/io.h> 25 25 #include <linux/clk.h> 26 + #include <linux/debugfs.h> 26 27 #include <mach/audmux.h> 27 28 #include <mach/hardware.h> 28 29 ··· 32 31 33 32 #define MXC_AUDMUX_V2_PTCR(x) ((x) * 8) 34 33 #define MXC_AUDMUX_V2_PDCR(x) ((x) * 8 + 4) 34 + 35 + #ifdef CONFIG_DEBUG_FS 36 + static struct dentry *audmux_debugfs_root; 37 + 38 + static int audmux_open_file(struct inode *inode, struct file *file) 39 + { 40 + file->private_data = inode->i_private; 41 + return 0; 42 + } 43 + 44 + /* There is an annoying discontinuity in the SSI numbering with regard 45 + * to the Linux number of the devices */ 46 + static const char *audmux_port_string(int port) 47 + { 48 + switch (port) { 49 + case MX31_AUDMUX_PORT1_SSI0: 50 + return "imx-ssi.0"; 51 + case MX31_AUDMUX_PORT2_SSI1: 52 + return "imx-ssi.1"; 53 + case MX31_AUDMUX_PORT3_SSI_PINS_3: 54 + return "SSI3"; 55 + case MX31_AUDMUX_PORT4_SSI_PINS_4: 56 + return "SSI4"; 57 + case MX31_AUDMUX_PORT5_SSI_PINS_5: 58 + return "SSI5"; 59 + case MX31_AUDMUX_PORT6_SSI_PINS_6: 60 + return "SSI6"; 61 + default: 62 + return "UNKNOWN"; 63 + } 64 + } 65 + 66 + static ssize_t audmux_read_file(struct file *file, char __user *user_buf, 67 + size_t count, loff_t *ppos) 68 + { 69 + ssize_t ret; 70 + char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); 71 + int port = (int)file->private_data; 72 + u32 pdcr, ptcr; 73 + 74 + if (!buf) 75 + return -ENOMEM; 76 + 77 + if (audmux_clk) 78 + clk_enable(audmux_clk); 79 + 80 + ptcr = readl(audmux_base + MXC_AUDMUX_V2_PTCR(port)); 81 + pdcr = readl(audmux_base + MXC_AUDMUX_V2_PDCR(port)); 82 + 83 + if (audmux_clk) 84 + clk_disable(audmux_clk); 85 + 86 + ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", 87 + pdcr, ptcr); 88 + 89 + if (ptcr & MXC_AUDMUX_V2_PTCR_TFSDIR) 90 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 91 + "TxFS output from %s, ", 92 + audmux_port_string((ptcr >> 27) & 0x7)); 93 + else 94 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 95 + "TxFS input, "); 96 + 97 + if (ptcr & MXC_AUDMUX_V2_PTCR_TCLKDIR) 98 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 99 + "TxClk output from %s", 100 + audmux_port_string((ptcr >> 22) & 0x7)); 101 + else 102 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 103 + "TxClk input"); 104 + 105 + ret += snprintf(buf + ret, PAGE_SIZE - ret, "\n"); 106 + 107 + if (ptcr & MXC_AUDMUX_V2_PTCR_SYN) { 108 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 109 + "Port is symmetric"); 110 + } else { 111 + if (ptcr & MXC_AUDMUX_V2_PTCR_RFSDIR) 112 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 113 + "RxFS output from %s, ", 114 + audmux_port_string((ptcr >> 17) & 0x7)); 115 + else 116 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 117 + "RxFS input, "); 118 + 119 + if (ptcr & MXC_AUDMUX_V2_PTCR_RCLKDIR) 120 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 121 + "RxClk output from %s", 122 + audmux_port_string((ptcr >> 12) & 0x7)); 123 + else 124 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 125 + "RxClk input"); 126 + } 127 + 128 + ret += snprintf(buf + ret, PAGE_SIZE - ret, 129 + "\nData received from %s\n", 130 + audmux_port_string((pdcr >> 13) & 0x7)); 131 + 132 + ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret); 133 + 134 + kfree(buf); 135 + 136 + return ret; 137 + } 138 + 139 + static const struct file_operations audmux_debugfs_fops = { 140 + .open = audmux_open_file, 141 + .read = audmux_read_file, 142 + }; 143 + 144 + static void audmux_debugfs_init(void) 145 + { 146 + int i; 147 + char buf[20]; 148 + 149 + audmux_debugfs_root = debugfs_create_dir("audmux", NULL); 150 + if (!audmux_debugfs_root) { 151 + pr_warning("Failed to create AUDMUX debugfs root\n"); 152 + return; 153 + } 154 + 155 + for (i = 1; i < 8; i++) { 156 + snprintf(buf, sizeof(buf), "ssi%d", i); 157 + if (!debugfs_create_file(buf, 0444, audmux_debugfs_root, 158 + (void *)i, &audmux_debugfs_fops)) 159 + pr_warning("Failed to create AUDMUX port %d debugfs file\n", 160 + i); 161 + } 162 + } 163 + #else 164 + static inline void audmux_debugfs_init(void) 165 + { 166 + } 167 + #endif 35 168 36 169 int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr, 37 170 unsigned int pdcr) ··· 202 67 203 68 if (cpu_is_mx31() || cpu_is_mx35()) 204 69 audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR); 70 + 71 + audmux_debugfs_init(); 205 72 206 73 return 0; 207 74 }
+1 -1
arch/arm/plat-mxc/include/mach/board-mx31lite.h
··· 25 25 26 26 #ifndef __ASSEMBLY__ 27 27 28 - enum mx31lilly_boards { 28 + enum mx31lite_boards { 29 29 MX31LITE_NOBOARD = 0, 30 30 MX31LITE_DB = 1, 31 31 };
+1 -1
arch/arm/plat-mxc/include/mach/common.h
··· 32 32 extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); 33 33 extern int mx1_clocks_init(unsigned long fref); 34 34 extern int mx21_clocks_init(unsigned long lref, unsigned long fref); 35 - extern int mx25_clocks_init(unsigned long fref); 35 + extern int mx25_clocks_init(void); 36 36 extern int mx27_clocks_init(unsigned long fref); 37 37 extern int mx31_clocks_init(unsigned long fref); 38 38 extern int mx35_clocks_init(void);
+1 -1
arch/arm/plat-mxc/include/mach/iomux-mx35.h
··· 671 671 #define MX35_PAD_LD8__SDMA_SDMA_DEBUG_PC_8 IOMUX_PAD(0x634, 0x1d0, 6, 0x0, 0, NO_PAD_CTRL) 672 672 673 673 #define MX35_PAD_LD9__IPU_DISPB_DAT_9 IOMUX_PAD(0x638, 0x1d4, 0, 0x0, 0, NO_PAD_CTRL) 674 - #define MX35_PAD_LD9__GPIO2_9 IOMUX_PAD(0x638, 0x1d4, 5, 0x8e4 0, NO_PAD_CTRL) 674 + #define MX35_PAD_LD9__GPIO2_9 IOMUX_PAD(0x638, 0x1d4, 5, 0x8e4, 0, NO_PAD_CTRL) 675 675 #define MX35_PAD_LD9__SDMA_SDMA_DEBUG_PC_9 IOMUX_PAD(0x638, 0x1d4, 6, 0x0, 0, NO_PAD_CTRL) 676 676 677 677 #define MX35_PAD_LD10__IPU_DISPB_DAT_10 IOMUX_PAD(0x63c, 0x1d8, 0, 0x0, 0, NO_PAD_CTRL)
+5
arch/arm/plat-mxc/include/mach/irqs.h
··· 37 37 * within sensible limits. 38 38 */ 39 39 #define MXC_BOARD_IRQ_START (MXC_INTERNAL_IRQS + MXC_GPIO_IRQS) 40 + 41 + #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 42 + #define MXC_BOARD_IRQS 80 43 + #else 40 44 #define MXC_BOARD_IRQS 16 45 + #endif 41 46 42 47 #define MXC_IPU_IRQ_START (MXC_BOARD_IRQ_START + MXC_BOARD_IRQS) 43 48