Skip to content

Commit 980a637

Browse files
committed
ARM: omap1: fix !ARCH_OMAP1_ANY link failures
While compile-testing randconfig builds for the upcoming boardfile removal, I noticed that an earlier patch of mine was completely broken, and the introduction of CONFIG_ARCH_OMAP1_ANY only replaced one set of build failures with another one, now resulting in link failures like ld: drivers/video/fbdev/omap/omapfb_main.o: in function `omapfb_do_probe': drivers/video/fbdev/omap/omapfb_main.c:1703: undefined reference to `omap_set_dma_priority' ld: drivers/dma/ti/omap-dma.o: in function `omap_dma_free_chan_resources': drivers/dma/ti/omap-dma.c:777: undefined reference to `omap_free_dma' drivers/dma/ti/omap-dma.c:1685: undefined reference to `omap_get_plat_info' ld: drivers/usb/gadget/udc/omap_udc.o: in function `next_in_dma': drivers/usb/gadget/udc/omap_udc.c:820: undefined reference to `omap_get_dma_active_status' I tried reworking it, but the resulting patch ended up much bigger than simply avoiding the original problem of unused-function warnings like arch/arm/mach-omap1/mcbsp.c:76:30: error: unused variable 'omap1_mcbsp_ops' [-Werror,-Wunused-variable] As a result, revert the previous fix, and rearrange the code that produces warnings to hide them. For mcbsp, the #ifdef check can simply be removed as the cpu_is_omapxxx() checks already achieve the same result, while in the io.c the easiest solution appears to be to merge the common map bits into each soc specific portion. This gets cleaned in a nicer way after omap7xx support gets dropped, as the remaining SoCs all have the exact same I/O map. Fixes: 615dce5 ("ARM: omap1: fix build with no SoC selected") Cc: [email protected] Acked-by: Aaro Koskinen <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent cd2d0d4 commit 980a637

File tree

6 files changed

+18
-55
lines changed

6 files changed

+18
-55
lines changed

arch/arm/mach-omap1/Kconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ menuconfig ARCH_OMAP1
44
depends on ARCH_MULTI_V4T || ARCH_MULTI_V5
55
depends on CPU_LITTLE_ENDIAN
66
depends on ATAGS
7+
select ARCH_OMAP
78
select ARCH_HAS_HOLES_MEMORYMODEL
89
select ARCH_OMAP
910
select CLKSRC_MMIO
@@ -45,10 +46,6 @@ config ARCH_OMAP16XX
4546
select CPU_ARM926T
4647
select OMAP_DM_TIMER
4748

48-
config ARCH_OMAP1_ANY
49-
select ARCH_OMAP
50-
def_bool ARCH_OMAP730 || ARCH_OMAP850 || ARCH_OMAP15XX || ARCH_OMAP16XX
51-
5249
config ARCH_OMAP
5350
bool
5451

arch/arm/mach-omap1/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Makefile for the linux kernel.
44
#
55

6-
ifdef CONFIG_ARCH_OMAP1_ANY
7-
86
# Common support
97
obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \
108
serial.o devices.o dma.o omap-dma.o fb.o
@@ -59,5 +57,3 @@ obj-$(CONFIG_ARCH_OMAP730) += gpio7xx.o
5957
obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o
6058
obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o
6159
obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o
62-
63-
endif

arch/arm/mach-omap1/io.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@
2222
* The machine specific code may provide the extra mapping besides the
2323
* default mapping provided here.
2424
*/
25-
static struct map_desc omap_io_desc[] __initdata = {
25+
#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
26+
static struct map_desc omap7xx_io_desc[] __initdata = {
2627
{
2728
.virtual = OMAP1_IO_VIRT,
2829
.pfn = __phys_to_pfn(OMAP1_IO_PHYS),
2930
.length = OMAP1_IO_SIZE,
3031
.type = MT_DEVICE
31-
}
32-
};
33-
34-
#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
35-
static struct map_desc omap7xx_io_desc[] __initdata = {
32+
},
3633
{
3734
.virtual = OMAP7XX_DSP_BASE,
3835
.pfn = __phys_to_pfn(OMAP7XX_DSP_START),
@@ -49,6 +46,12 @@ static struct map_desc omap7xx_io_desc[] __initdata = {
4946

5047
#ifdef CONFIG_ARCH_OMAP15XX
5148
static struct map_desc omap1510_io_desc[] __initdata = {
49+
{
50+
.virtual = OMAP1_IO_VIRT,
51+
.pfn = __phys_to_pfn(OMAP1_IO_PHYS),
52+
.length = OMAP1_IO_SIZE,
53+
.type = MT_DEVICE
54+
},
5255
{
5356
.virtual = OMAP1510_DSP_BASE,
5457
.pfn = __phys_to_pfn(OMAP1510_DSP_START),
@@ -65,6 +68,12 @@ static struct map_desc omap1510_io_desc[] __initdata = {
6568

6669
#if defined(CONFIG_ARCH_OMAP16XX)
6770
static struct map_desc omap16xx_io_desc[] __initdata = {
71+
{
72+
.virtual = OMAP1_IO_VIRT,
73+
.pfn = __phys_to_pfn(OMAP1_IO_PHYS),
74+
.length = OMAP1_IO_SIZE,
75+
.type = MT_DEVICE
76+
},
6877
{
6978
.virtual = OMAP16XX_DSP_BASE,
7079
.pfn = __phys_to_pfn(OMAP16XX_DSP_START),
@@ -79,34 +88,23 @@ static struct map_desc omap16xx_io_desc[] __initdata = {
7988
};
8089
#endif
8190

82-
/*
83-
* Maps common IO regions for omap1
84-
*/
85-
static void __init omap1_map_common_io(void)
86-
{
87-
iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
88-
}
89-
9091
#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
9192
void __init omap7xx_map_io(void)
9293
{
93-
omap1_map_common_io();
9494
iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc));
9595
}
9696
#endif
9797

9898
#ifdef CONFIG_ARCH_OMAP15XX
9999
void __init omap15xx_map_io(void)
100100
{
101-
omap1_map_common_io();
102101
iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
103102
}
104103
#endif
105104

106105
#if defined(CONFIG_ARCH_OMAP16XX)
107106
void __init omap16xx_map_io(void)
108107
{
109-
omap1_map_common_io();
110108
iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc));
111109
}
112110
#endif

arch/arm/mach-omap1/mcbsp.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = {
8989
#define OMAP1610_MCBSP2_BASE 0xfffb1000
9090
#define OMAP1610_MCBSP3_BASE 0xe1017000
9191

92-
#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
9392
struct resource omap7xx_mcbsp_res[][6] = {
9493
{
9594
{
@@ -159,14 +158,7 @@ static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = {
159158
};
160159
#define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1])
161160
#define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res)
162-
#else
163-
#define omap7xx_mcbsp_res_0 NULL
164-
#define omap7xx_mcbsp_pdata NULL
165-
#define OMAP7XX_MCBSP_RES_SZ 0
166-
#define OMAP7XX_MCBSP_COUNT 0
167-
#endif
168161

169-
#ifdef CONFIG_ARCH_OMAP15XX
170162
struct resource omap15xx_mcbsp_res[][6] = {
171163
{
172164
{
@@ -266,14 +258,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
266258
};
267259
#define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1])
268260
#define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res)
269-
#else
270-
#define omap15xx_mcbsp_res_0 NULL
271-
#define omap15xx_mcbsp_pdata NULL
272-
#define OMAP15XX_MCBSP_RES_SZ 0
273-
#define OMAP15XX_MCBSP_COUNT 0
274-
#endif
275261

276-
#ifdef CONFIG_ARCH_OMAP16XX
277262
struct resource omap16xx_mcbsp_res[][6] = {
278263
{
279264
{
@@ -373,12 +358,6 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
373358
};
374359
#define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1])
375360
#define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res)
376-
#else
377-
#define omap16xx_mcbsp_res_0 NULL
378-
#define omap16xx_mcbsp_pdata NULL
379-
#define OMAP16XX_MCBSP_RES_SZ 0
380-
#define OMAP16XX_MCBSP_COUNT 0
381-
#endif
382361

383362
static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
384363
struct omap_mcbsp_platform_data *config, int size)

arch/arm/mach-omap1/pm.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@
106106
#define OMAP7XX_IDLECT3 0xfffece24
107107
#define OMAP7XX_IDLE_LOOP_REQUEST 0x0C00
108108

109-
#if !defined(CONFIG_ARCH_OMAP730) && \
110-
!defined(CONFIG_ARCH_OMAP850) && \
111-
!defined(CONFIG_ARCH_OMAP15XX) && \
112-
!defined(CONFIG_ARCH_OMAP16XX)
113-
#warning "Power management for this processor not implemented yet"
114-
#endif
115-
116109
#ifndef __ASSEMBLER__
117110

118111
#include <linux/clk.h>

include/linux/soc/ti/omap1-io.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef __ASSEMBLER__
66
#include <linux/types.h>
77

8-
#ifdef CONFIG_ARCH_OMAP1_ANY
8+
#ifdef CONFIG_ARCH_OMAP1
99
/*
1010
* NOTE: Please use ioremap + __raw_read/write where possible instead of these
1111
*/
@@ -15,7 +15,7 @@ extern u32 omap_readl(u32 pa);
1515
extern void omap_writeb(u8 v, u32 pa);
1616
extern void omap_writew(u16 v, u32 pa);
1717
extern void omap_writel(u32 v, u32 pa);
18-
#else
18+
#elif defined(CONFIG_COMPILE_TEST)
1919
static inline u8 omap_readb(u32 pa) { return 0; }
2020
static inline u16 omap_readw(u32 pa) { return 0; }
2121
static inline u32 omap_readl(u32 pa) { return 0; }

0 commit comments

Comments
 (0)