···194194 help195195 This enables support for ARM Ltd Versatile board.196196197197+config ARCH_REALVIEW198198+ bool "RealView"199199+ select ARM_AMBA200200+ select ICST307201201+ help202202+ This enables support for ARM Ltd RealView boards.203203+197204config ARCH_IMX198205 bool "IMX"199206···250243source "arch/arm/mach-versatile/Kconfig"251244252245source "arch/arm/mach-aaec2000/Kconfig"246246+247247+source "arch/arm/mach-realview/Kconfig"253248254249# Definitions to make life easier255250config ARCH_ACORN
+1
arch/arm/Makefile
···9999 machine-$(CONFIG_ARCH_IMX) := imx100100 machine-$(CONFIG_ARCH_H720X) := h720x101101 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000102102+ machine-$(CONFIG_ARCH_REALVIEW) := realview102103103104ifeq ($(CONFIG_ARCH_EBSA110),y)104105# This is what happens if you forget the IOCS16 line.
+11
arch/arm/mach-realview/Kconfig
···11+menu "RealView platform type"22+ depends on ARCH_REALVIEW33+44+config MACH_REALVIEW_EB55+ bool "Support RealView/EB platform"66+ default n77+ select ARM_GIC88+ help99+ Include support for the ARM(R) RealView Emulation Baseboard platform.1010+1111+endmenu
+6
arch/arm/mach-realview/Makefile
···11+#22+# Makefile for the linux kernel.33+#44+55+obj-y := core.o clock.o66+obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o
···11+/*22+ * linux/arch/arm/mach-realview/clock.c33+ *44+ * Copyright (C) 2004 ARM Limited.55+ * Written by Deep Blue Solutions Limited.66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License version 2 as99+ * published by the Free Software Foundation.1010+ */1111+#include <linux/module.h>1212+#include <linux/kernel.h>1313+#include <linux/list.h>1414+#include <linux/errno.h>1515+#include <linux/err.h>1616+1717+#include <asm/semaphore.h>1818+#include <asm/hardware/clock.h>1919+#include <asm/hardware/icst307.h>2020+2121+#include "clock.h"2222+2323+static LIST_HEAD(clocks);2424+static DECLARE_MUTEX(clocks_sem);2525+2626+struct clk *clk_get(struct device *dev, const char *id)2727+{2828+ struct clk *p, *clk = ERR_PTR(-ENOENT);2929+3030+ down(&clocks_sem);3131+ list_for_each_entry(p, &clocks, node) {3232+ if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {3333+ clk = p;3434+ break;3535+ }3636+ }3737+ up(&clocks_sem);3838+3939+ return clk;4040+}4141+EXPORT_SYMBOL(clk_get);4242+4343+void clk_put(struct clk *clk)4444+{4545+ module_put(clk->owner);4646+}4747+EXPORT_SYMBOL(clk_put);4848+4949+int clk_enable(struct clk *clk)5050+{5151+ return 0;5252+}5353+EXPORT_SYMBOL(clk_enable);5454+5555+void clk_disable(struct clk *clk)5656+{5757+}5858+EXPORT_SYMBOL(clk_disable);5959+6060+int clk_use(struct clk *clk)6161+{6262+ return 0;6363+}6464+EXPORT_SYMBOL(clk_use);6565+6666+void clk_unuse(struct clk *clk)6767+{6868+}6969+EXPORT_SYMBOL(clk_unuse);7070+7171+unsigned long clk_get_rate(struct clk *clk)7272+{7373+ return clk->rate;7474+}7575+EXPORT_SYMBOL(clk_get_rate);7676+7777+long clk_round_rate(struct clk *clk, unsigned long rate)7878+{7979+ return rate;8080+}8181+EXPORT_SYMBOL(clk_round_rate);8282+8383+int clk_set_rate(struct clk *clk, unsigned long rate)8484+{8585+ int ret = -EIO;8686+8787+ if (clk->setvco) {8888+ struct icst307_vco vco;8989+9090+ vco = icst307_khz_to_vco(clk->params, rate / 1000);9191+ clk->rate = icst307_khz(clk->params, vco) * 1000;9292+9393+ printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n",9494+ clk->name, vco.s, vco.r, vco.v);9595+9696+ clk->setvco(clk, vco);9797+ ret = 0;9898+ }9999+ return ret;100100+}101101+EXPORT_SYMBOL(clk_set_rate);102102+103103+/*104104+ * These are fixed clocks.105105+ */106106+static struct clk kmi_clk = {107107+ .name = "KMIREFCLK",108108+ .rate = 24000000,109109+};110110+111111+static struct clk uart_clk = {112112+ .name = "UARTCLK",113113+ .rate = 24000000,114114+};115115+116116+static struct clk mmci_clk = {117117+ .name = "MCLK",118118+ .rate = 33000000,119119+};120120+121121+int clk_register(struct clk *clk)122122+{123123+ down(&clocks_sem);124124+ list_add(&clk->node, &clocks);125125+ up(&clocks_sem);126126+ return 0;127127+}128128+EXPORT_SYMBOL(clk_register);129129+130130+void clk_unregister(struct clk *clk)131131+{132132+ down(&clocks_sem);133133+ list_del(&clk->node);134134+ up(&clocks_sem);135135+}136136+EXPORT_SYMBOL(clk_unregister);137137+138138+static int __init clk_init(void)139139+{140140+ clk_register(&kmi_clk);141141+ clk_register(&uart_clk);142142+ clk_register(&mmci_clk);143143+ return 0;144144+}145145+arch_initcall(clk_init);
+25
arch/arm/mach-realview/clock.h
···11+/*22+ * linux/arch/arm/mach-realview/clock.h33+ *44+ * Copyright (C) 2004 ARM Limited.55+ * Written by Deep Blue Solutions Limited.66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License version 2 as99+ * published by the Free Software Foundation.1010+ */1111+struct module;1212+struct icst307_params;1313+1414+struct clk {1515+ struct list_head node;1616+ unsigned long rate;1717+ struct module *owner;1818+ const char *name;1919+ const struct icst307_params *params;2020+ void *data;2121+ void (*setvco)(struct clk *, struct icst307_vco vco);2222+};2323+2424+int clk_register(struct clk *clk);2525+void clk_unregister(struct clk *clk);
+605
arch/arm/mach-realview/core.c
···11+/*22+ * linux/arch/arm/mach-realview/core.c33+ *44+ * Copyright (C) 1999 - 2003 ARM Limited55+ * Copyright (C) 2000 Deep Blue Solutions Ltd66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the Free Software1919+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020+ */2121+#include <linux/config.h>2222+#include <linux/init.h>2323+#include <linux/device.h>2424+#include <linux/dma-mapping.h>2525+#include <linux/sysdev.h>2626+#include <linux/interrupt.h>2727+2828+#include <asm/system.h>2929+#include <asm/hardware.h>3030+#include <asm/io.h>3131+#include <asm/irq.h>3232+#include <asm/leds.h>3333+#include <asm/mach-types.h>3434+#include <asm/hardware/amba.h>3535+#include <asm/hardware/amba_clcd.h>3636+#include <asm/hardware/arm_timer.h>3737+#include <asm/hardware/icst307.h>3838+3939+#include <asm/mach/arch.h>4040+#include <asm/mach/flash.h>4141+#include <asm/mach/irq.h>4242+#include <asm/mach/time.h>4343+#include <asm/mach/map.h>4444+#include <asm/mach/mmc.h>4545+4646+#include <asm/hardware/gic.h>4747+4848+#include "core.h"4949+#include "clock.h"5050+5151+#define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET)5252+5353+/*5454+ * This is the RealView sched_clock implementation. This has5555+ * a resolution of 41.7ns, and a maximum value of about 179s.5656+ */5757+unsigned long long sched_clock(void)5858+{5959+ unsigned long long v;6060+6161+ v = (unsigned long long)readl(REALVIEW_REFCOUNTER) * 125;6262+ do_div(v, 3);6363+6464+ return v;6565+}6666+6767+6868+#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)6969+7070+static int realview_flash_init(void)7171+{7272+ u32 val;7373+7474+ val = __raw_readl(REALVIEW_FLASHCTRL);7575+ val &= ~REALVIEW_FLASHPROG_FLVPPEN;7676+ __raw_writel(val, REALVIEW_FLASHCTRL);7777+7878+ return 0;7979+}8080+8181+static void realview_flash_exit(void)8282+{8383+ u32 val;8484+8585+ val = __raw_readl(REALVIEW_FLASHCTRL);8686+ val &= ~REALVIEW_FLASHPROG_FLVPPEN;8787+ __raw_writel(val, REALVIEW_FLASHCTRL);8888+}8989+9090+static void realview_flash_set_vpp(int on)9191+{9292+ u32 val;9393+9494+ val = __raw_readl(REALVIEW_FLASHCTRL);9595+ if (on)9696+ val |= REALVIEW_FLASHPROG_FLVPPEN;9797+ else9898+ val &= ~REALVIEW_FLASHPROG_FLVPPEN;9999+ __raw_writel(val, REALVIEW_FLASHCTRL);100100+}101101+102102+static struct flash_platform_data realview_flash_data = {103103+ .map_name = "cfi_probe",104104+ .width = 4,105105+ .init = realview_flash_init,106106+ .exit = realview_flash_exit,107107+ .set_vpp = realview_flash_set_vpp,108108+};109109+110110+static struct resource realview_flash_resource = {111111+ .start = REALVIEW_FLASH_BASE,112112+ .end = REALVIEW_FLASH_BASE + REALVIEW_FLASH_SIZE,113113+ .flags = IORESOURCE_MEM,114114+};115115+116116+struct platform_device realview_flash_device = {117117+ .name = "armflash",118118+ .id = 0,119119+ .dev = {120120+ .platform_data = &realview_flash_data,121121+ },122122+ .num_resources = 1,123123+ .resource = &realview_flash_resource,124124+};125125+126126+static struct resource realview_smc91x_resources[] = {127127+ [0] = {128128+ .start = REALVIEW_ETH_BASE,129129+ .end = REALVIEW_ETH_BASE + SZ_64K - 1,130130+ .flags = IORESOURCE_MEM,131131+ },132132+ [1] = {133133+ .start = IRQ_ETH,134134+ .end = IRQ_ETH,135135+ .flags = IORESOURCE_IRQ,136136+ },137137+};138138+139139+struct platform_device realview_smc91x_device = {140140+ .name = "smc91x",141141+ .id = 0,142142+ .num_resources = ARRAY_SIZE(realview_smc91x_resources),143143+ .resource = realview_smc91x_resources,144144+};145145+146146+#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)147147+148148+static unsigned int realview_mmc_status(struct device *dev)149149+{150150+ struct amba_device *adev = container_of(dev, struct amba_device, dev);151151+ u32 mask;152152+153153+ if (adev->res.start == REALVIEW_MMCI0_BASE)154154+ mask = 1;155155+ else156156+ mask = 2;157157+158158+ return readl(REALVIEW_SYSMCI) & mask;159159+}160160+161161+struct mmc_platform_data realview_mmc0_plat_data = {162162+ .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,163163+ .status = realview_mmc_status,164164+};165165+166166+struct mmc_platform_data realview_mmc1_plat_data = {167167+ .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,168168+ .status = realview_mmc_status,169169+};170170+171171+/*172172+ * Clock handling173173+ */174174+static const struct icst307_params realview_oscvco_params = {175175+ .ref = 24000,176176+ .vco_max = 200000,177177+ .vd_min = 4 + 8,178178+ .vd_max = 511 + 8,179179+ .rd_min = 1 + 2,180180+ .rd_max = 127 + 2,181181+};182182+183183+static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco)184184+{185185+ void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET;186186+ void __iomem *sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC1_OFFSET;187187+ u32 val;188188+189189+ val = readl(sys_osc) & ~0x7ffff;190190+ val |= vco.v | (vco.r << 9) | (vco.s << 16);191191+192192+ writel(0xa05f, sys_lock);193193+ writel(val, sys_osc);194194+ writel(0, sys_lock);195195+}196196+197197+struct clk realview_clcd_clk = {198198+ .name = "CLCDCLK",199199+ .params = &realview_oscvco_params,200200+ .setvco = realview_oscvco_set,201201+};202202+203203+/*204204+ * CLCD support.205205+ */206206+#define SYS_CLCD_MODE_MASK (3 << 0)207207+#define SYS_CLCD_MODE_888 (0 << 0)208208+#define SYS_CLCD_MODE_5551 (1 << 0)209209+#define SYS_CLCD_MODE_565_RLSB (2 << 0)210210+#define SYS_CLCD_MODE_565_BLSB (3 << 0)211211+#define SYS_CLCD_NLCDIOON (1 << 2)212212+#define SYS_CLCD_VDDPOSSWITCH (1 << 3)213213+#define SYS_CLCD_PWR3V5SWITCH (1 << 4)214214+#define SYS_CLCD_ID_MASK (0x1f << 8)215215+#define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8)216216+#define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8)217217+#define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8)218218+#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)219219+#define SYS_CLCD_ID_VGA (0x1f << 8)220220+221221+static struct clcd_panel vga = {222222+ .mode = {223223+ .name = "VGA",224224+ .refresh = 60,225225+ .xres = 640,226226+ .yres = 480,227227+ .pixclock = 39721,228228+ .left_margin = 40,229229+ .right_margin = 24,230230+ .upper_margin = 32,231231+ .lower_margin = 11,232232+ .hsync_len = 96,233233+ .vsync_len = 2,234234+ .sync = 0,235235+ .vmode = FB_VMODE_NONINTERLACED,236236+ },237237+ .width = -1,238238+ .height = -1,239239+ .tim2 = TIM2_BCD | TIM2_IPC,240240+ .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),241241+ .bpp = 16,242242+};243243+244244+static struct clcd_panel sanyo_3_8_in = {245245+ .mode = {246246+ .name = "Sanyo QVGA",247247+ .refresh = 116,248248+ .xres = 320,249249+ .yres = 240,250250+ .pixclock = 100000,251251+ .left_margin = 6,252252+ .right_margin = 6,253253+ .upper_margin = 5,254254+ .lower_margin = 5,255255+ .hsync_len = 6,256256+ .vsync_len = 6,257257+ .sync = 0,258258+ .vmode = FB_VMODE_NONINTERLACED,259259+ },260260+ .width = -1,261261+ .height = -1,262262+ .tim2 = TIM2_BCD,263263+ .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),264264+ .bpp = 16,265265+};266266+267267+static struct clcd_panel sanyo_2_5_in = {268268+ .mode = {269269+ .name = "Sanyo QVGA Portrait",270270+ .refresh = 116,271271+ .xres = 240,272272+ .yres = 320,273273+ .pixclock = 100000,274274+ .left_margin = 20,275275+ .right_margin = 10,276276+ .upper_margin = 2,277277+ .lower_margin = 2,278278+ .hsync_len = 10,279279+ .vsync_len = 2,280280+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,281281+ .vmode = FB_VMODE_NONINTERLACED,282282+ },283283+ .width = -1,284284+ .height = -1,285285+ .tim2 = TIM2_IVS | TIM2_IHS | TIM2_IPC,286286+ .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),287287+ .bpp = 16,288288+};289289+290290+static struct clcd_panel epson_2_2_in = {291291+ .mode = {292292+ .name = "Epson QCIF",293293+ .refresh = 390,294294+ .xres = 176,295295+ .yres = 220,296296+ .pixclock = 62500,297297+ .left_margin = 3,298298+ .right_margin = 2,299299+ .upper_margin = 1,300300+ .lower_margin = 0,301301+ .hsync_len = 3,302302+ .vsync_len = 2,303303+ .sync = 0,304304+ .vmode = FB_VMODE_NONINTERLACED,305305+ },306306+ .width = -1,307307+ .height = -1,308308+ .tim2 = TIM2_BCD | TIM2_IPC,309309+ .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),310310+ .bpp = 16,311311+};312312+313313+/*314314+ * Detect which LCD panel is connected, and return the appropriate315315+ * clcd_panel structure. Note: we do not have any information on316316+ * the required timings for the 8.4in panel, so we presently assume317317+ * VGA timings.318318+ */319319+static struct clcd_panel *realview_clcd_panel(void)320320+{321321+ void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;322322+ struct clcd_panel *panel = &vga;323323+ u32 val;324324+325325+ val = readl(sys_clcd) & SYS_CLCD_ID_MASK;326326+ if (val == SYS_CLCD_ID_SANYO_3_8)327327+ panel = &sanyo_3_8_in;328328+ else if (val == SYS_CLCD_ID_SANYO_2_5)329329+ panel = &sanyo_2_5_in;330330+ else if (val == SYS_CLCD_ID_EPSON_2_2)331331+ panel = &epson_2_2_in;332332+ else if (val == SYS_CLCD_ID_VGA)333333+ panel = &vga;334334+ else {335335+ printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",336336+ val);337337+ panel = &vga;338338+ }339339+340340+ return panel;341341+}342342+343343+/*344344+ * Disable all display connectors on the interface module.345345+ */346346+static void realview_clcd_disable(struct clcd_fb *fb)347347+{348348+ void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;349349+ u32 val;350350+351351+ val = readl(sys_clcd);352352+ val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;353353+ writel(val, sys_clcd);354354+}355355+356356+/*357357+ * Enable the relevant connector on the interface module.358358+ */359359+static void realview_clcd_enable(struct clcd_fb *fb)360360+{361361+ void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;362362+ u32 val;363363+364364+ val = readl(sys_clcd);365365+ val &= ~SYS_CLCD_MODE_MASK;366366+367367+ switch (fb->fb.var.green.length) {368368+ case 5:369369+ val |= SYS_CLCD_MODE_5551;370370+ break;371371+ case 6:372372+ val |= SYS_CLCD_MODE_565_RLSB;373373+ break;374374+ case 8:375375+ val |= SYS_CLCD_MODE_888;376376+ break;377377+ }378378+379379+ /*380380+ * Set the MUX381381+ */382382+ writel(val, sys_clcd);383383+384384+ /*385385+ * And now enable the PSUs386386+ */387387+ val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;388388+ writel(val, sys_clcd);389389+}390390+391391+static unsigned long framesize = SZ_1M;392392+393393+static int realview_clcd_setup(struct clcd_fb *fb)394394+{395395+ dma_addr_t dma;396396+397397+ fb->panel = realview_clcd_panel();398398+399399+ fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,400400+ &dma, GFP_KERNEL);401401+ if (!fb->fb.screen_base) {402402+ printk(KERN_ERR "CLCD: unable to map framebuffer\n");403403+ return -ENOMEM;404404+ }405405+406406+ fb->fb.fix.smem_start = dma;407407+ fb->fb.fix.smem_len = framesize;408408+409409+ return 0;410410+}411411+412412+static int realview_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)413413+{414414+ return dma_mmap_writecombine(&fb->dev->dev, vma,415415+ fb->fb.screen_base,416416+ fb->fb.fix.smem_start,417417+ fb->fb.fix.smem_len);418418+}419419+420420+static void realview_clcd_remove(struct clcd_fb *fb)421421+{422422+ dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,423423+ fb->fb.screen_base, fb->fb.fix.smem_start);424424+}425425+426426+struct clcd_board clcd_plat_data = {427427+ .name = "RealView",428428+ .check = clcdfb_check,429429+ .decode = clcdfb_decode,430430+ .disable = realview_clcd_disable,431431+ .enable = realview_clcd_enable,432432+ .setup = realview_clcd_setup,433433+ .mmap = realview_clcd_mmap,434434+ .remove = realview_clcd_remove,435435+};436436+437437+#ifdef CONFIG_LEDS438438+#define VA_LEDS_BASE (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)439439+440440+void realview_leds_event(led_event_t ledevt)441441+{442442+ unsigned long flags;443443+ u32 val;444444+445445+ local_irq_save(flags);446446+ val = readl(VA_LEDS_BASE);447447+448448+ switch (ledevt) {449449+ case led_idle_start:450450+ val = val & ~REALVIEW_SYS_LED0;451451+ break;452452+453453+ case led_idle_end:454454+ val = val | REALVIEW_SYS_LED0;455455+ break;456456+457457+ case led_timer:458458+ val = val ^ REALVIEW_SYS_LED1;459459+ break;460460+461461+ case led_halted:462462+ val = 0;463463+ break;464464+465465+ default:466466+ break;467467+ }468468+469469+ writel(val, VA_LEDS_BASE);470470+ local_irq_restore(flags);471471+}472472+#endif /* CONFIG_LEDS */473473+474474+/*475475+ * Where is the timer (VA)?476476+ */477477+#define TIMER0_VA_BASE __io_address(REALVIEW_TIMER0_1_BASE)478478+#define TIMER1_VA_BASE (__io_address(REALVIEW_TIMER0_1_BASE) + 0x20)479479+#define TIMER2_VA_BASE __io_address(REALVIEW_TIMER2_3_BASE)480480+#define TIMER3_VA_BASE (__io_address(REALVIEW_TIMER2_3_BASE) + 0x20)481481+482482+/*483483+ * How long is the timer interval?484484+ */485485+#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)486486+#if TIMER_INTERVAL >= 0x100000487487+#define TIMER_RELOAD (TIMER_INTERVAL >> 8)488488+#define TIMER_DIVISOR (TIMER_CTRL_DIV256)489489+#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)490490+#elif TIMER_INTERVAL >= 0x10000491491+#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */492492+#define TIMER_DIVISOR (TIMER_CTRL_DIV16)493493+#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)494494+#else495495+#define TIMER_RELOAD (TIMER_INTERVAL)496496+#define TIMER_DIVISOR (TIMER_CTRL_DIV1)497497+#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)498498+#endif499499+500500+/*501501+ * Returns number of ms since last clock interrupt. Note that interrupts502502+ * will have been disabled by do_gettimeoffset()503503+ */504504+static unsigned long realview_gettimeoffset(void)505505+{506506+ unsigned long ticks1, ticks2, status;507507+508508+ /*509509+ * Get the current number of ticks. Note that there is a race510510+ * condition between us reading the timer and checking for511511+ * an interrupt. We get around this by ensuring that the512512+ * counter has not reloaded between our two reads.513513+ */514514+ ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;515515+ do {516516+ ticks1 = ticks2;517517+ status = __raw_readl(__io_address(REALVIEW_GIC_DIST_BASE + GIC_DIST_PENDING_SET)518518+ + ((IRQ_TIMERINT0_1 >> 5) << 2));519519+ ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;520520+ } while (ticks2 > ticks1);521521+522522+ /*523523+ * Number of ticks since last interrupt.524524+ */525525+ ticks1 = TIMER_RELOAD - ticks2;526526+527527+ /*528528+ * Interrupt pending? If so, we've reloaded once already.529529+ *530530+ * FIXME: Need to check this is effectively timer 0 that expires531531+ */532532+ if (status & IRQMASK_TIMERINT0_1)533533+ ticks1 += TIMER_RELOAD;534534+535535+ /*536536+ * Convert the ticks to usecs537537+ */538538+ return TICKS2USECS(ticks1);539539+}540540+541541+/*542542+ * IRQ handler for the timer543543+ */544544+static irqreturn_t realview_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)545545+{546546+ write_seqlock(&xtime_lock);547547+548548+ // ...clear the interrupt549549+ writel(1, TIMER0_VA_BASE + TIMER_INTCLR);550550+551551+ timer_tick(regs);552552+553553+ write_sequnlock(&xtime_lock);554554+555555+ return IRQ_HANDLED;556556+}557557+558558+static struct irqaction realview_timer_irq = {559559+ .name = "RealView Timer Tick",560560+ .flags = SA_INTERRUPT | SA_TIMER,561561+ .handler = realview_timer_interrupt,562562+};563563+564564+/*565565+ * Set up timer interrupt, and return the current time in seconds.566566+ */567567+static void __init realview_timer_init(void)568568+{569569+ u32 val;570570+571571+ /* 572572+ * set clock frequency: 573573+ * REALVIEW_REFCLK is 32KHz574574+ * REALVIEW_TIMCLK is 1MHz575575+ */576576+ val = readl(__io_address(REALVIEW_SCTL_BASE));577577+ writel((REALVIEW_TIMCLK << REALVIEW_TIMER1_EnSel) |578578+ (REALVIEW_TIMCLK << REALVIEW_TIMER2_EnSel) | 579579+ (REALVIEW_TIMCLK << REALVIEW_TIMER3_EnSel) |580580+ (REALVIEW_TIMCLK << REALVIEW_TIMER4_EnSel) | val,581581+ __io_address(REALVIEW_SCTL_BASE));582582+583583+ /*584584+ * Initialise to a known state (all timers off)585585+ */586586+ writel(0, TIMER0_VA_BASE + TIMER_CTRL);587587+ writel(0, TIMER1_VA_BASE + TIMER_CTRL);588588+ writel(0, TIMER2_VA_BASE + TIMER_CTRL);589589+ writel(0, TIMER3_VA_BASE + TIMER_CTRL);590590+591591+ writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);592592+ writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_VALUE);593593+ writel(TIMER_DIVISOR | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC |594594+ TIMER_CTRL_IE, TIMER0_VA_BASE + TIMER_CTRL);595595+596596+ /* 597597+ * Make irqs happen for the system timer598598+ */599599+ setup_irq(IRQ_TIMERINT0_1, &realview_timer_irq);600600+}601601+602602+struct sys_timer realview_timer = {603603+ .init = realview_timer_init,604604+ .offset = realview_gettimeoffset,605605+};
+118
arch/arm/mach-realview/core.h
···11+/*22+ * linux/arch/arm/mach-realview/core.h33+ *44+ * Copyright (C) 2004 ARM Limited55+ * Copyright (C) 2000 Deep Blue Solutions Ltd66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the Free Software1919+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020+ */2121+2222+#ifndef __ASM_ARCH_REALVIEW_H2323+#define __ASM_ARCH_REALVIEW_H2424+2525+#include <asm/hardware/amba.h>2626+#include <asm/io.h>2727+2828+#define __io_address(n) __io(IO_ADDRESS(n))2929+3030+extern struct sys_timer realview_timer;3131+3232+#define AMBA_DEVICE(name,busid,base,plat) \3333+static struct amba_device name##_device = { \3434+ .dev = { \3535+ .coherent_dma_mask = ~0, \3636+ .bus_id = busid, \3737+ .platform_data = plat, \3838+ }, \3939+ .res = { \4040+ .start = REALVIEW_##base##_BASE, \4141+ .end = (REALVIEW_##base##_BASE) + SZ_4K - 1,\4242+ .flags = IORESOURCE_MEM, \4343+ }, \4444+ .dma_mask = ~0, \4545+ .irq = base##_IRQ, \4646+ /* .dma = base##_DMA,*/ \4747+}4848+4949+/*5050+ * These devices are connected via the core APB bridge5151+ */5252+#define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ }5353+#define GPIO2_DMA { 0, 0 }5454+#define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ }5555+#define GPIO3_DMA { 0, 0 }5656+5757+#define AACI_IRQ { IRQ_AACI, NO_IRQ }5858+#define AACI_DMA { 0x80, 0x81 }5959+#define MMCI0_IRQ { IRQ_MMCI0A,IRQ_MMCI0B }6060+#define MMCI0_DMA { 0x84, 0 }6161+#define KMI0_IRQ { IRQ_KMI0, NO_IRQ }6262+#define KMI0_DMA { 0, 0 }6363+#define KMI1_IRQ { IRQ_KMI1, NO_IRQ }6464+#define KMI1_DMA { 0, 0 }6565+6666+/*6767+ * These devices are connected directly to the multi-layer AHB switch6868+ */6969+#define SMC_IRQ { NO_IRQ, NO_IRQ }7070+#define SMC_DMA { 0, 0 }7171+#define MPMC_IRQ { NO_IRQ, NO_IRQ }7272+#define MPMC_DMA { 0, 0 }7373+#define CLCD_IRQ { IRQ_CLCDINT, NO_IRQ }7474+#define CLCD_DMA { 0, 0 }7575+#define DMAC_IRQ { IRQ_DMAINT, NO_IRQ }7676+#define DMAC_DMA { 0, 0 }7777+7878+/*7979+ * These devices are connected via the core APB bridge8080+ */8181+#define SCTL_IRQ { NO_IRQ, NO_IRQ }8282+#define SCTL_DMA { 0, 0 }8383+#define WATCHDOG_IRQ { IRQ_WDOGINT, NO_IRQ }8484+#define WATCHDOG_DMA { 0, 0 }8585+#define GPIO0_IRQ { IRQ_GPIOINT0, NO_IRQ }8686+#define GPIO0_DMA { 0, 0 }8787+#define GPIO1_IRQ { IRQ_GPIOINT1, NO_IRQ }8888+#define GPIO1_DMA { 0, 0 }8989+#define RTC_IRQ { IRQ_RTCINT, NO_IRQ }9090+#define RTC_DMA { 0, 0 }9191+9292+/*9393+ * These devices are connected via the DMA APB bridge9494+ */9595+#define SCI_IRQ { IRQ_SCIINT, NO_IRQ }9696+#define SCI_DMA { 7, 6 }9797+#define UART0_IRQ { IRQ_UARTINT0, NO_IRQ }9898+#define UART0_DMA { 15, 14 }9999+#define UART1_IRQ { IRQ_UARTINT1, NO_IRQ }100100+#define UART1_DMA { 13, 12 }101101+#define UART2_IRQ { IRQ_UARTINT2, NO_IRQ }102102+#define UART2_DMA { 11, 10 }103103+#define UART3_IRQ { IRQ_UART3, NO_IRQ }104104+#define UART3_DMA { 0x86, 0x87 }105105+#define SSP_IRQ { IRQ_SSPINT, NO_IRQ }106106+#define SSP_DMA { 9, 8 }107107+108108+109109+extern struct platform_device realview_flash_device;110110+extern struct platform_device realview_smc91x_device;111111+extern struct mmc_platform_data realview_mmc0_plat_data;112112+extern struct mmc_platform_data realview_mmc1_plat_data;113113+extern struct clk realview_clcd_clk;114114+extern struct clcd_board clcd_plat_data;115115+116116+extern void realview_leds_event(led_event_t ledevt);117117+118118+#endif
+142
arch/arm/mach-realview/realview_eb.c
···11+/*22+ * linux/arch/arm/mach-realview/realview_eb.c33+ *44+ * Copyright (C) 2004 ARM Limited55+ * Copyright (C) 2000 Deep Blue Solutions Ltd66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the Free Software1919+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020+ */2121+2222+#include <linux/config.h>2323+#include <linux/init.h>2424+#include <linux/device.h>2525+#include <linux/sysdev.h>2626+2727+#include <asm/hardware.h>2828+#include <asm/io.h>2929+#include <asm/irq.h>3030+#include <asm/leds.h>3131+#include <asm/mach-types.h>3232+#include <asm/hardware/gic.h>3333+#include <asm/hardware/amba.h>3434+#include <asm/hardware/icst307.h>3535+3636+#include <asm/mach/arch.h>3737+#include <asm/mach/map.h>3838+#include <asm/mach/mmc.h>3939+4040+#include <asm/arch/irqs.h>4141+4242+#include "core.h"4343+#include "clock.h"4444+4545+static struct map_desc realview_eb_io_desc[] __initdata = {4646+ { IO_ADDRESS(REALVIEW_SYS_BASE), REALVIEW_SYS_BASE, SZ_4K, MT_DEVICE },4747+ { IO_ADDRESS(REALVIEW_GIC_CPU_BASE), REALVIEW_GIC_CPU_BASE, SZ_4K, MT_DEVICE },4848+ { IO_ADDRESS(REALVIEW_GIC_DIST_BASE), REALVIEW_GIC_DIST_BASE, SZ_4K, MT_DEVICE },4949+ { IO_ADDRESS(REALVIEW_SCTL_BASE), REALVIEW_SCTL_BASE, SZ_4K, MT_DEVICE },5050+ { IO_ADDRESS(REALVIEW_TIMER0_1_BASE), REALVIEW_TIMER0_1_BASE, SZ_4K, MT_DEVICE },5151+ { IO_ADDRESS(REALVIEW_TIMER2_3_BASE), REALVIEW_TIMER2_3_BASE, SZ_4K, MT_DEVICE },5252+#ifdef CONFIG_DEBUG_LL5353+ { IO_ADDRESS(REALVIEW_UART0_BASE), REALVIEW_UART0_BASE, SZ_4K, MT_DEVICE },5454+#endif5555+};5656+5757+static void __init realview_eb_map_io(void)5858+{5959+ iotable_init(realview_eb_io_desc, ARRAY_SIZE(realview_eb_io_desc));6060+}6161+6262+/* FPGA Primecells */6363+AMBA_DEVICE(aaci, "fpga:04", AACI, NULL);6464+AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data);6565+AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL);6666+AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL);6767+AMBA_DEVICE(uart3, "fpga:09", UART3, NULL);6868+6969+/* DevChip Primecells */7070+AMBA_DEVICE(smc, "dev:00", SMC, NULL);7171+AMBA_DEVICE(clcd, "dev:20", CLCD, &clcd_plat_data);7272+AMBA_DEVICE(dmac, "dev:30", DMAC, NULL);7373+AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL);7474+AMBA_DEVICE(wdog, "dev:e1", WATCHDOG, NULL);7575+AMBA_DEVICE(gpio0, "dev:e4", GPIO0, NULL);7676+AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL);7777+AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL);7878+AMBA_DEVICE(rtc, "dev:e8", RTC, NULL);7979+AMBA_DEVICE(sci0, "dev:f0", SCI, NULL);8080+AMBA_DEVICE(uart0, "dev:f1", UART0, NULL);8181+AMBA_DEVICE(uart1, "dev:f2", UART1, NULL);8282+AMBA_DEVICE(uart2, "dev:f3", UART2, NULL);8383+AMBA_DEVICE(ssp0, "dev:f4", SSP, NULL);8484+8585+static struct amba_device *amba_devs[] __initdata = {8686+ &dmac_device,8787+ &uart0_device,8888+ &uart1_device,8989+ &uart2_device,9090+ &uart3_device,9191+ &smc_device,9292+ &clcd_device,9393+ &sctl_device,9494+ &wdog_device,9595+ &gpio0_device,9696+ &gpio1_device,9797+ &gpio2_device,9898+ &rtc_device,9999+ &sci0_device,100100+ &ssp0_device,101101+ &aaci_device,102102+ &mmc0_device,103103+ &kmi0_device,104104+ &kmi1_device,105105+};106106+107107+static void __init gic_init_irq(void)108108+{109109+ gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE));110110+ gic_cpu_init(__io_address(REALVIEW_GIC_CPU_BASE));111111+}112112+113113+static void __init realview_eb_init(void)114114+{115115+ int i;116116+117117+ clk_register(&realview_clcd_clk);118118+119119+ platform_device_register(&realview_flash_device);120120+ platform_device_register(&realview_smc91x_device);121121+122122+ for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {123123+ struct amba_device *d = amba_devs[i];124124+ amba_device_register(d, &iomem_resource);125125+ }126126+127127+#ifdef CONFIG_LEDS128128+ leds_event = realview_leds_event;129129+#endif130130+}131131+132132+MACHINE_START(REALVIEW_EB, "ARM-RealView EB")133133+ /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */134134+ .phys_ram = 0x00000000,135135+ .phys_io = REALVIEW_UART0_BASE,136136+ .io_pg_offst = (IO_ADDRESS(REALVIEW_UART0_BASE) >> 18) & 0xfffc,137137+ .boot_params = 0x00000100,138138+ .map_io = realview_eb_map_io,139139+ .init_irq = gic_init_irq,140140+ .timer = &realview_timer,141141+ .init_machine = realview_eb_init,142142+MACHINE_END
+3-3
arch/arm/mm/Kconfig
···120120121121# ARM926T122122config CPU_ARM926T123123- bool "Support ARM926T processor" if ARCH_INTEGRATOR124124- depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX123123+ bool "Support ARM926T processor"124124+ depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB125125 default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX126126 select CPU_32v5127127 select CPU_ABRT_EV5TJ···242242# ARMv6243243config CPU_V6244244 bool "Support ARM V6 processor"245245- depends on ARCH_INTEGRATOR245245+ depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB246246 select CPU_32v6247247 select CPU_ABRT_EV6248248 select CPU_CACHE_V6
+38
include/asm-arm/arch-realview/debug-macro.S
···11+/* linux/include/asm-arm/arch-realview/debug-macro.S22+ *33+ * Debugging macro include header44+ *55+ * Copyright (C) 1994-1999 Russell King66+ * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+ *1212+*/1313+1414+#include <asm/hardware/amba_serial.h>1515+1616+ .macro addruart,rx1717+ mrc p15, 0, \rx, c1, c01818+ tst \rx, #1 @ MMU enabled?1919+ moveq \rx, #0x100000002020+ movne \rx, #0xf1000000 @ virtual base2121+ orr \rx, \rx, #0x000090002222+ .endm2323+2424+ .macro senduart,rd,rx2525+ strb \rd, [\rx, #UART01x_DR]2626+ .endm2727+2828+ .macro waituart,rd,rx2929+1001: ldr \rd, [\rx, #0x18] @ UARTFLG3030+ tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full3131+ bne 1001b3232+ .endm3333+3434+ .macro busyuart,rd,rx3535+1001: ldr \rd, [\rx, #0x18] @ UARTFLG3636+ tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy3737+ bne 1001b3838+ .endm
+27
include/asm-arm/arch-realview/dma.h
···11+/*22+ * linux/include/asm-arm/arch-realview/dma.h33+ *44+ * Copyright (C) 2003 ARM Limited.55+ * Copyright (C) 1997,1998 Russell King66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the Free Software1919+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020+ */2121+#ifndef __ASM_ARCH_DMA_H2222+#define __ASM_ARCH_DMA_H2323+2424+#define MAX_DMA_ADDRESS 0xffffffff2525+#define MAX_DMA_CHANNELS 02626+2727+#endif /* _ASM_ARCH_DMA_H */
+49
include/asm-arm/arch-realview/entry-macro.S
···11+/*22+ * include/asm-arm/arch-realview/entry-macro.S33+ *44+ * Low-level IRQ helper macros for RealView platforms55+ *66+ * This file is licensed under the terms of the GNU General Public77+ * License version 2. This program is licensed "as is" without any88+ * warranty of any kind, whether express or implied.99+ */1010+1111+#include <asm/hardware/gic.h>1212+1313+ .macro disable_fiq1414+ .endm1515+1616+ /*1717+ * The interrupt numbering scheme is defined in the1818+ * interrupt controller spec. To wit:1919+ *2020+ * Interrupts 0-15 are IPI2121+ * 16-28 are reserved2222+ * 29-31 are local. We allow 30 to be used for the watchdog.2323+ * 32-1020 are global2424+ * 1021-1022 are reserved2525+ * 1023 is "spurious" (no interrupt)2626+ *2727+ * For now, we ignore all local interrupts so only return an interrupt if it's2828+ * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs.2929+ *3030+ * A simple read from the controller will tell us the number of the highest3131+ * priority enabled interrupt. We then just need to check whether it is in the3232+ * valid range for an IRQ (30-1020 inclusive).3333+ */3434+3535+ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp3636+3737+ ldr \base, =IO_ADDRESS(REALVIEW_GIC_CPU_BASE)3838+ ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */3939+4040+ ldr \tmp, =10214141+4242+ bic \irqnr, \irqstat, #0x1c004343+4444+ cmp \irqnr, #294545+ cmpcc \irqnr, \irqnr4646+ cmpne \irqnr, \tmp4747+ cmpcs \irqnr, \irqnr4848+4949+ .endm
+31
include/asm-arm/arch-realview/hardware.h
···11+/*22+ * linux/include/asm-arm/arch-realview/hardware.h33+ *44+ * This file contains the hardware definitions of the RealView boards.55+ *66+ * Copyright (C) 2003 ARM Limited.77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License as published by1010+ * the Free Software Foundation; either version 2 of the License, or1111+ * (at your option) any later version.1212+ *1313+ * This program is distributed in the hope that it will be useful,1414+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1515+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1616+ * GNU General Public License for more details.1717+ *1818+ * You should have received a copy of the GNU General Public License1919+ * along with this program; if not, write to the Free Software2020+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2121+ */2222+#ifndef __ASM_ARCH_HARDWARE_H2323+#define __ASM_ARCH_HARDWARE_H2424+2525+#include <asm/sizes.h>2626+#include <asm/arch/platform.h>2727+2828+/* macro to get at IO space when running virtually */2929+#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)3030+3131+#endif
+34
include/asm-arm/arch-realview/io.h
···11+/*22+ * linux/include/asm-arm/arch-realview/io.h33+ *44+ * Copyright (C) 2003 ARM Limited55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License as published by88+ * the Free Software Foundation; either version 2 of the License, or99+ * (at your option) any later version.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+#ifndef __ASM_ARM_ARCH_IO_H2121+#define __ASM_ARM_ARCH_IO_H2222+2323+#define IO_SPACE_LIMIT 0xffffffff2424+2525+static inline void __iomem *__io(unsigned long addr)2626+{2727+ return (void __iomem *)addr;2828+}2929+3030+#define __io(a) __io(a)3131+#define __mem_pci(a) (a)3232+#define __mem_isa(a) (a)3333+3434+#endif
+103
include/asm-arm/arch-realview/irqs.h
···11+/*22+ * linux/include/asm-arm/arch-realview/irqs.h33+ *44+ * Copyright (C) 2003 ARM Limited55+ * Copyright (C) 2000 Deep Blue Solutions Ltd.66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the Free Software1919+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020+ */2121+2222+#include <asm/arch/platform.h>2323+2424+/* 2525+ * IRQ interrupts definitions are the same the INT definitions2626+ * held within platform.h2727+ */2828+#define IRQ_GIC_START 322929+#define IRQ_WDOGINT (IRQ_GIC_START + INT_WDOGINT)3030+#define IRQ_SOFTINT (IRQ_GIC_START + INT_SOFTINT)3131+#define IRQ_COMMRx (IRQ_GIC_START + INT_COMMRx)3232+#define IRQ_COMMTx (IRQ_GIC_START + INT_COMMTx)3333+#define IRQ_TIMERINT0_1 (IRQ_GIC_START + INT_TIMERINT0_1)3434+#define IRQ_TIMERINT2_3 (IRQ_GIC_START + INT_TIMERINT2_3)3535+#define IRQ_GPIOINT0 (IRQ_GIC_START + INT_GPIOINT0)3636+#define IRQ_GPIOINT1 (IRQ_GIC_START + INT_GPIOINT1)3737+#define IRQ_GPIOINT2 (IRQ_GIC_START + INT_GPIOINT2)3838+#define IRQ_GPIOINT3 (IRQ_GIC_START + INT_GPIOINT3)3939+#define IRQ_RTCINT (IRQ_GIC_START + INT_RTCINT)4040+#define IRQ_SSPINT (IRQ_GIC_START + INT_SSPINT)4141+#define IRQ_UARTINT0 (IRQ_GIC_START + INT_UARTINT0)4242+#define IRQ_UARTINT1 (IRQ_GIC_START + INT_UARTINT1)4343+#define IRQ_UARTINT2 (IRQ_GIC_START + INT_UARTINT2)4444+#define IRQ_UART3 (IRQ_GIC_START + INT_UARTINT3)4545+#define IRQ_SCIINT (IRQ_GIC_START + INT_SCIINT)4646+#define IRQ_CLCDINT (IRQ_GIC_START + INT_CLCDINT)4747+#define IRQ_DMAINT (IRQ_GIC_START + INT_DMAINT)4848+#define IRQ_PWRFAILINT (IRQ_GIC_START + INT_PWRFAILINT)4949+#define IRQ_MBXINT (IRQ_GIC_START + INT_MBXINT)5050+#define IRQ_GNDINT (IRQ_GIC_START + INT_GNDINT)5151+#define IRQ_MMCI0B (IRQ_GIC_START + INT_MMCI0B)5252+#define IRQ_MMCI1B (IRQ_GIC_START + INT_MMCI1B)5353+#define IRQ_KMI0 (IRQ_GIC_START + INT_KMI0)5454+#define IRQ_KMI1 (IRQ_GIC_START + INT_KMI1)5555+#define IRQ_SCI3 (IRQ_GIC_START + INT_SCI3)5656+#define IRQ_CLCD (IRQ_GIC_START + INT_CLCD)5757+#define IRQ_TOUCH (IRQ_GIC_START + INT_TOUCH)5858+#define IRQ_KEYPAD (IRQ_GIC_START + INT_KEYPAD)5959+#define IRQ_DoC (IRQ_GIC_START + INT_DoC)6060+#define IRQ_MMCI0A (IRQ_GIC_START + INT_MMCI0A)6161+#define IRQ_MMCI1A (IRQ_GIC_START + INT_MMCI1A)6262+#define IRQ_AACI (IRQ_GIC_START + INT_AACI)6363+#define IRQ_ETH (IRQ_GIC_START + INT_ETH)6464+#define IRQ_USB (IRQ_GIC_START + INT_USB)6565+6666+#define IRQMASK_WDOGINT INTMASK_WDOGINT6767+#define IRQMASK_SOFTINT INTMASK_SOFTINT6868+#define IRQMASK_COMMRx INTMASK_COMMRx6969+#define IRQMASK_COMMTx INTMASK_COMMTx7070+#define IRQMASK_TIMERINT0_1 INTMASK_TIMERINT0_17171+#define IRQMASK_TIMERINT2_3 INTMASK_TIMERINT2_37272+#define IRQMASK_GPIOINT0 INTMASK_GPIOINT07373+#define IRQMASK_GPIOINT1 INTMASK_GPIOINT17474+#define IRQMASK_GPIOINT2 INTMASK_GPIOINT27575+#define IRQMASK_GPIOINT3 INTMASK_GPIOINT37676+#define IRQMASK_RTCINT INTMASK_RTCINT7777+#define IRQMASK_SSPINT INTMASK_SSPINT7878+#define IRQMASK_UARTINT0 INTMASK_UARTINT07979+#define IRQMASK_UARTINT1 INTMASK_UARTINT18080+#define IRQMASK_UARTINT2 INTMASK_UARTINT28181+#define IRQMASK_SCIINT INTMASK_SCIINT8282+#define IRQMASK_CLCDINT INTMASK_CLCDINT8383+#define IRQMASK_DMAINT INTMASK_DMAINT8484+#define IRQMASK_PWRFAILINT INTMASK_PWRFAILINT8585+#define IRQMASK_MBXINT INTMASK_MBXINT8686+#define IRQMASK_GNDINT INTMASK_GNDINT8787+#define IRQMASK_MMCI0B INTMASK_MMCI0B8888+#define IRQMASK_MMCI1B INTMASK_MMCI1B8989+#define IRQMASK_KMI0 INTMASK_KMI09090+#define IRQMASK_KMI1 INTMASK_KMI19191+#define IRQMASK_SCI3 INTMASK_SCI39292+#define IRQMASK_UART3 INTMASK_UART39393+#define IRQMASK_CLCD INTMASK_CLCD9494+#define IRQMASK_TOUCH INTMASK_TOUCH9595+#define IRQMASK_KEYPAD INTMASK_KEYPAD9696+#define IRQMASK_DoC INTMASK_DoC9797+#define IRQMASK_MMCI0A INTMASK_MMCI0A9898+#define IRQMASK_MMCI1A INTMASK_MMCI1A9999+#define IRQMASK_AACI INTMASK_AACI100100+#define IRQMASK_ETH INTMASK_ETH101101+#define IRQMASK_USB INTMASK_USB102102+103103+#define NR_IRQS (IRQ_GIC_START + 64)
+38
include/asm-arm/arch-realview/memory.h
···11+/*22+ * linux/include/asm-arm/arch-realview/memory.h33+ *44+ * Copyright (C) 2003 ARM Limited55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License as published by88+ * the Free Software Foundation; either version 2 of the License, or99+ * (at your option) any later version.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+#ifndef __ASM_ARCH_MEMORY_H2121+#define __ASM_ARCH_MEMORY_H2222+2323+/*2424+ * Physical DRAM offset.2525+ */2626+#define PHYS_OFFSET (0x00000000UL)2727+2828+/*2929+ * Virtual view <-> DMA view memory address translations3030+ * virt_to_bus: Used to translate the virtual address to an3131+ * address suitable to be passed to set_dma_addr3232+ * bus_to_virt: Used to convert an address for DMA operations3333+ * to an address that the kernel can use.3434+ */3535+#define __virt_to_bus(x) ((x) - PAGE_OFFSET)3636+#define __bus_to_virt(x) ((x) + PAGE_OFFSET)3737+3838+#endif
+19
include/asm-arm/arch-realview/param.h
···11+/*22+ * linux/include/asm-arm/arch-realview/param.h33+ *44+ * Copyright (C) 2002 ARM Limited55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License as published by88+ * the Free Software Foundation; either version 2 of the License, or99+ * (at your option) any later version.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */
+395
include/asm-arm/arch-realview/platform.h
···11+/*22+ * linux/include/asm-arm/arch-realview/platform.h33+ *44+ * Copyright (c) ARM Limited 2003. All rights reserved.55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License as published by88+ * the Free Software Foundation; either version 2 of the License, or99+ * (at your option) any later version.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+2121+#ifndef __address_h2222+#define __address_h 12323+2424+/*2525+ * Memory definitions2626+ */2727+#define REALVIEW_BOOT_ROM_LO 0x30000000 /* DoC Base (64Mb)...*/2828+#define REALVIEW_BOOT_ROM_HI 0x300000002929+#define REALVIEW_BOOT_ROM_BASE REALVIEW_BOOT_ROM_HI /* Normal position */3030+#define REALVIEW_BOOT_ROM_SIZE SZ_64M3131+3232+#define REALVIEW_SSRAM_BASE /* REALVIEW_SSMC_BASE ? */3333+#define REALVIEW_SSRAM_SIZE SZ_2M3434+3535+#define REALVIEW_FLASH_BASE 0x400000003636+#define REALVIEW_FLASH_SIZE SZ_64M3737+3838+/* 3939+ * SDRAM4040+ */4141+#define REALVIEW_SDRAM_BASE 0x000000004242+4343+/* 4444+ * Logic expansion modules4545+ * 4646+ */4747+4848+4949+/* ------------------------------------------------------------------------5050+ * RealView Registers5151+ * ------------------------------------------------------------------------5252+ * 5353+ */5454+#define REALVIEW_SYS_ID_OFFSET 0x005555+#define REALVIEW_SYS_SW_OFFSET 0x045656+#define REALVIEW_SYS_LED_OFFSET 0x085757+#define REALVIEW_SYS_OSC0_OFFSET 0x0C5858+5959+#define REALVIEW_SYS_OSC1_OFFSET 0x106060+#define REALVIEW_SYS_OSC2_OFFSET 0x146161+#define REALVIEW_SYS_OSC3_OFFSET 0x186262+#define REALVIEW_SYS_OSC4_OFFSET 0x1C /* OSC1 for RealView/AB */6363+6464+#define REALVIEW_SYS_LOCK_OFFSET 0x206565+#define REALVIEW_SYS_100HZ_OFFSET 0x246666+#define REALVIEW_SYS_CFGDATA1_OFFSET 0x286767+#define REALVIEW_SYS_CFGDATA2_OFFSET 0x2C6868+#define REALVIEW_SYS_FLAGS_OFFSET 0x306969+#define REALVIEW_SYS_FLAGSSET_OFFSET 0x307070+#define REALVIEW_SYS_FLAGSCLR_OFFSET 0x347171+#define REALVIEW_SYS_NVFLAGS_OFFSET 0x387272+#define REALVIEW_SYS_NVFLAGSSET_OFFSET 0x387373+#define REALVIEW_SYS_NVFLAGSCLR_OFFSET 0x3C7474+#define REALVIEW_SYS_RESETCTL_OFFSET 0x407575+#define REALVIEW_SYS_PCICTL_OFFSET 0x447676+#define REALVIEW_SYS_MCI_OFFSET 0x487777+#define REALVIEW_SYS_FLASH_OFFSET 0x4C7878+#define REALVIEW_SYS_CLCD_OFFSET 0x507979+#define REALVIEW_SYS_CLCDSER_OFFSET 0x548080+#define REALVIEW_SYS_BOOTCS_OFFSET 0x588181+#define REALVIEW_SYS_24MHz_OFFSET 0x5C8282+#define REALVIEW_SYS_MISC_OFFSET 0x608383+#define REALVIEW_SYS_IOSEL_OFFSET 0x708484+#define REALVIEW_SYS_TEST_OSC0_OFFSET 0x808585+#define REALVIEW_SYS_TEST_OSC1_OFFSET 0x848686+#define REALVIEW_SYS_TEST_OSC2_OFFSET 0x888787+#define REALVIEW_SYS_TEST_OSC3_OFFSET 0x8C8888+#define REALVIEW_SYS_TEST_OSC4_OFFSET 0x908989+9090+#define REALVIEW_SYS_BASE 0x100000009191+#define REALVIEW_SYS_ID (REALVIEW_SYS_BASE + REALVIEW_SYS_ID_OFFSET)9292+#define REALVIEW_SYS_SW (REALVIEW_SYS_BASE + REALVIEW_SYS_SW_OFFSET)9393+#define REALVIEW_SYS_LED (REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET)9494+#define REALVIEW_SYS_OSC0 (REALVIEW_SYS_BASE + REALVIEW_SYS_OSC0_OFFSET)9595+#define REALVIEW_SYS_OSC1 (REALVIEW_SYS_BASE + REALVIEW_SYS_OSC1_OFFSET)9696+9797+#define REALVIEW_SYS_LOCK (REALVIEW_SYS_BASE + REALVIEW_SYS_LOCK_OFFSET)9898+#define REALVIEW_SYS_100HZ (REALVIEW_SYS_BASE + REALVIEW_SYS_100HZ_OFFSET)9999+#define REALVIEW_SYS_CFGDATA1 (REALVIEW_SYS_BASE + REALVIEW_SYS_CFGDATA1_OFFSET)100100+#define REALVIEW_SYS_CFGDATA2 (REALVIEW_SYS_BASE + REALVIEW_SYS_CFGDATA2_OFFSET)101101+#define REALVIEW_SYS_FLAGS (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGS_OFFSET)102102+#define REALVIEW_SYS_FLAGSSET (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGSSET_OFFSET)103103+#define REALVIEW_SYS_FLAGSCLR (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGSCLR_OFFSET)104104+#define REALVIEW_SYS_NVFLAGS (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGS_OFFSET)105105+#define REALVIEW_SYS_NVFLAGSSET (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGSSET_OFFSET)106106+#define REALVIEW_SYS_NVFLAGSCLR (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGSCLR_OFFSET)107107+#define REALVIEW_SYS_RESETCTL (REALVIEW_SYS_BASE + REALVIEW_SYS_RESETCTL_OFFSET)108108+#define REALVIEW_SYS_PCICTL (REALVIEW_SYS_BASE + REALVIEW_SYS_PCICTL_OFFSET)109109+#define REALVIEW_SYS_MCI (REALVIEW_SYS_BASE + REALVIEW_SYS_MCI_OFFSET)110110+#define REALVIEW_SYS_FLASH (REALVIEW_SYS_BASE + REALVIEW_SYS_FLASH_OFFSET)111111+#define REALVIEW_SYS_CLCD (REALVIEW_SYS_BASE + REALVIEW_SYS_CLCD_OFFSET)112112+#define REALVIEW_SYS_CLCDSER (REALVIEW_SYS_BASE + REALVIEW_SYS_CLCDSER_OFFSET)113113+#define REALVIEW_SYS_BOOTCS (REALVIEW_SYS_BASE + REALVIEW_SYS_BOOTCS_OFFSET)114114+#define REALVIEW_SYS_24MHz (REALVIEW_SYS_BASE + REALVIEW_SYS_24MHz_OFFSET)115115+#define REALVIEW_SYS_MISC (REALVIEW_SYS_BASE + REALVIEW_SYS_MISC_OFFSET)116116+#define REALVIEW_SYS_IOSEL (REALVIEW_SYS_BASE + REALVIEW_SYS_IOSEL_OFFSET)117117+#define REALVIEW_SYS_TEST_OSC0 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC0_OFFSET)118118+#define REALVIEW_SYS_TEST_OSC1 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC1_OFFSET)119119+#define REALVIEW_SYS_TEST_OSC2 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC2_OFFSET)120120+#define REALVIEW_SYS_TEST_OSC3 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC3_OFFSET)121121+#define REALVIEW_SYS_TEST_OSC4 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC4_OFFSET)122122+123123+/* 124124+ * Values for REALVIEW_SYS_RESET_CTRL125125+ */126126+#define REALVIEW_SYS_CTRL_RESET_CONFIGCLR 0x01127127+#define REALVIEW_SYS_CTRL_RESET_CONFIGINIT 0x02128128+#define REALVIEW_SYS_CTRL_RESET_DLLRESET 0x03129129+#define REALVIEW_SYS_CTRL_RESET_PLLRESET 0x04130130+#define REALVIEW_SYS_CTRL_RESET_POR 0x05131131+#define REALVIEW_SYS_CTRL_RESET_DoC 0x06132132+133133+#define REALVIEW_SYS_CTRL_LED (1 << 0)134134+135135+136136+/* ------------------------------------------------------------------------137137+ * RealView control registers138138+ * ------------------------------------------------------------------------139139+ */140140+141141+/* 142142+ * REALVIEW_IDFIELD143143+ *144144+ * 31:24 = manufacturer (0x41 = ARM)145145+ * 23:16 = architecture (0x08 = AHB system bus, ASB processor bus)146146+ * 15:12 = FPGA (0x3 = XVC600 or XVC600E)147147+ * 11:4 = build value148148+ * 3:0 = revision number (0x1 = rev B (AHB))149149+ */150150+151151+/*152152+ * REALVIEW_SYS_LOCK153153+ * control access to SYS_OSCx, SYS_CFGDATAx, SYS_RESETCTL, 154154+ * SYS_CLD, SYS_BOOTCS155155+ */156156+#define REALVIEW_SYS_LOCK_LOCKED (1 << 16)157157+#define REALVIEW_SYS_LOCKVAL_MASK 0xFFFF /* write 0xA05F to enable write access */158158+159159+/*160160+ * REALVIEW_SYS_FLASH161161+ */162162+#define REALVIEW_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */163163+164164+/*165165+ * REALVIEW_INTREG166166+ * - used to acknowledge and control MMCI and UART interrupts 167167+ */168168+#define REALVIEW_INTREG_WPROT 0x00 /* MMC protection status (no interrupt generated) */169169+#define REALVIEW_INTREG_RI0 0x01 /* Ring indicator UART0 is asserted, */170170+#define REALVIEW_INTREG_CARDIN 0x08 /* MMCI card in detect */171171+ /* write 1 to acknowledge and clear */172172+#define REALVIEW_INTREG_RI1 0x02 /* Ring indicator UART1 is asserted, */173173+#define REALVIEW_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */174174+175175+/*176176+ * REALVIEW peripheral addresses177177+ */178178+#define REALVIEW_SCTL_BASE 0x10001000 /* System controller */179179+#define REALVIEW_I2C_BASE 0x10002000 /* I2C control */180180+ /* Reserved 0x10003000 */181181+#define REALVIEW_AACI_BASE 0x10004000 /* Audio */182182+#define REALVIEW_MMCI0_BASE 0x10005000 /* MMC interface */183183+#define REALVIEW_KMI0_BASE 0x10006000 /* KMI interface */184184+#define REALVIEW_KMI1_BASE 0x10007000 /* KMI 2nd interface */185185+#define REALVIEW_CHAR_LCD_BASE 0x10008000 /* Character LCD */186186+#define REALVIEW_UART0_BASE 0x10009000 /* UART 0 */187187+#define REALVIEW_UART1_BASE 0x1000A000 /* UART 1 */188188+#define REALVIEW_UART2_BASE 0x1000B000 /* UART 2 */189189+#define REALVIEW_UART3_BASE 0x1000C000 /* UART 3 */190190+#define REALVIEW_SSP_BASE 0x1000D000 /* Synchronous Serial Port */191191+#define REALVIEW_SCI_BASE 0x1000E000 /* Smart card controller */192192+ /* Reserved 0x1000F000 */193193+#define REALVIEW_WATCHDOG_BASE 0x10010000 /* watchdog interface */194194+#define REALVIEW_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */195195+#define REALVIEW_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */196196+#define REALVIEW_GPIO0_BASE 0x10013000 /* GPIO port 0 */197197+#define REALVIEW_GPIO1_BASE 0x10014000 /* GPIO port 1 */198198+#define REALVIEW_GPIO2_BASE 0x10015000 /* GPIO port 2 */199199+ /* Reserved 0x10016000 */200200+#define REALVIEW_RTC_BASE 0x10017000 /* Real Time Clock */201201+#define REALVIEW_DMC_BASE 0x10018000 /* DMC configuration */202202+#define REALVIEW_PCI_CORE_BASE 0x10019000 /* PCI configuration */203203+ /* Reserved 0x1001A000 - 0x1001FFFF */204204+#define REALVIEW_CLCD_BASE 0x10020000 /* CLCD */205205+#define REALVIEW_DMAC_BASE 0x10030000 /* DMA controller */206206+#define REALVIEW_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */207207+#define REALVIEW_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */208208+#define REALVIEW_SMC_BASE 0x10080000 /* SMC */209209+ /* Reserved 0x10090000 - 0x100EFFFF */210210+211211+#define REALVIEW_ETH_BASE 0x4E000000 /* Ethernet */212212+213213+/* PCI space */214214+#define REALVIEW_PCI_BASE 0x41000000 /* PCI Interface */215215+#define REALVIEW_PCI_CFG_BASE 0x42000000216216+#define REALVIEW_PCI_MEM_BASE0 0x44000000217217+#define REALVIEW_PCI_MEM_BASE1 0x50000000218218+#define REALVIEW_PCI_MEM_BASE2 0x60000000219219+/* Sizes of above maps */220220+#define REALVIEW_PCI_BASE_SIZE 0x01000000221221+#define REALVIEW_PCI_CFG_BASE_SIZE 0x02000000222222+#define REALVIEW_PCI_MEM_BASE0_SIZE 0x0c000000 /* 32Mb */223223+#define REALVIEW_PCI_MEM_BASE1_SIZE 0x10000000 /* 256Mb */224224+#define REALVIEW_PCI_MEM_BASE2_SIZE 0x10000000 /* 256Mb */225225+226226+#define REALVIEW_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */227227+#define REALVIEW_LT_BASE 0x80000000 /* Logic Tile expansion */228228+229229+/*230230+ * Disk on Chip231231+ */232232+#define REALVIEW_DOC_BASE 0x2C000000233233+#define REALVIEW_DOC_SIZE (16 << 20)234234+#define REALVIEW_DOC_PAGE_SIZE 512235235+#define REALVIEW_DOC_TOTAL_PAGES (DOC_SIZE / PAGE_SIZE)236236+237237+#define ERASE_UNIT_PAGES 32238238+#define START_PAGE 0x80239239+240240+/* 241241+ * LED settings, bits [7:0]242242+ */243243+#define REALVIEW_SYS_LED0 (1 << 0)244244+#define REALVIEW_SYS_LED1 (1 << 1)245245+#define REALVIEW_SYS_LED2 (1 << 2)246246+#define REALVIEW_SYS_LED3 (1 << 3)247247+#define REALVIEW_SYS_LED4 (1 << 4)248248+#define REALVIEW_SYS_LED5 (1 << 5)249249+#define REALVIEW_SYS_LED6 (1 << 6)250250+#define REALVIEW_SYS_LED7 (1 << 7)251251+252252+#define ALL_LEDS 0xFF253253+254254+#define LED_BANK REALVIEW_SYS_LED255255+256256+/* 257257+ * Control registers258258+ */259259+#define REALVIEW_IDFIELD_OFFSET 0x0 /* RealView build information */260260+#define REALVIEW_FLASHPROG_OFFSET 0x4 /* Flash devices */261261+#define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */262262+#define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */263263+264264+/* ------------------------------------------------------------------------265265+ * Interrupts - bit assignment (primary)266266+ * ------------------------------------------------------------------------267267+ */268268+#define INT_WDOGINT 0 /* Watchdog timer */269269+#define INT_SOFTINT 1 /* Software interrupt */270270+#define INT_COMMRx 2 /* Debug Comm Rx interrupt */271271+#define INT_COMMTx 3 /* Debug Comm Tx interrupt */272272+#define INT_TIMERINT0_1 4 /* Timer 0 and 1 */273273+#define INT_TIMERINT2_3 5 /* Timer 2 and 3 */274274+#define INT_GPIOINT0 6 /* GPIO 0 */275275+#define INT_GPIOINT1 7 /* GPIO 1 */276276+#define INT_GPIOINT2 8 /* GPIO 2 */277277+/* 9 reserved */278278+#define INT_RTCINT 10 /* Real Time Clock */279279+#define INT_SSPINT 11 /* Synchronous Serial Port */280280+#define INT_UARTINT0 12 /* UART 0 on development chip */281281+#define INT_UARTINT1 13 /* UART 1 on development chip */282282+#define INT_UARTINT2 14 /* UART 2 on development chip */283283+#define INT_UARTINT3 15 /* UART 3 on development chip */284284+#define INT_SCIINT 16 /* Smart Card Interface */285285+#define INT_MMCI0A 17 /* Multimedia Card 0A */286286+#define INT_MMCI0B 18 /* Multimedia Card 0B */287287+#define INT_AACI 19 /* Audio Codec */288288+#define INT_KMI0 20 /* Keyboard/Mouse port 0 */289289+#define INT_KMI1 21 /* Keyboard/Mouse port 1 */290290+#define INT_CHARLCD 22 /* Character LCD */291291+#define INT_CLCDINT 23 /* CLCD controller */292292+#define INT_DMAINT 24 /* DMA controller */293293+#define INT_PWRFAILINT 25 /* Power failure */294294+#define INT_PISMO 26295295+#define INT_DoC 27 /* Disk on Chip memory controller */296296+#define INT_ETH 28 /* Ethernet controller */297297+#define INT_USB 29 /* USB controller */298298+#define INT_TSPENINT 30 /* Touchscreen pen */299299+#define INT_TSKPADINT 31 /* Touchscreen keypad */300300+301301+/* 302302+ * Interrupt bit positions303303+ * 304304+ */305305+#define INTMASK_WDOGINT (1 << INT_WDOGINT)306306+#define INTMASK_SOFTINT (1 << INT_SOFTINT)307307+#define INTMASK_COMMRx (1 << INT_COMMRx)308308+#define INTMASK_COMMTx (1 << INT_COMMTx)309309+#define INTMASK_TIMERINT0_1 (1 << INT_TIMERINT0_1)310310+#define INTMASK_TIMERINT2_3 (1 << INT_TIMERINT2_3)311311+#define INTMASK_GPIOINT0 (1 << INT_GPIOINT0)312312+#define INTMASK_GPIOINT1 (1 << INT_GPIOINT1)313313+#define INTMASK_GPIOINT2 (1 << INT_GPIOINT2)314314+#define INTMASK_RTCINT (1 << INT_RTCINT)315315+#define INTMASK_SSPINT (1 << INT_SSPINT)316316+#define INTMASK_UARTINT0 (1 << INT_UARTINT0)317317+#define INTMASK_UARTINT1 (1 << INT_UARTINT1)318318+#define INTMASK_UARTINT2 (1 << INT_UARTINT2)319319+#define INTMASK_UARTINT3 (1 << INT_UARTINT3)320320+#define INTMASK_SCIINT (1 << INT_SCIINT)321321+#define INTMASK_MMCI0A (1 << INT_MMCI0A)322322+#define INTMASK_MMCI0B (1 << INT_MMCI0B)323323+#define INTMASK_AACI (1 << INT_AACI)324324+#define INTMASK_KMI0 (1 << INT_KMI0)325325+#define INTMASK_KMI1 (1 << INT_KMI1)326326+#define INTMASK_CHARLCD (1 << INT_CHARLCD)327327+#define INTMASK_CLCDINT (1 << INT_CLCDINT)328328+#define INTMASK_DMAINT (1 << INT_DMAINT)329329+#define INTMASK_PWRFAILINT (1 << INT_PWRFAILINT)330330+#define INTMASK_PISMO (1 << INT_PISMO)331331+#define INTMASK_DoC (1 << INT_DoC)332332+#define INTMASK_ETH (1 << INT_ETH)333333+#define INTMASK_USB (1 << INT_USB)334334+#define INTMASK_TSPENINT (1 << INT_TSPENINT)335335+#define INTMASK_TSKPADINT (1 << INT_TSKPADINT)336336+337337+#define MAXIRQNUM 31338338+#define MAXFIQNUM 31339339+#define MAXSWINUM 31340340+341341+/* 342342+ * Application Flash343343+ * 344344+ */345345+#define FLASH_BASE REALVIEW_FLASH_BASE346346+#define FLASH_SIZE REALVIEW_FLASH_SIZE347347+#define FLASH_END (FLASH_BASE + FLASH_SIZE - 1)348348+#define FLASH_BLOCK_SIZE SZ_128K349349+350350+/* 351351+ * Boot Flash352352+ * 353353+ */354354+#define EPROM_BASE REALVIEW_BOOT_ROM_HI355355+#define EPROM_SIZE REALVIEW_BOOT_ROM_SIZE356356+#define EPROM_END (EPROM_BASE + EPROM_SIZE - 1)357357+358358+/* 359359+ * Clean base - dummy360360+ * 361361+ */362362+#define CLEAN_BASE EPROM_BASE363363+364364+/*365365+ * System controller bit assignment366366+ */367367+#define REALVIEW_REFCLK 0368368+#define REALVIEW_TIMCLK 1369369+370370+#define REALVIEW_TIMER1_EnSel 15371371+#define REALVIEW_TIMER2_EnSel 17372372+#define REALVIEW_TIMER3_EnSel 19373373+#define REALVIEW_TIMER4_EnSel 21374374+375375+376376+#define MAX_TIMER 2377377+#define MAX_PERIOD 699050378378+#define TICKS_PER_uSEC 1379379+380380+/* 381381+ * These are useconds NOT ticks. 382382+ * 383383+ */384384+#define mSEC_1 1000385385+#define mSEC_5 (mSEC_1 * 5)386386+#define mSEC_10 (mSEC_1 * 10)387387+#define mSEC_25 (mSEC_1 * 25)388388+#define SEC_1 (mSEC_1 * 1000)389389+390390+#define REALVIEW_CSR_BASE 0x10000000391391+#define REALVIEW_CSR_SIZE 0x10000000392392+393393+#endif394394+395395+/* END */
+51
include/asm-arm/arch-realview/system.h
···11+/*22+ * linux/include/asm-arm/arch-realview/system.h33+ *44+ * Copyright (C) 2003 ARM Limited55+ * Copyright (C) 2000 Deep Blue Solutions Ltd66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the Free Software1919+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020+ */2121+#ifndef __ASM_ARCH_SYSTEM_H2222+#define __ASM_ARCH_SYSTEM_H2323+2424+#include <asm/hardware.h>2525+#include <asm/io.h>2626+#include <asm/arch/platform.h>2727+2828+static inline void arch_idle(void)2929+{3030+ /*3131+ * This should do all the clock switching3232+ * and wait for interrupt tricks3333+ */3434+ cpu_do_idle();3535+}3636+3737+static inline void arch_reset(char mode)3838+{3939+ unsigned int hdr_ctrl = (IO_ADDRESS(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET);4040+ unsigned int val;4141+4242+ /*4343+ * To reset, we hit the on-board reset register4444+ * in the system FPGA4545+ */4646+ val = __raw_readl(hdr_ctrl);4747+ val |= REALVIEW_SYS_CTRL_RESET_CONFIGCLR;4848+ __raw_writel(val, hdr_ctrl);4949+}5050+5151+#endif
+23
include/asm-arm/arch-realview/timex.h
···11+/*22+ * linux/include/asm-arm/arch-realview/timex.h33+ *44+ * RealView architecture timex specifications55+ *66+ * Copyright (C) 2003 ARM Limited77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License as published by1010+ * the Free Software Foundation; either version 2 of the License, or1111+ * (at your option) any later version.1212+ *1313+ * This program is distributed in the hope that it will be useful,1414+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1515+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1616+ * GNU General Public License for more details.1717+ *1818+ * You should have received a copy of the GNU General Public License1919+ * along with this program; if not, write to the Free Software2020+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2121+ */2222+2323+#define CLOCK_TICK_RATE (50000000 / 16)
+54
include/asm-arm/arch-realview/uncompress.h
···11+/*22+ * linux/include/asm-arm/arch-realview/uncompress.h33+ *44+ * Copyright (C) 2003 ARM Limited55+ *66+ * This program is free software; you can redistribute it and/or modify77+ * it under the terms of the GNU General Public License as published by88+ * the Free Software Foundation; either version 2 of the License, or99+ * (at your option) any later version.1010+ *1111+ * This program is distributed in the hope that it will be useful,1212+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1313+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414+ * GNU General Public License for more details.1515+ *1616+ * You should have received a copy of the GNU General Public License1717+ * along with this program; if not, write to the Free Software1818+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1919+ */2020+#include <asm/hardware.h>2121+2222+#define AMBA_UART_DR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x00))2323+#define AMBA_UART_LCRH (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x2c))2424+#define AMBA_UART_CR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x30))2525+#define AMBA_UART_FR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x18))2626+2727+/*2828+ * This does not append a newline2929+ */3030+static void putstr(const char *s)3131+{3232+ while (*s) {3333+ while (AMBA_UART_FR & (1 << 5))3434+ barrier();3535+3636+ AMBA_UART_DR = *s;3737+3838+ if (*s == '\n') {3939+ while (AMBA_UART_FR & (1 << 5))4040+ barrier();4141+4242+ AMBA_UART_DR = '\r';4343+ }4444+ s++;4545+ }4646+ while (AMBA_UART_FR & (1 << 3))4747+ barrier();4848+}4949+5050+/*5151+ * nothing to do5252+ */5353+#define arch_decomp_setup()5454+#define arch_decomp_wdog()
+21
include/asm-arm/arch-realview/vmalloc.h
···11+/*22+ * linux/include/asm-arm/arch-realview/vmalloc.h33+ *44+ * Copyright (C) 2003 ARM Limited55+ * Copyright (C) 2000 Russell King.66+ *77+ * This program is free software; you can redistribute it and/or modify88+ * it under the terms of the GNU General Public License as published by99+ * the Free Software Foundation; either version 2 of the License, or1010+ * (at your option) any later version.1111+ *1212+ * This program is distributed in the hope that it will be useful,1313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1414+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1515+ * GNU General Public License for more details.1616+ *1717+ * You should have received a copy of the GNU General Public License1818+ * along with this program; if not, write to the Free Software1919+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2020+ */2121+#define VMALLOC_END (PAGE_OFFSET + 0x18000000)