aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32/kernel
diff options
context:
space:
mode:
authorGuanXuetao <gxt@mprc.pku.edu.cn>2011-03-04 05:07:48 -0500
committerGuanXuetao <gxt@mprc.pku.edu.cn>2011-03-16 21:19:21 -0400
commit1cf46c42d7688a2e09de87fc9201b0e9a0961866 (patch)
treef6bba402319785ed745be62e5b655715626d2761 /arch/unicore32/kernel
parent4fde87cb13a29c06e0b4c2cba86445492098fbc2 (diff)
unicore32: modify io_p2v and io_v2p macros, and adjust PKUNITY_mmio_BASEs
1. remove __REG macro 2. add (void __iomem *) to io_p2v macro 3. add (phys_addr_t) to io_v2p macro 4. add PKUNITY_AHB_BASE and PKUNITY_APB_BASE definitions 5. modify all PKUNITY_mmio_BASEs from physical addr to virtual addr 6. adjust prefix macro for all usage of PKUNITY_mmio_BASEs -- by advice with Arnd Bergmann Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/unicore32/kernel')
-rw-r--r--arch/unicore32/kernel/entry.S2
-rw-r--r--arch/unicore32/kernel/irq.c4
-rw-r--r--arch/unicore32/kernel/pci.c12
-rw-r--r--arch/unicore32/kernel/puv3-core.c32
-rw-r--r--arch/unicore32/kernel/puv3-nb0916.c4
-rw-r--r--arch/unicore32/kernel/sleep.S4
6 files changed, 29 insertions, 29 deletions
diff --git a/arch/unicore32/kernel/entry.S b/arch/unicore32/kernel/entry.S
index 83698b7c8f5b..00a259f9819e 100644
--- a/arch/unicore32/kernel/entry.S
+++ b/arch/unicore32/kernel/entry.S
@@ -91,7 +91,7 @@
91 .endm 91 .endm
92 92
93 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 93 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
94 ldw \base, =(io_p2v(PKUNITY_INTC_BASE)) 94 ldw \base, =(PKUNITY_INTC_BASE)
95 ldw \irqstat, [\base+], #0xC @ INTC_ICIP 95 ldw \irqstat, [\base+], #0xC @ INTC_ICIP
96 ldw \tmp, [\base+], #0x4 @ INTC_ICMR 96 ldw \tmp, [\base+], #0x4 @ INTC_ICMR
97 and.a \irqstat, \irqstat, \tmp 97 and.a \irqstat, \irqstat, \tmp
diff --git a/arch/unicore32/kernel/irq.c b/arch/unicore32/kernel/irq.c
index e1dbfcb61873..b23624cf3062 100644
--- a/arch/unicore32/kernel/irq.c
+++ b/arch/unicore32/kernel/irq.c
@@ -226,8 +226,8 @@ static struct irq_chip puv3_normal_chip = {
226 226
227static struct resource irq_resource = { 227static struct resource irq_resource = {
228 .name = "irqs", 228 .name = "irqs",
229 .start = PKUNITY_INTC_BASE, 229 .start = io_v2p(PKUNITY_INTC_BASE),
230 .end = PKUNITY_INTC_BASE + 0xFFFFF, 230 .end = io_v2p(PKUNITY_INTC_BASE) + 0xFFFFF,
231}; 231};
232 232
233static struct puv3_irq_state { 233static struct puv3_irq_state {
diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c
index 65c265ee8e94..100eab842e66 100644
--- a/arch/unicore32/kernel/pci.c
+++ b/arch/unicore32/kernel/pci.c
@@ -75,27 +75,27 @@ void pci_puv3_preinit(void)
75{ 75{
76 printk(KERN_DEBUG "PCI: PKUnity PCI Controller Initializing ...\n"); 76 printk(KERN_DEBUG "PCI: PKUnity PCI Controller Initializing ...\n");
77 /* config PCI bridge base */ 77 /* config PCI bridge base */
78 writel(PKUNITY_PCIBRI_BASE, PCICFG_BRIBASE); 78 writel(io_v2p(PKUNITY_PCIBRI_BASE), PCICFG_BRIBASE);
79 79
80 writel(0, PCIBRI_AHBCTL0); 80 writel(0, PCIBRI_AHBCTL0);
81 writel(PKUNITY_PCIBRI_BASE | PCIBRI_BARx_MEM, PCIBRI_AHBBAR0); 81 writel(io_v2p(PKUNITY_PCIBRI_BASE) | PCIBRI_BARx_MEM, PCIBRI_AHBBAR0);
82 writel(0xFFFF0000, PCIBRI_AHBAMR0); 82 writel(0xFFFF0000, PCIBRI_AHBAMR0);
83 writel(0, PCIBRI_AHBTAR0); 83 writel(0, PCIBRI_AHBTAR0);
84 84
85 writel(PCIBRI_CTLx_AT, PCIBRI_AHBCTL1); 85 writel(PCIBRI_CTLx_AT, PCIBRI_AHBCTL1);
86 writel(PKUNITY_PCILIO_BASE | PCIBRI_BARx_IO, PCIBRI_AHBBAR1); 86 writel(io_v2p(PKUNITY_PCILIO_BASE) | PCIBRI_BARx_IO, PCIBRI_AHBBAR1);
87 writel(0xFFFF0000, PCIBRI_AHBAMR1); 87 writel(0xFFFF0000, PCIBRI_AHBAMR1);
88 writel(0x00000000, PCIBRI_AHBTAR1); 88 writel(0x00000000, PCIBRI_AHBTAR1);
89 89
90 writel(PCIBRI_CTLx_PREF, PCIBRI_AHBCTL2); 90 writel(PCIBRI_CTLx_PREF, PCIBRI_AHBCTL2);
91 writel(PKUNITY_PCIMEM_BASE | PCIBRI_BARx_MEM, PCIBRI_AHBBAR2); 91 writel(io_v2p(PKUNITY_PCIMEM_BASE) | PCIBRI_BARx_MEM, PCIBRI_AHBBAR2);
92 writel(0xF8000000, PCIBRI_AHBAMR2); 92 writel(0xF8000000, PCIBRI_AHBAMR2);
93 writel(0, PCIBRI_AHBTAR2); 93 writel(0, PCIBRI_AHBTAR2);
94 94
95 writel(PKUNITY_PCIAHB_BASE | PCIBRI_BARx_MEM, PCIBRI_BAR1); 95 writel(io_v2p(PKUNITY_PCIAHB_BASE) | PCIBRI_BARx_MEM, PCIBRI_BAR1);
96 96
97 writel(PCIBRI_CTLx_AT | PCIBRI_CTLx_PREF, PCIBRI_PCICTL0); 97 writel(PCIBRI_CTLx_AT | PCIBRI_CTLx_PREF, PCIBRI_PCICTL0);
98 writel(PKUNITY_PCIAHB_BASE | PCIBRI_BARx_MEM, PCIBRI_PCIBAR0); 98 writel(io_v2p(PKUNITY_PCIAHB_BASE) | PCIBRI_BARx_MEM, PCIBRI_PCIBAR0);
99 writel(0xF8000000, PCIBRI_PCIAMR0); 99 writel(0xF8000000, PCIBRI_PCIAMR0);
100 writel(PKUNITY_SDRAM_BASE, PCIBRI_PCITAR0); 100 writel(PKUNITY_SDRAM_BASE, PCIBRI_PCITAR0);
101 101
diff --git a/arch/unicore32/kernel/puv3-core.c b/arch/unicore32/kernel/puv3-core.c
index 7d10e7b07c20..8b1b6beb858e 100644
--- a/arch/unicore32/kernel/puv3-core.c
+++ b/arch/unicore32/kernel/puv3-core.c
@@ -50,8 +50,8 @@ unsigned long long sched_clock(void)
50static struct resource puv3_usb_resources[] = { 50static struct resource puv3_usb_resources[] = {
51 /* order is significant! */ 51 /* order is significant! */
52 { 52 {
53 .start = PKUNITY_USB_BASE, 53 .start = io_v2p(PKUNITY_USB_BASE),
54 .end = PKUNITY_USB_BASE + 0x3ff, 54 .end = io_v2p(PKUNITY_USB_BASE) + 0x3ff,
55 .flags = IORESOURCE_MEM, 55 .flags = IORESOURCE_MEM,
56 }, { 56 }, {
57 .start = IRQ_USB, 57 .start = IRQ_USB,
@@ -82,8 +82,8 @@ static struct musb_hdrc_platform_data puv3_usb_plat = {
82 82
83static struct resource puv3_mmc_resources[] = { 83static struct resource puv3_mmc_resources[] = {
84 [0] = { 84 [0] = {
85 .start = PKUNITY_SDC_BASE, 85 .start = io_v2p(PKUNITY_SDC_BASE),
86 .end = PKUNITY_SDC_BASE + 0xfff, 86 .end = io_v2p(PKUNITY_SDC_BASE) + 0xfff,
87 .flags = IORESOURCE_MEM, 87 .flags = IORESOURCE_MEM,
88 }, 88 },
89 [1] = { 89 [1] = {
@@ -95,8 +95,8 @@ static struct resource puv3_mmc_resources[] = {
95 95
96static struct resource puv3_unigfx_resources[] = { 96static struct resource puv3_unigfx_resources[] = {
97 [0] = { 97 [0] = {
98 .start = PKUNITY_UNIGFX_BASE, 98 .start = io_v2p(PKUNITY_UNIGFX_BASE),
99 .end = PKUNITY_UNIGFX_BASE + 0xfff, 99 .end = io_v2p(PKUNITY_UNIGFX_BASE) + 0xfff,
100 .flags = IORESOURCE_MEM, 100 .flags = IORESOURCE_MEM,
101 }, 101 },
102 [1] = { 102 [1] = {
@@ -108,8 +108,8 @@ static struct resource puv3_unigfx_resources[] = {
108 108
109static struct resource puv3_rtc_resources[] = { 109static struct resource puv3_rtc_resources[] = {
110 [0] = { 110 [0] = {
111 .start = PKUNITY_RTC_BASE, 111 .start = io_v2p(PKUNITY_RTC_BASE),
112 .end = PKUNITY_RTC_BASE + 0xff, 112 .end = io_v2p(PKUNITY_RTC_BASE) + 0xff,
113 .flags = IORESOURCE_MEM, 113 .flags = IORESOURCE_MEM,
114 }, 114 },
115 [1] = { 115 [1] = {
@@ -126,16 +126,16 @@ static struct resource puv3_rtc_resources[] = {
126 126
127static struct resource puv3_pwm_resources[] = { 127static struct resource puv3_pwm_resources[] = {
128 [0] = { 128 [0] = {
129 .start = PKUNITY_OST_BASE + 0x80, 129 .start = io_v2p(PKUNITY_OST_BASE) + 0x80,
130 .end = PKUNITY_OST_BASE + 0xff, 130 .end = io_v2p(PKUNITY_OST_BASE) + 0xff,
131 .flags = IORESOURCE_MEM, 131 .flags = IORESOURCE_MEM,
132 }, 132 },
133}; 133};
134 134
135static struct resource puv3_uart0_resources[] = { 135static struct resource puv3_uart0_resources[] = {
136 [0] = { 136 [0] = {
137 .start = PKUNITY_UART0_BASE, 137 .start = io_v2p(PKUNITY_UART0_BASE),
138 .end = PKUNITY_UART0_BASE + 0xff, 138 .end = io_v2p(PKUNITY_UART0_BASE) + 0xff,
139 .flags = IORESOURCE_MEM, 139 .flags = IORESOURCE_MEM,
140 }, 140 },
141 [1] = { 141 [1] = {
@@ -147,8 +147,8 @@ static struct resource puv3_uart0_resources[] = {
147 147
148static struct resource puv3_uart1_resources[] = { 148static struct resource puv3_uart1_resources[] = {
149 [0] = { 149 [0] = {
150 .start = PKUNITY_UART1_BASE, 150 .start = io_v2p(PKUNITY_UART1_BASE),
151 .end = PKUNITY_UART1_BASE + 0xff, 151 .end = io_v2p(PKUNITY_UART1_BASE) + 0xff,
152 .flags = IORESOURCE_MEM, 152 .flags = IORESOURCE_MEM,
153 }, 153 },
154 [1] = { 154 [1] = {
@@ -160,8 +160,8 @@ static struct resource puv3_uart1_resources[] = {
160 160
161static struct resource puv3_umal_resources[] = { 161static struct resource puv3_umal_resources[] = {
162 [0] = { 162 [0] = {
163 .start = PKUNITY_UMAL_BASE, 163 .start = io_v2p(PKUNITY_UMAL_BASE),
164 .end = PKUNITY_UMAL_BASE + 0x1fff, 164 .end = io_v2p(PKUNITY_UMAL_BASE) + 0x1fff,
165 .flags = IORESOURCE_MEM, 165 .flags = IORESOURCE_MEM,
166 }, 166 },
167 [1] = { 167 [1] = {
diff --git a/arch/unicore32/kernel/puv3-nb0916.c b/arch/unicore32/kernel/puv3-nb0916.c
index a78e60420653..e731c561ed4e 100644
--- a/arch/unicore32/kernel/puv3-nb0916.c
+++ b/arch/unicore32/kernel/puv3-nb0916.c
@@ -39,8 +39,8 @@ static struct resource physmap_flash_resource = {
39 39
40static struct resource puv3_i2c_resources[] = { 40static struct resource puv3_i2c_resources[] = {
41 [0] = { 41 [0] = {
42 .start = PKUNITY_I2C_BASE, 42 .start = io_v2p(PKUNITY_I2C_BASE),
43 .end = PKUNITY_I2C_BASE + 0xff, 43 .end = io_v2p(PKUNITY_I2C_BASE) + 0xff,
44 .flags = IORESOURCE_MEM, 44 .flags = IORESOURCE_MEM,
45 }, 45 },
46 [1] = { 46 [1] = {
diff --git a/arch/unicore32/kernel/sleep.S b/arch/unicore32/kernel/sleep.S
index f7c3fc87f7fe..607a104aec59 100644
--- a/arch/unicore32/kernel/sleep.S
+++ b/arch/unicore32/kernel/sleep.S
@@ -76,10 +76,10 @@ ENTRY(puv3_cpu_suspend)
76 76
77 77
78 @ DDR2 BaseAddr 78 @ DDR2 BaseAddr
79 ldw r0, =io_p2v(PKUNITY_DDR2CTRL_BASE) 79 ldw r0, =(PKUNITY_DDR2CTRL_BASE)
80 80
81 @ PM BaseAddr 81 @ PM BaseAddr
82 ldw r1, =io_p2v(PKUNITY_PM_BASE) 82 ldw r1, =(PKUNITY_PM_BASE)
83 83
84 @ set PLL_SYS_CFG reg, 275 84 @ set PLL_SYS_CFG reg, 275
85 movl r6, #0x00002401 85 movl r6, #0x00002401