summaryrefslogtreecommitdiffstats
path: root/arch/unicore32/kernel
diff options
context:
space:
mode:
authorGuanXuetao <gxt@mprc.pku.edu.cn>2011-03-04 18:07:48 +0800
committerGuanXuetao <gxt@mprc.pku.edu.cn>2011-03-17 09:19:21 +0800
commit1cf46c42d7688a2e09de87fc9201b0e9a0961866 (patch)
treef6bba402319785ed745be62e5b655715626d2761 /arch/unicore32/kernel
parent4fde87cb13a29c06e0b4c2cba86445492098fbc2 (diff)
downloadblackbird-op-linux-1cf46c42d7688a2e09de87fc9201b0e9a0961866.tar.gz
blackbird-op-linux-1cf46c42d7688a2e09de87fc9201b0e9a0961866.zip
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 @@
.endm
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
- ldw \base, =(io_p2v(PKUNITY_INTC_BASE))
+ ldw \base, =(PKUNITY_INTC_BASE)
ldw \irqstat, [\base+], #0xC @ INTC_ICIP
ldw \tmp, [\base+], #0x4 @ INTC_ICMR
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 = {
static struct resource irq_resource = {
.name = "irqs",
- .start = PKUNITY_INTC_BASE,
- .end = PKUNITY_INTC_BASE + 0xFFFFF,
+ .start = io_v2p(PKUNITY_INTC_BASE),
+ .end = io_v2p(PKUNITY_INTC_BASE) + 0xFFFFF,
};
static 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)
{
printk(KERN_DEBUG "PCI: PKUnity PCI Controller Initializing ...\n");
/* config PCI bridge base */
- writel(PKUNITY_PCIBRI_BASE, PCICFG_BRIBASE);
+ writel(io_v2p(PKUNITY_PCIBRI_BASE), PCICFG_BRIBASE);
writel(0, PCIBRI_AHBCTL0);
- writel(PKUNITY_PCIBRI_BASE | PCIBRI_BARx_MEM, PCIBRI_AHBBAR0);
+ writel(io_v2p(PKUNITY_PCIBRI_BASE) | PCIBRI_BARx_MEM, PCIBRI_AHBBAR0);
writel(0xFFFF0000, PCIBRI_AHBAMR0);
writel(0, PCIBRI_AHBTAR0);
writel(PCIBRI_CTLx_AT, PCIBRI_AHBCTL1);
- writel(PKUNITY_PCILIO_BASE | PCIBRI_BARx_IO, PCIBRI_AHBBAR1);
+ writel(io_v2p(PKUNITY_PCILIO_BASE) | PCIBRI_BARx_IO, PCIBRI_AHBBAR1);
writel(0xFFFF0000, PCIBRI_AHBAMR1);
writel(0x00000000, PCIBRI_AHBTAR1);
writel(PCIBRI_CTLx_PREF, PCIBRI_AHBCTL2);
- writel(PKUNITY_PCIMEM_BASE | PCIBRI_BARx_MEM, PCIBRI_AHBBAR2);
+ writel(io_v2p(PKUNITY_PCIMEM_BASE) | PCIBRI_BARx_MEM, PCIBRI_AHBBAR2);
writel(0xF8000000, PCIBRI_AHBAMR2);
writel(0, PCIBRI_AHBTAR2);
- writel(PKUNITY_PCIAHB_BASE | PCIBRI_BARx_MEM, PCIBRI_BAR1);
+ writel(io_v2p(PKUNITY_PCIAHB_BASE) | PCIBRI_BARx_MEM, PCIBRI_BAR1);
writel(PCIBRI_CTLx_AT | PCIBRI_CTLx_PREF, PCIBRI_PCICTL0);
- writel(PKUNITY_PCIAHB_BASE | PCIBRI_BARx_MEM, PCIBRI_PCIBAR0);
+ writel(io_v2p(PKUNITY_PCIAHB_BASE) | PCIBRI_BARx_MEM, PCIBRI_PCIBAR0);
writel(0xF8000000, PCIBRI_PCIAMR0);
writel(PKUNITY_SDRAM_BASE, PCIBRI_PCITAR0);
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)
static struct resource puv3_usb_resources[] = {
/* order is significant! */
{
- .start = PKUNITY_USB_BASE,
- .end = PKUNITY_USB_BASE + 0x3ff,
+ .start = io_v2p(PKUNITY_USB_BASE),
+ .end = io_v2p(PKUNITY_USB_BASE) + 0x3ff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_USB,
@@ -82,8 +82,8 @@ static struct musb_hdrc_platform_data puv3_usb_plat = {
static struct resource puv3_mmc_resources[] = {
[0] = {
- .start = PKUNITY_SDC_BASE,
- .end = PKUNITY_SDC_BASE + 0xfff,
+ .start = io_v2p(PKUNITY_SDC_BASE),
+ .end = io_v2p(PKUNITY_SDC_BASE) + 0xfff,
.flags = IORESOURCE_MEM,
},
[1] = {
@@ -95,8 +95,8 @@ static struct resource puv3_mmc_resources[] = {
static struct resource puv3_unigfx_resources[] = {
[0] = {
- .start = PKUNITY_UNIGFX_BASE,
- .end = PKUNITY_UNIGFX_BASE + 0xfff,
+ .start = io_v2p(PKUNITY_UNIGFX_BASE),
+ .end = io_v2p(PKUNITY_UNIGFX_BASE) + 0xfff,
.flags = IORESOURCE_MEM,
},
[1] = {
@@ -108,8 +108,8 @@ static struct resource puv3_unigfx_resources[] = {
static struct resource puv3_rtc_resources[] = {
[0] = {
- .start = PKUNITY_RTC_BASE,
- .end = PKUNITY_RTC_BASE + 0xff,
+ .start = io_v2p(PKUNITY_RTC_BASE),
+ .end = io_v2p(PKUNITY_RTC_BASE) + 0xff,
.flags = IORESOURCE_MEM,
},
[1] = {
@@ -126,16 +126,16 @@ static struct resource puv3_rtc_resources[] = {
static struct resource puv3_pwm_resources[] = {
[0] = {
- .start = PKUNITY_OST_BASE + 0x80,
- .end = PKUNITY_OST_BASE + 0xff,
+ .start = io_v2p(PKUNITY_OST_BASE) + 0x80,
+ .end = io_v2p(PKUNITY_OST_BASE) + 0xff,
.flags = IORESOURCE_MEM,
},
};
static struct resource puv3_uart0_resources[] = {
[0] = {
- .start = PKUNITY_UART0_BASE,
- .end = PKUNITY_UART0_BASE + 0xff,
+ .start = io_v2p(PKUNITY_UART0_BASE),
+ .end = io_v2p(PKUNITY_UART0_BASE) + 0xff,
.flags = IORESOURCE_MEM,
},
[1] = {
@@ -147,8 +147,8 @@ static struct resource puv3_uart0_resources[] = {
static struct resource puv3_uart1_resources[] = {
[0] = {
- .start = PKUNITY_UART1_BASE,
- .end = PKUNITY_UART1_BASE + 0xff,
+ .start = io_v2p(PKUNITY_UART1_BASE),
+ .end = io_v2p(PKUNITY_UART1_BASE) + 0xff,
.flags = IORESOURCE_MEM,
},
[1] = {
@@ -160,8 +160,8 @@ static struct resource puv3_uart1_resources[] = {
static struct resource puv3_umal_resources[] = {
[0] = {
- .start = PKUNITY_UMAL_BASE,
- .end = PKUNITY_UMAL_BASE + 0x1fff,
+ .start = io_v2p(PKUNITY_UMAL_BASE),
+ .end = io_v2p(PKUNITY_UMAL_BASE) + 0x1fff,
.flags = IORESOURCE_MEM,
},
[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 = {
static struct resource puv3_i2c_resources[] = {
[0] = {
- .start = PKUNITY_I2C_BASE,
- .end = PKUNITY_I2C_BASE + 0xff,
+ .start = io_v2p(PKUNITY_I2C_BASE),
+ .end = io_v2p(PKUNITY_I2C_BASE) + 0xff,
.flags = IORESOURCE_MEM,
},
[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)
@ DDR2 BaseAddr
- ldw r0, =io_p2v(PKUNITY_DDR2CTRL_BASE)
+ ldw r0, =(PKUNITY_DDR2CTRL_BASE)
@ PM BaseAddr
- ldw r1, =io_p2v(PKUNITY_PM_BASE)
+ ldw r1, =(PKUNITY_PM_BASE)
@ set PLL_SYS_CFG reg, 275
movl r6, #0x00002401
OpenPOWER on IntegriCloud