Commit 53821162 authored by viresh kumar's avatar viresh kumar Committed by Russell King

ARM: 6792/1: SPEAr: Replace SIZE macro's with SZ_4K macros

Resource size required mostly is 4K for all devices, whereas currently
reserved space is much beyond that. This patch replaces SIZE macro's used at
multiple places with SZ_4K.
Reviewed-by: default avatarStanley Miao <stanley.miao@windriver.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
Signed-off-by: default avatarShiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: default avatarRajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent c2c07831
...@@ -437,7 +437,7 @@ struct amba_device gpio1_device = { ...@@ -437,7 +437,7 @@ struct amba_device gpio1_device = {
}, },
.res = { .res = {
.start = SPEAR300_GPIO_BASE, .start = SPEAR300_GPIO_BASE,
.end = SPEAR300_GPIO_BASE + SPEAR300_GPIO_SIZE - 1, .end = SPEAR300_GPIO_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {VIRQ_GPIO1, NO_IRQ}, .irq = {VIRQ_GPIO1, NO_IRQ},
...@@ -452,8 +452,7 @@ void __init spear300_init(void) ...@@ -452,8 +452,7 @@ void __init spear300_init(void)
spear3xx_init(); spear3xx_init();
/* shared irq registration */ /* shared irq registration */
shirq_ras1.regs.base = shirq_ras1.regs.base = ioremap(SPEAR300_TELECOM_BASE, SZ_4K);
ioremap(SPEAR300_TELECOM_BASE, SPEAR300_TELECOM_REG_SIZE);
if (shirq_ras1.regs.base) { if (shirq_ras1.regs.base) {
ret = spear_shirq_register(&shirq_ras1); ret = spear_shirq_register(&shirq_ras1);
if (ret) if (ret)
...@@ -461,8 +460,7 @@ void __init spear300_init(void) ...@@ -461,8 +460,7 @@ void __init spear300_init(void)
} }
/* pmx initialization */ /* pmx initialization */
pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K);
SPEAR300_SOC_CONFIG_SIZE);
if (pmx_driver.base) { if (pmx_driver.base) {
ret = pmx_register(&pmx_driver); ret = pmx_register(&pmx_driver);
if (ret) if (ret)
......
...@@ -267,7 +267,7 @@ void __init spear310_init(void) ...@@ -267,7 +267,7 @@ void __init spear310_init(void)
spear3xx_init(); spear3xx_init();
/* shared irq registration */ /* shared irq registration */
base = ioremap(SPEAR310_SOC_CONFIG_BASE, SPEAR310_SOC_CONFIG_SIZE); base = ioremap(SPEAR310_SOC_CONFIG_BASE, SZ_4K);
if (base) { if (base) {
/* shirq 1 */ /* shirq 1 */
shirq_ras1.regs.base = base; shirq_ras1.regs.base = base;
......
...@@ -520,7 +520,7 @@ void __init spear320_init(void) ...@@ -520,7 +520,7 @@ void __init spear320_init(void)
spear3xx_init(); spear3xx_init();
/* shared irq registration */ /* shared irq registration */
base = ioremap(SPEAR320_SOC_CONFIG_BASE, SPEAR320_SOC_CONFIG_SIZE); base = ioremap(SPEAR320_SOC_CONFIG_BASE, SZ_4K);
if (base) { if (base) {
/* shirq 1 */ /* shirq 1 */
shirq_ras1.regs.base = base; shirq_ras1.regs.base = base;
......
...@@ -35,7 +35,7 @@ struct amba_device gpio_device = { ...@@ -35,7 +35,7 @@ struct amba_device gpio_device = {
}, },
.res = { .res = {
.start = SPEAR3XX_ICM3_GPIO_BASE, .start = SPEAR3XX_ICM3_GPIO_BASE,
.end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 1, .end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {IRQ_BASIC_GPIO, NO_IRQ}, .irq = {IRQ_BASIC_GPIO, NO_IRQ},
...@@ -48,7 +48,7 @@ struct amba_device uart_device = { ...@@ -48,7 +48,7 @@ struct amba_device uart_device = {
}, },
.res = { .res = {
.start = SPEAR3XX_ICM1_UART_BASE, .start = SPEAR3XX_ICM1_UART_BASE,
.end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 1, .end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {IRQ_UART, NO_IRQ}, .irq = {IRQ_UART, NO_IRQ},
...@@ -71,22 +71,22 @@ struct map_desc spear3xx_io_desc[] __initdata = { ...@@ -71,22 +71,22 @@ struct map_desc spear3xx_io_desc[] __initdata = {
{ {
.virtual = VA_SPEAR3XX_ICM1_UART_BASE, .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
.pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE), .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
.length = SPEAR3XX_ICM1_UART_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = VA_SPEAR3XX_ML1_VIC_BASE, .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
.pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE), .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
.length = SPEAR3XX_ML1_VIC_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE, .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
.pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE), .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
.length = SPEAR3XX_ICM3_SYS_CTRL_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE, .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
.pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE), .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
.length = SPEAR3XX_ICM3_MISC_REG_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, },
}; };
......
...@@ -31,8 +31,7 @@ struct amba_device uart_device[] = { ...@@ -31,8 +31,7 @@ struct amba_device uart_device[] = {
}, },
.res = { .res = {
.start = SPEAR6XX_ICM1_UART0_BASE, .start = SPEAR6XX_ICM1_UART0_BASE,
.end = SPEAR6XX_ICM1_UART0_BASE + .end = SPEAR6XX_ICM1_UART0_BASE + SZ_4K - 1,
SPEAR6XX_ICM1_UART0_SIZE - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {IRQ_UART_0, NO_IRQ}, .irq = {IRQ_UART_0, NO_IRQ},
...@@ -42,8 +41,7 @@ struct amba_device uart_device[] = { ...@@ -42,8 +41,7 @@ struct amba_device uart_device[] = {
}, },
.res = { .res = {
.start = SPEAR6XX_ICM1_UART1_BASE, .start = SPEAR6XX_ICM1_UART1_BASE,
.end = SPEAR6XX_ICM1_UART1_BASE + .end = SPEAR6XX_ICM1_UART1_BASE + SZ_4K - 1,
SPEAR6XX_ICM1_UART1_SIZE - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {IRQ_UART_1, NO_IRQ}, .irq = {IRQ_UART_1, NO_IRQ},
...@@ -72,8 +70,7 @@ struct amba_device gpio_device[] = { ...@@ -72,8 +70,7 @@ struct amba_device gpio_device[] = {
}, },
.res = { .res = {
.start = SPEAR6XX_CPU_GPIO_BASE, .start = SPEAR6XX_CPU_GPIO_BASE,
.end = SPEAR6XX_CPU_GPIO_BASE + .end = SPEAR6XX_CPU_GPIO_BASE + SZ_4K - 1,
SPEAR6XX_CPU_GPIO_SIZE - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {IRQ_LOCAL_GPIO, NO_IRQ}, .irq = {IRQ_LOCAL_GPIO, NO_IRQ},
...@@ -84,8 +81,7 @@ struct amba_device gpio_device[] = { ...@@ -84,8 +81,7 @@ struct amba_device gpio_device[] = {
}, },
.res = { .res = {
.start = SPEAR6XX_ICM3_GPIO_BASE, .start = SPEAR6XX_ICM3_GPIO_BASE,
.end = SPEAR6XX_ICM3_GPIO_BASE + .end = SPEAR6XX_ICM3_GPIO_BASE + SZ_4K - 1,
SPEAR6XX_ICM3_GPIO_SIZE - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {IRQ_BASIC_GPIO, NO_IRQ}, .irq = {IRQ_BASIC_GPIO, NO_IRQ},
...@@ -96,8 +92,7 @@ struct amba_device gpio_device[] = { ...@@ -96,8 +92,7 @@ struct amba_device gpio_device[] = {
}, },
.res = { .res = {
.start = SPEAR6XX_ICM2_GPIO_BASE, .start = SPEAR6XX_ICM2_GPIO_BASE,
.end = SPEAR6XX_ICM2_GPIO_BASE + .end = SPEAR6XX_ICM2_GPIO_BASE + SZ_4K - 1,
SPEAR6XX_ICM2_GPIO_SIZE - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
.irq = {IRQ_APPL_GPIO, NO_IRQ}, .irq = {IRQ_APPL_GPIO, NO_IRQ},
...@@ -122,27 +117,27 @@ static struct map_desc spear6xx_io_desc[] __initdata = { ...@@ -122,27 +117,27 @@ static struct map_desc spear6xx_io_desc[] __initdata = {
{ {
.virtual = VA_SPEAR6XX_ICM1_UART0_BASE, .virtual = VA_SPEAR6XX_ICM1_UART0_BASE,
.pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE), .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE),
.length = SPEAR6XX_ICM1_UART0_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE, .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE,
.pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE), .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE),
.length = SPEAR6XX_CPU_VIC_PRI_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE, .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE,
.pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE), .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE),
.length = SPEAR6XX_CPU_VIC_SEC_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE, .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE,
.pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE), .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE),
.length = SPEAR6XX_ICM3_MISC_REG_BASE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, { }, {
.virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE, .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE,
.pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE), .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE),
.length = SPEAR6XX_ICM3_MISC_REG_SIZE, .length = SZ_4K,
.type = MT_DEVICE .type = MT_DEVICE
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment