Path: blob/master/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
17498 views
/*1* SH7785 Setup2*3* Copyright (C) 2007 Paul Mundt4*5* This file is subject to the terms and conditions of the GNU General Public6* License. See the file "COPYING" in the main directory of this archive7* for more details.8*/9#include <linux/platform_device.h>10#include <linux/init.h>11#include <linux/serial.h>12#include <linux/serial_sci.h>13#include <linux/io.h>14#include <linux/mm.h>15#include <linux/sh_dma.h>16#include <linux/sh_timer.h>1718#include <asm/mmzone.h>1920#include <cpu/dma-register.h>2122static struct plat_sci_port scif0_platform_data = {23.mapbase = 0xffea0000,24.flags = UPF_BOOT_AUTOCONF,25.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,26.scbrr_algo_id = SCBRR_ALGO_1,27.type = PORT_SCIF,28.irqs = { 40, 40, 40, 40 },29};3031static struct platform_device scif0_device = {32.name = "sh-sci",33.id = 0,34.dev = {35.platform_data = &scif0_platform_data,36},37};3839static struct plat_sci_port scif1_platform_data = {40.mapbase = 0xffeb0000,41.flags = UPF_BOOT_AUTOCONF,42.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,43.scbrr_algo_id = SCBRR_ALGO_1,44.type = PORT_SCIF,45.irqs = { 44, 44, 44, 44 },46};4748static struct platform_device scif1_device = {49.name = "sh-sci",50.id = 1,51.dev = {52.platform_data = &scif1_platform_data,53},54};5556static struct plat_sci_port scif2_platform_data = {57.mapbase = 0xffec0000,58.flags = UPF_BOOT_AUTOCONF,59.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,60.scbrr_algo_id = SCBRR_ALGO_1,61.type = PORT_SCIF,62.irqs = { 60, 60, 60, 60 },63};6465static struct platform_device scif2_device = {66.name = "sh-sci",67.id = 2,68.dev = {69.platform_data = &scif2_platform_data,70},71};7273static struct plat_sci_port scif3_platform_data = {74.mapbase = 0xffed0000,75.flags = UPF_BOOT_AUTOCONF,76.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,77.scbrr_algo_id = SCBRR_ALGO_1,78.type = PORT_SCIF,79.irqs = { 61, 61, 61, 61 },80};8182static struct platform_device scif3_device = {83.name = "sh-sci",84.id = 3,85.dev = {86.platform_data = &scif3_platform_data,87},88};8990static struct plat_sci_port scif4_platform_data = {91.mapbase = 0xffee0000,92.flags = UPF_BOOT_AUTOCONF,93.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,94.scbrr_algo_id = SCBRR_ALGO_1,95.type = PORT_SCIF,96.irqs = { 62, 62, 62, 62 },97};9899static struct platform_device scif4_device = {100.name = "sh-sci",101.id = 4,102.dev = {103.platform_data = &scif4_platform_data,104},105};106107static struct plat_sci_port scif5_platform_data = {108.mapbase = 0xffef0000,109.flags = UPF_BOOT_AUTOCONF,110.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,111.scbrr_algo_id = SCBRR_ALGO_1,112.type = PORT_SCIF,113.irqs = { 63, 63, 63, 63 },114};115116static struct platform_device scif5_device = {117.name = "sh-sci",118.id = 5,119.dev = {120.platform_data = &scif5_platform_data,121},122};123124static struct sh_timer_config tmu0_platform_data = {125.channel_offset = 0x04,126.timer_bit = 0,127.clockevent_rating = 200,128};129130static struct resource tmu0_resources[] = {131[0] = {132.start = 0xffd80008,133.end = 0xffd80013,134.flags = IORESOURCE_MEM,135},136[1] = {137.start = 28,138.flags = IORESOURCE_IRQ,139},140};141142static struct platform_device tmu0_device = {143.name = "sh_tmu",144.id = 0,145.dev = {146.platform_data = &tmu0_platform_data,147},148.resource = tmu0_resources,149.num_resources = ARRAY_SIZE(tmu0_resources),150};151152static struct sh_timer_config tmu1_platform_data = {153.channel_offset = 0x10,154.timer_bit = 1,155.clocksource_rating = 200,156};157158static struct resource tmu1_resources[] = {159[0] = {160.start = 0xffd80014,161.end = 0xffd8001f,162.flags = IORESOURCE_MEM,163},164[1] = {165.start = 29,166.flags = IORESOURCE_IRQ,167},168};169170static struct platform_device tmu1_device = {171.name = "sh_tmu",172.id = 1,173.dev = {174.platform_data = &tmu1_platform_data,175},176.resource = tmu1_resources,177.num_resources = ARRAY_SIZE(tmu1_resources),178};179180static struct sh_timer_config tmu2_platform_data = {181.channel_offset = 0x1c,182.timer_bit = 2,183};184185static struct resource tmu2_resources[] = {186[0] = {187.start = 0xffd80020,188.end = 0xffd8002f,189.flags = IORESOURCE_MEM,190},191[1] = {192.start = 30,193.flags = IORESOURCE_IRQ,194},195};196197static struct platform_device tmu2_device = {198.name = "sh_tmu",199.id = 2,200.dev = {201.platform_data = &tmu2_platform_data,202},203.resource = tmu2_resources,204.num_resources = ARRAY_SIZE(tmu2_resources),205};206207static struct sh_timer_config tmu3_platform_data = {208.channel_offset = 0x04,209.timer_bit = 0,210};211212static struct resource tmu3_resources[] = {213[0] = {214.start = 0xffdc0008,215.end = 0xffdc0013,216.flags = IORESOURCE_MEM,217},218[1] = {219.start = 96,220.flags = IORESOURCE_IRQ,221},222};223224static struct platform_device tmu3_device = {225.name = "sh_tmu",226.id = 3,227.dev = {228.platform_data = &tmu3_platform_data,229},230.resource = tmu3_resources,231.num_resources = ARRAY_SIZE(tmu3_resources),232};233234static struct sh_timer_config tmu4_platform_data = {235.channel_offset = 0x10,236.timer_bit = 1,237};238239static struct resource tmu4_resources[] = {240[0] = {241.start = 0xffdc0014,242.end = 0xffdc001f,243.flags = IORESOURCE_MEM,244},245[1] = {246.start = 97,247.flags = IORESOURCE_IRQ,248},249};250251static struct platform_device tmu4_device = {252.name = "sh_tmu",253.id = 4,254.dev = {255.platform_data = &tmu4_platform_data,256},257.resource = tmu4_resources,258.num_resources = ARRAY_SIZE(tmu4_resources),259};260261static struct sh_timer_config tmu5_platform_data = {262.channel_offset = 0x1c,263.timer_bit = 2,264};265266static struct resource tmu5_resources[] = {267[0] = {268.start = 0xffdc0020,269.end = 0xffdc002b,270.flags = IORESOURCE_MEM,271},272[1] = {273.start = 98,274.flags = IORESOURCE_IRQ,275},276};277278static struct platform_device tmu5_device = {279.name = "sh_tmu",280.id = 5,281.dev = {282.platform_data = &tmu5_platform_data,283},284.resource = tmu5_resources,285.num_resources = ARRAY_SIZE(tmu5_resources),286};287288/* DMA */289static const struct sh_dmae_channel sh7785_dmae0_channels[] = {290{291.offset = 0,292.dmars = 0,293.dmars_bit = 0,294}, {295.offset = 0x10,296.dmars = 0,297.dmars_bit = 8,298}, {299.offset = 0x20,300.dmars = 4,301.dmars_bit = 0,302}, {303.offset = 0x30,304.dmars = 4,305.dmars_bit = 8,306}, {307.offset = 0x50,308.dmars = 8,309.dmars_bit = 0,310}, {311.offset = 0x60,312.dmars = 8,313.dmars_bit = 8,314}315};316317static const struct sh_dmae_channel sh7785_dmae1_channels[] = {318{319.offset = 0,320}, {321.offset = 0x10,322}, {323.offset = 0x20,324}, {325.offset = 0x30,326}, {327.offset = 0x50,328}, {329.offset = 0x60,330}331};332333static const unsigned int ts_shift[] = TS_SHIFT;334335static struct sh_dmae_pdata dma0_platform_data = {336.channel = sh7785_dmae0_channels,337.channel_num = ARRAY_SIZE(sh7785_dmae0_channels),338.ts_low_shift = CHCR_TS_LOW_SHIFT,339.ts_low_mask = CHCR_TS_LOW_MASK,340.ts_high_shift = CHCR_TS_HIGH_SHIFT,341.ts_high_mask = CHCR_TS_HIGH_MASK,342.ts_shift = ts_shift,343.ts_shift_num = ARRAY_SIZE(ts_shift),344.dmaor_init = DMAOR_INIT,345};346347static struct sh_dmae_pdata dma1_platform_data = {348.channel = sh7785_dmae1_channels,349.channel_num = ARRAY_SIZE(sh7785_dmae1_channels),350.ts_low_shift = CHCR_TS_LOW_SHIFT,351.ts_low_mask = CHCR_TS_LOW_MASK,352.ts_high_shift = CHCR_TS_HIGH_SHIFT,353.ts_high_mask = CHCR_TS_HIGH_MASK,354.ts_shift = ts_shift,355.ts_shift_num = ARRAY_SIZE(ts_shift),356.dmaor_init = DMAOR_INIT,357};358359static struct resource sh7785_dmae0_resources[] = {360[0] = {361/* Channel registers and DMAOR */362.start = 0xfc808020,363.end = 0xfc80808f,364.flags = IORESOURCE_MEM,365},366[1] = {367/* DMARSx */368.start = 0xfc809000,369.end = 0xfc80900b,370.flags = IORESOURCE_MEM,371},372{373/* Real DMA error IRQ is 39, and channel IRQs are 33-38 */374.start = 33,375.end = 33,376.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,377},378};379380static struct resource sh7785_dmae1_resources[] = {381[0] = {382/* Channel registers and DMAOR */383.start = 0xfcc08020,384.end = 0xfcc0808f,385.flags = IORESOURCE_MEM,386},387/* DMAC1 has no DMARS */388{389/* Real DMA error IRQ is 58, and channel IRQs are 52-57 */390.start = 52,391.end = 52,392.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,393},394};395396static struct platform_device dma0_device = {397.name = "sh-dma-engine",398.id = 0,399.resource = sh7785_dmae0_resources,400.num_resources = ARRAY_SIZE(sh7785_dmae0_resources),401.dev = {402.platform_data = &dma0_platform_data,403},404};405406static struct platform_device dma1_device = {407.name = "sh-dma-engine",408.id = 1,409.resource = sh7785_dmae1_resources,410.num_resources = ARRAY_SIZE(sh7785_dmae1_resources),411.dev = {412.platform_data = &dma1_platform_data,413},414};415416static struct platform_device *sh7785_devices[] __initdata = {417&scif0_device,418&scif1_device,419&scif2_device,420&scif3_device,421&scif4_device,422&scif5_device,423&tmu0_device,424&tmu1_device,425&tmu2_device,426&tmu3_device,427&tmu4_device,428&tmu5_device,429&dma0_device,430&dma1_device,431};432433static int __init sh7785_devices_setup(void)434{435return platform_add_devices(sh7785_devices,436ARRAY_SIZE(sh7785_devices));437}438arch_initcall(sh7785_devices_setup);439440static struct platform_device *sh7785_early_devices[] __initdata = {441&scif0_device,442&scif1_device,443&scif2_device,444&scif3_device,445&scif4_device,446&scif5_device,447&tmu0_device,448&tmu1_device,449&tmu2_device,450&tmu3_device,451&tmu4_device,452&tmu5_device,453};454455void __init plat_early_device_setup(void)456{457early_platform_add_devices(sh7785_early_devices,458ARRAY_SIZE(sh7785_early_devices));459}460461enum {462UNUSED = 0,463464/* interrupt sources */465466IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,467IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,468IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,469IRL0_HHLL, IRL0_HHLH, IRL0_HHHL,470471IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,472IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,473IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,474IRL4_HHLL, IRL4_HHLH, IRL4_HHHL,475476IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,477WDT, TMU0, TMU1, TMU2, TMU2_TICPI,478HUDI, DMAC0, SCIF0, SCIF1, DMAC1, HSPI,479SCIF2, SCIF3, SCIF4, SCIF5,480PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD, PCIC5,481SIOF, MMCIF, DU, GDTA,482TMU3, TMU4, TMU5,483SSI0, SSI1,484HAC0, HAC1,485FLCTL, GPIO,486487/* interrupt groups */488489TMU012, TMU345490};491492static struct intc_vect vectors[] __initdata = {493INTC_VECT(WDT, 0x560),494INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0),495INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0),496INTC_VECT(HUDI, 0x600),497INTC_VECT(DMAC0, 0x620), INTC_VECT(DMAC0, 0x640),498INTC_VECT(DMAC0, 0x660), INTC_VECT(DMAC0, 0x680),499INTC_VECT(DMAC0, 0x6a0), INTC_VECT(DMAC0, 0x6c0),500INTC_VECT(DMAC0, 0x6e0),501INTC_VECT(SCIF0, 0x700), INTC_VECT(SCIF0, 0x720),502INTC_VECT(SCIF0, 0x740), INTC_VECT(SCIF0, 0x760),503INTC_VECT(SCIF1, 0x780), INTC_VECT(SCIF1, 0x7a0),504INTC_VECT(SCIF1, 0x7c0), INTC_VECT(SCIF1, 0x7e0),505INTC_VECT(DMAC1, 0x880), INTC_VECT(DMAC1, 0x8a0),506INTC_VECT(DMAC1, 0x8c0), INTC_VECT(DMAC1, 0x8e0),507INTC_VECT(DMAC1, 0x900), INTC_VECT(DMAC1, 0x920),508INTC_VECT(DMAC1, 0x940),509INTC_VECT(HSPI, 0x960),510INTC_VECT(SCIF2, 0x980), INTC_VECT(SCIF3, 0x9a0),511INTC_VECT(SCIF4, 0x9c0), INTC_VECT(SCIF5, 0x9e0),512INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20),513INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60),514INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIC5, 0xaa0),515INTC_VECT(PCIC5, 0xac0), INTC_VECT(PCIC5, 0xae0),516INTC_VECT(PCIC5, 0xb00), INTC_VECT(PCIC5, 0xb20),517INTC_VECT(SIOF, 0xc00),518INTC_VECT(MMCIF, 0xd00), INTC_VECT(MMCIF, 0xd20),519INTC_VECT(MMCIF, 0xd40), INTC_VECT(MMCIF, 0xd60),520INTC_VECT(DU, 0xd80),521INTC_VECT(GDTA, 0xda0), INTC_VECT(GDTA, 0xdc0),522INTC_VECT(GDTA, 0xde0),523INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20),524INTC_VECT(TMU5, 0xe40),525INTC_VECT(SSI0, 0xe80), INTC_VECT(SSI1, 0xea0),526INTC_VECT(HAC0, 0xec0), INTC_VECT(HAC1, 0xee0),527INTC_VECT(FLCTL, 0xf00), INTC_VECT(FLCTL, 0xf20),528INTC_VECT(FLCTL, 0xf40), INTC_VECT(FLCTL, 0xf60),529INTC_VECT(GPIO, 0xf80), INTC_VECT(GPIO, 0xfa0),530INTC_VECT(GPIO, 0xfc0), INTC_VECT(GPIO, 0xfe0),531};532533static struct intc_group groups[] __initdata = {534INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI),535INTC_GROUP(TMU345, TMU3, TMU4, TMU5),536};537538static struct intc_mask_reg mask_registers[] __initdata = {539{ 0xffd00044, 0xffd00064, 32, /* INTMSK0 / INTMSKCLR0 */540{ IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },541542{ 0xffd40080, 0xffd40084, 32, /* INTMSK2 / INTMSKCLR2 */543{ IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,544IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,545IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,546IRL0_HHLL, IRL0_HHLH, IRL0_HHHL, 0,547IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,548IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,549IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,550IRL4_HHLL, IRL4_HHLH, IRL4_HHHL, 0, } },551552{ 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */553{ 0, 0, 0, GDTA, DU, SSI0, SSI1, GPIO,554FLCTL, MMCIF, HSPI, SIOF, PCIC5, PCIINTD, PCIINTC, PCIINTB,555PCIINTA, PCISERR, HAC1, HAC0, DMAC1, DMAC0, HUDI, WDT,556SCIF5, SCIF4, SCIF3, SCIF2, SCIF1, SCIF0, TMU345, TMU012 } },557};558559static struct intc_prio_reg prio_registers[] __initdata = {560{ 0xffd00010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3,561IRQ4, IRQ5, IRQ6, IRQ7 } },562{ 0xffd40000, 0, 32, 8, /* INT2PRI0 */ { TMU0, TMU1,563TMU2, TMU2_TICPI } },564{ 0xffd40004, 0, 32, 8, /* INT2PRI1 */ { TMU3, TMU4, TMU5, } },565{ 0xffd40008, 0, 32, 8, /* INT2PRI2 */ { SCIF0, SCIF1,566SCIF2, SCIF3 } },567{ 0xffd4000c, 0, 32, 8, /* INT2PRI3 */ { SCIF4, SCIF5, WDT, } },568{ 0xffd40010, 0, 32, 8, /* INT2PRI4 */ { HUDI, DMAC0, DMAC1, } },569{ 0xffd40014, 0, 32, 8, /* INT2PRI5 */ { HAC0, HAC1,570PCISERR, PCIINTA } },571{ 0xffd40018, 0, 32, 8, /* INT2PRI6 */ { PCIINTB, PCIINTC,572PCIINTD, PCIC5 } },573{ 0xffd4001c, 0, 32, 8, /* INT2PRI7 */ { SIOF, HSPI, MMCIF, } },574{ 0xffd40020, 0, 32, 8, /* INT2PRI8 */ { FLCTL, GPIO, SSI0, SSI1, } },575{ 0xffd40024, 0, 32, 8, /* INT2PRI9 */ { DU, GDTA, } },576};577578static DECLARE_INTC_DESC(intc_desc, "sh7785", vectors, groups,579mask_registers, prio_registers, NULL);580581/* Support for external interrupt pins in IRQ mode */582583static struct intc_vect vectors_irq0123[] __initdata = {584INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),585INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),586};587588static struct intc_vect vectors_irq4567[] __initdata = {589INTC_VECT(IRQ4, 0x340), INTC_VECT(IRQ5, 0x380),590INTC_VECT(IRQ6, 0x3c0), INTC_VECT(IRQ7, 0x200),591};592593static struct intc_sense_reg sense_registers[] __initdata = {594{ 0xffd0001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3,595IRQ4, IRQ5, IRQ6, IRQ7 } },596};597598static struct intc_mask_reg ack_registers[] __initdata = {599{ 0xffd00024, 0, 32, /* INTREQ */600{ IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },601};602603static DECLARE_INTC_DESC_ACK(intc_desc_irq0123, "sh7785-irq0123",604vectors_irq0123, NULL, mask_registers,605prio_registers, sense_registers, ack_registers);606607static DECLARE_INTC_DESC_ACK(intc_desc_irq4567, "sh7785-irq4567",608vectors_irq4567, NULL, mask_registers,609prio_registers, sense_registers, ack_registers);610611/* External interrupt pins in IRL mode */612613static struct intc_vect vectors_irl0123[] __initdata = {614INTC_VECT(IRL0_LLLL, 0x200), INTC_VECT(IRL0_LLLH, 0x220),615INTC_VECT(IRL0_LLHL, 0x240), INTC_VECT(IRL0_LLHH, 0x260),616INTC_VECT(IRL0_LHLL, 0x280), INTC_VECT(IRL0_LHLH, 0x2a0),617INTC_VECT(IRL0_LHHL, 0x2c0), INTC_VECT(IRL0_LHHH, 0x2e0),618INTC_VECT(IRL0_HLLL, 0x300), INTC_VECT(IRL0_HLLH, 0x320),619INTC_VECT(IRL0_HLHL, 0x340), INTC_VECT(IRL0_HLHH, 0x360),620INTC_VECT(IRL0_HHLL, 0x380), INTC_VECT(IRL0_HHLH, 0x3a0),621INTC_VECT(IRL0_HHHL, 0x3c0),622};623624static struct intc_vect vectors_irl4567[] __initdata = {625INTC_VECT(IRL4_LLLL, 0xb00), INTC_VECT(IRL4_LLLH, 0xb20),626INTC_VECT(IRL4_LLHL, 0xb40), INTC_VECT(IRL4_LLHH, 0xb60),627INTC_VECT(IRL4_LHLL, 0xb80), INTC_VECT(IRL4_LHLH, 0xba0),628INTC_VECT(IRL4_LHHL, 0xbc0), INTC_VECT(IRL4_LHHH, 0xbe0),629INTC_VECT(IRL4_HLLL, 0xc00), INTC_VECT(IRL4_HLLH, 0xc20),630INTC_VECT(IRL4_HLHL, 0xc40), INTC_VECT(IRL4_HLHH, 0xc60),631INTC_VECT(IRL4_HHLL, 0xc80), INTC_VECT(IRL4_HHLH, 0xca0),632INTC_VECT(IRL4_HHHL, 0xcc0),633};634635static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7785-irl0123", vectors_irl0123,636NULL, mask_registers, NULL, NULL);637638static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7785-irl4567", vectors_irl4567,639NULL, mask_registers, NULL, NULL);640641#define INTC_ICR0 0xffd00000642#define INTC_INTMSK0 0xffd00044643#define INTC_INTMSK1 0xffd00048644#define INTC_INTMSK2 0xffd40080645#define INTC_INTMSKCLR1 0xffd00068646#define INTC_INTMSKCLR2 0xffd40084647648void __init plat_irq_setup(void)649{650/* disable IRQ3-0 + IRQ7-4 */651__raw_writel(0xff000000, INTC_INTMSK0);652653/* disable IRL3-0 + IRL7-4 */654__raw_writel(0xc0000000, INTC_INTMSK1);655__raw_writel(0xfffefffe, INTC_INTMSK2);656657/* select IRL mode for IRL3-0 + IRL7-4 */658__raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);659660/* disable holding function, ie enable "SH-4 Mode" */661__raw_writel(__raw_readl(INTC_ICR0) | 0x00200000, INTC_ICR0);662663register_intc_controller(&intc_desc);664}665666void __init plat_irq_setup_pins(int mode)667{668switch (mode) {669case IRQ_MODE_IRQ7654:670/* select IRQ mode for IRL7-4 */671__raw_writel(__raw_readl(INTC_ICR0) | 0x00400000, INTC_ICR0);672register_intc_controller(&intc_desc_irq4567);673break;674case IRQ_MODE_IRQ3210:675/* select IRQ mode for IRL3-0 */676__raw_writel(__raw_readl(INTC_ICR0) | 0x00800000, INTC_ICR0);677register_intc_controller(&intc_desc_irq0123);678break;679case IRQ_MODE_IRL7654:680/* enable IRL7-4 but don't provide any masking */681__raw_writel(0x40000000, INTC_INTMSKCLR1);682__raw_writel(0x0000fffe, INTC_INTMSKCLR2);683break;684case IRQ_MODE_IRL3210:685/* enable IRL0-3 but don't provide any masking */686__raw_writel(0x80000000, INTC_INTMSKCLR1);687__raw_writel(0xfffe0000, INTC_INTMSKCLR2);688break;689case IRQ_MODE_IRL7654_MASK:690/* enable IRL7-4 and mask using cpu intc controller */691__raw_writel(0x40000000, INTC_INTMSKCLR1);692register_intc_controller(&intc_desc_irl4567);693break;694case IRQ_MODE_IRL3210_MASK:695/* enable IRL0-3 and mask using cpu intc controller */696__raw_writel(0x80000000, INTC_INTMSKCLR1);697register_intc_controller(&intc_desc_irl0123);698break;699default:700BUG();701}702}703704void __init plat_mem_setup(void)705{706/* Register the URAM space as Node 1 */707setup_bootmem_node(1, 0xe55f0000, 0xe5610000);708}709710711