Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: MS7712SE01 board support.

Support the SH7712 (SH3-DSP) Solution Engine reference board.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Nobuhiro Iwamatsu and committed by
Paul Mundt
9465a54f c86c5a91

+142 -28
+1
arch/sh/Kconfig.debug
··· 33 33 default "0xffe00000" if CPU_SUBTYPE_SH7780 34 34 default "0xfffe9800" if CPU_SUBTYPE_SH7206 35 35 default "0xf8420000" if CPU_SUBTYPE_SH7619 36 + default "0xa4400000" if CPU_SUBTYPE_SH7712 36 37 default "0xffe80000" if CPU_SH4 37 38 38 39 config EARLY_PRINTK
+2
arch/sh/boards/se/770x/io.c
··· 27 27 static inline volatile __u16 * 28 28 port2adr(unsigned int port) 29 29 { 30 + if (port & 0xff000000) 31 + return ( volatile __u16 *) port; 30 32 if (port >= 0x2000) 31 33 return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); 32 34 else if (port >= 0x1000)
+14 -13
arch/sh/boards/se/770x/irq.c
··· 55 55 } 56 56 57 57 static struct ipr_data se770x_ipr_map[] = { 58 + /* 59 + * Super I/O (Just mimic PC): 60 + * 1: keyboard 61 + * 3: serial 0 62 + * 4: serial 1 63 + * 5: printer 64 + * 6: floppy 65 + * 8: rtc 66 + * 12: mouse 67 + * 14: ide0 68 + */ 58 69 #if defined(CONFIG_CPU_SUBTYPE_SH7705) 59 70 /* This is default value */ 60 71 { 0xf-0x2, 0, 8, 0x2 , BCR_ILCRA}, ··· 92 81 { 4, 0, 4, 0x0f- 4 ,BCR_ILCRC}, 93 82 { 3, 0, 0, 0x0f- 3 ,BCR_ILCRC}, 94 83 { 1, 0, 12, 0x0f- 1 ,BCR_ILCRD}, 84 + #if defined(CONFIG_STNIC) 95 85 /* ST NIC */ 96 86 { 10, 0, 4, 0x0f-10 ,BCR_ILCRD}, /* LAN */ 87 + #endif 97 88 /* MRSHPC IRQs setting */ 98 89 { 0, 0, 12, 0x0f- 0 ,BCR_ILCRE}, /* PCIRQ3 */ 99 90 { 11, 0, 8, 0x0f-11 ,BCR_ILCRE}, /* PCIRQ2 */ ··· 113 100 */ 114 101 void __init init_se_IRQ(void) 115 102 { 116 - /* 117 - * Super I/O (Just mimic PC): 118 - * 1: keyboard 119 - * 3: serial 0 120 - * 4: serial 1 121 - * 5: printer 122 - * 6: floppy 123 - * 8: rtc 124 - * 12: mouse 125 - * 14: ide0 126 - */ 127 - #if defined(CONFIG_CPU_SUBTYPE_SH7705) 128 103 /* Disable all interrupts */ 129 104 ctrl_outw(0, BCR_ILCRA); 130 105 ctrl_outw(0, BCR_ILCRB); ··· 121 120 ctrl_outw(0, BCR_ILCRE); 122 121 ctrl_outw(0, BCR_ILCRF); 123 122 ctrl_outw(0, BCR_ILCRG); 124 - #endif 123 + 125 124 make_se770x_irq(se770x_ipr_map, ARRAY_SIZE(se770x_ipr_map)); 126 125 }
+3 -1
arch/sh/boards/se/770x/setup.c
··· 117 117 { 118 118 return platform_add_devices(se_devices, ARRAY_SIZE(se_devices)); 119 119 } 120 - __initcall(se_devices_setup); 120 + device_initcall(se_devices_setup); 121 121 122 122 /* 123 123 * The Machine Vector ··· 133 133 .mv_nr_irqs = 61, 134 134 #elif defined(CONFIG_CPU_SUBTYPE_SH7705) 135 135 .mv_nr_irqs = 86, 136 + #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 137 + .mv_nr_irqs = 104, 136 138 #endif 137 139 138 140 .mv_inb = se_inb,
+1
arch/sh/kernel/cpu/sh3/Makefile
··· 12 12 obj-$(CONFIG_CPU_SUBTYPE_SH7709) += setup-sh7709.o 13 13 obj-$(CONFIG_CPU_SUBTYPE_SH7300) += setup-sh7300.o 14 14 obj-$(CONFIG_CPU_SUBTYPE_SH7710) += setup-sh7710.o 15 + obj-$(CONFIG_CPU_SUBTYPE_SH7712) += setup-sh7710.o 15 16 16 17 # Primary on-chip clocks (common) 17 18 clock-$(CONFIG_CPU_SH3) := clock-sh3.o
+3
arch/sh/kernel/cpu/sh3/probe.c
··· 78 78 #if defined(CONFIG_CPU_SUBTYPE_SH7710) 79 79 current_cpu_data.type = CPU_SH7710; 80 80 #endif 81 + #if defined(CONFIG_CPU_SUBTYPE_SH7712) 82 + current_cpu_data.type = CPU_SH7712; 83 + #endif 81 84 #if defined(CONFIG_CPU_SUBTYPE_SH7705) 82 85 current_cpu_data.type = CPU_SH7705; 83 86
+60
arch/sh/kernel/cpu/sh3/setup-sh7710.c
··· 2 2 * SH7710 Setup 3 3 * 4 4 * Copyright (C) 2006 Paul Mundt 5 + * Copyright (C) 2007 Nobuhiro Iwamatsu 5 6 * 6 7 * This file is subject to the terms and conditions of the GNU General Public 7 8 * License. See the file "COPYING" in the main directory of this archive ··· 20 19 .type = PORT_SCIF, 21 20 .irqs = { 52, 53, 55, 54 }, 22 21 }, { 22 + .mapbase = 0xa4420000, 23 + .flags = UPF_BOOT_AUTOCONF, 24 + .type = PORT_SCIF, 25 + .irqs = { 56, 57, 59, 58 }, 26 + }, { 27 + 23 28 .flags = 0, 24 29 } 25 30 }; ··· 48 41 ARRAY_SIZE(sh7710_devices)); 49 42 } 50 43 __initcall(sh7710_devices_setup); 44 + 45 + static struct ipr_data sh7710_ipr_map[] = { 46 + /* IRQ, IPR-idx, shift, priority */ 47 + { 16, 0, 12, 2 }, /* TMU0 TUNI*/ 48 + { 17, 0, 8, 2 }, /* TMU1 TUNI */ 49 + { 18, 0, 4, 2 }, /* TMU2 TUNI */ 50 + { 27, 1, 12, 2 }, /* WDT ITI */ 51 + { 20, 0, 0, 2 }, /* RTC ATI (alarm) */ 52 + { 21, 0, 0, 2 }, /* RTC PRI (period) */ 53 + { 22, 0, 0, 2 }, /* RTC CUI (carry) */ 54 + { 48, 4, 12, 7 }, /* DMAC DMTE0 */ 55 + { 49, 4, 12, 7 }, /* DMAC DMTE1 */ 56 + { 50, 4, 12, 7 }, /* DMAC DMTE2 */ 57 + { 51, 4, 12, 7 }, /* DMAC DMTE3 */ 58 + { 52, 4, 8, 3 }, /* SCIF0 ERI */ 59 + { 53, 4, 8, 3 }, /* SCIF0 RXI */ 60 + { 54, 4, 8, 3 }, /* SCIF0 BRI */ 61 + { 55, 4, 8, 3 }, /* SCIF0 TXI */ 62 + { 56, 4, 4, 3 }, /* SCIF1 ERI */ 63 + { 57, 4, 4, 3 }, /* SCIF1 RXI */ 64 + { 58, 4, 4, 3 }, /* SCIF1 BRI */ 65 + { 59, 4, 4, 3 }, /* SCIF1 TXI */ 66 + { 76, 5, 8, 7 }, /* DMAC DMTE4 */ 67 + { 77, 5, 8, 7 }, /* DMAC DMTE5 */ 68 + { 80, 6, 12, 5 }, /* EDMAC EINT0 */ 69 + { 81, 6, 8, 5 }, /* EDMAC EINT1 */ 70 + { 82, 6, 4, 5 }, /* EDMAC EINT2 */ 71 + }; 72 + 73 + static unsigned long ipr_offsets[] = { 74 + 0xA414FEE2 /* 0: IPRA */ 75 + , 0xA414FEE4 /* 1: IPRB */ 76 + , 0xA4140016 /* 2: IPRC */ 77 + , 0xA4140018 /* 3: IPRD */ 78 + , 0xA414001A /* 4: IPRE */ 79 + , 0xA4080000 /* 5: IPRF */ 80 + , 0xA4080002 /* 6: IPRG */ 81 + , 0xA4080004 /* 7: IPRH */ 82 + , 0xA4080006 /* 8: IPRI */ 83 + }; 84 + 85 + /* given the IPR index return the address of the IPR register */ 86 + unsigned int map_ipridx_to_addr(int idx) 87 + { 88 + if (idx >= ARRAY_SIZE(ipr_offsets)) 89 + return 0; 90 + return ipr_offsets[idx]; 91 + } 92 + 93 + void __init init_IRQ_ipr() 94 + { 95 + make_ipr_irq(sh7710_ipr_map, ARRAY_SIZE(sh7710_ipr_map)); 96 + }
+2 -1
arch/sh/kernel/process.c
··· 299 299 ctrl_outl(0, UBC_BAMRA); 300 300 301 301 if (current_cpu_data.type == CPU_SH7729 || 302 - current_cpu_data.type == CPU_SH7710) { 302 + current_cpu_data.type == CPU_SH7710 || 303 + current_cpu_data.type == CPU_SH7712 ) { 303 304 ctrl_outw(BBR_INST | BBR_READ | BBR_CPU, UBC_BBRA); 304 305 ctrl_outl(BRCR_PCBA | BRCR_PCTE, UBC_BRCR); 305 306 } else {
+1
arch/sh/kernel/setup.c
··· 377 377 [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706", 378 378 [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708", 379 379 [CPU_SH7709] = "SH7709", [CPU_SH7710] = "SH7710", 380 + [CPU_SH7712] = "SH7712", 380 381 [CPU_SH7729] = "SH7729", [CPU_SH7750] = "SH7750", 381 382 [CPU_SH7750S] = "SH7750S", [CPU_SH7750R] = "SH7750R", 382 383 [CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R",
+8
arch/sh/mm/Kconfig
··· 101 101 config CPU_SUBTYPE_SH7710 102 102 bool "Support SH7710 processor" 103 103 select CPU_SH3 104 + select CPU_HAS_IPR_IRQ 104 105 help 105 106 Select SH7710 if you have a SH3-DSP SH7710 CPU. 107 + 108 + config CPU_SUBTYPE_SH7712 109 + bool "Support SH7712 processor" 110 + select CPU_SH3 111 + select CPU_HAS_IPR_IRQ 112 + help 113 + Select SH7712 if you have a SH3-DSP SH7712 CPU. 106 114 107 115 comment "SH-4 Processor Support" 108 116
+12 -1
drivers/serial/sh-sci.c
··· 284 284 #endif 285 285 286 286 #if defined(SCIF_ONLY) || defined(SCI_AND_SCIF) 287 - #if defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7710) 287 + #if defined(CONFIG_CPU_SUBTYPE_SH7300) 288 288 /* SH7300 doesn't use RTS/CTS */ 289 289 static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) 290 290 { 291 291 sci_out(port, SCFCR, 0); 292 + } 293 + #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 294 + static void sci_init_pins_scif(struct uart_port* port, unsigned int cflag) 295 + { 296 + unsigned int fcr_val = 0; 297 + 298 + set_sh771x_scif_pfc(port); 299 + if (cflag & CRTSCTS) { 300 + fcr_val |= SCFCR_MCE; 301 + } 302 + sci_out(port, SCFCR, fcr_val); 292 303 } 293 304 #elif defined(CONFIG_CPU_SH3) 294 305 /* For SH7705, SH7706, SH7707, SH7709, SH7709A, SH7729 */
+32 -11
drivers/serial/sh-sci.h
··· 73 73 # define SCPDR 0xA4050136 /* 16 bit SCIF */ 74 74 # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ 75 75 # define SCIF_ONLY 76 - #elif defined(CONFIG_CPU_SUBTYPE_SH7710) 76 + #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 77 77 # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ 78 - # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ 78 + # define SCI_NPORTS 2 79 + # define SCIF_ORER 0x0001 /* overrun error bit */ 80 + # define PACR 0xa4050100 81 + # define PBCR 0xa4050102 82 + # define SCSCR_INIT(port) 0x3B 79 83 # define SCIF_ONLY 80 84 #elif defined(CONFIG_CPU_SUBTYPE_SH73180) 81 85 # define SCPDR 0xA4050138 /* 16 bit SCIF */ ··· 350 346 } 351 347 352 348 #ifdef CONFIG_CPU_SH3 353 - #if defined(CONFIG_CPU_SUBTYPE_SH7300) || \ 354 - defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 355 - defined(CONFIG_CPU_SUBTYPE_SH7710) 349 + #if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 350 + #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \ 351 + sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \ 352 + h8_sci_offset, h8_sci_size) \ 353 + CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size) 354 + #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \ 355 + CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size) 356 + #elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \ 357 + defined(CONFIG_CPU_SUBTYPE_SH7705) 356 358 #define SCIF_FNS(name, scif_offset, scif_size) \ 357 359 CPU_SCIF_FNS(name, scif_offset, scif_size) 358 360 #else ··· 385 375 #endif 386 376 387 377 #if defined(CONFIG_CPU_SUBTYPE_SH7300) || \ 388 - defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 389 - defined(CONFIG_CPU_SUBTYPE_SH7710) 378 + defined(CONFIG_CPU_SUBTYPE_SH7705) 379 + 390 380 SCIF_FNS(SCSMR, 0x00, 16) 391 381 SCIF_FNS(SCBRR, 0x04, 8) 392 382 SCIF_FNS(SCSCR, 0x08, 16) ··· 496 486 return ctrl_inb(SCPDR)&0x10 ? 1 : 0; /* SCIF */ 497 487 return 1; 498 488 } 499 - #elif defined(CONFIG_CPU_SUBTYPE_SH7710) 489 + #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 500 490 static inline int sci_rxd_in(struct uart_port *port) 501 491 { 502 - if (port->mapbase == SCSPTR0) 503 - return ctrl_inw(SCSPTR0 + 0x10) & 0x01 ? 1 : 0; 504 - return 1; 492 + return sci_in(port,SCxSR)&0x0010 ? 1 : 0; 505 493 } 494 + static inline void set_sh771x_scif_pfc(struct uart_port *port) 495 + { 496 + if (port->mapbase == 0xA4400000){ 497 + ctrl_outw(ctrl_inw(PACR)&0xffc0,PACR); 498 + ctrl_outw(ctrl_inw(PBCR)&0x0fff,PBCR); 499 + return; 500 + } 501 + if (port->mapbase == 0xA4410000){ 502 + ctrl_outw(ctrl_inw(PBCR)&0xf003,PBCR); 503 + return; 504 + } 505 + } 506 + 506 507 #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ 507 508 defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 508 509 defined(CONFIG_CPU_SUBTYPE_SH4_202)
+1
include/asm-sh/cpu-sh3/mmu_context.h
··· 32 32 defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 33 33 defined(CONFIG_CPU_SUBTYPE_SH7300) || \ 34 34 defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 35 + defined(CONFIG_CPU_SUBTYPE_SH7712) || \ 35 36 defined(CONFIG_CPU_SUBTYPE_SH7710) 36 37 #define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */ 37 38 #else
+1 -1
include/asm-sh/processor.h
··· 44 44 /* SH-3 types */ 45 45 CPU_SH7705, CPU_SH7706, CPU_SH7707, 46 46 CPU_SH7708, CPU_SH7708S, CPU_SH7708R, 47 - CPU_SH7709, CPU_SH7709A, CPU_SH7710, 47 + CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712, 48 48 CPU_SH7729, CPU_SH7300, 49 49 50 50 /* SH-4 types */
+1
include/asm-sh/se.h
··· 73 73 #else 74 74 #define IRQ_STNIC 10 75 75 #endif 76 + #define IRQ_CFCARD 7 76 77 77 78 #define __IO_PREFIX se 78 79 #include <asm/io_generic.h>