Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 615dce5bf736 ("ARM: omap1: fix build with no SoC selected")
Cc: stable@vger.kernel.org
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+18 -55
+1 -4
arch/arm/mach-omap1/Kconfig
··· 4 4 depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 5 5 depends on CPU_LITTLE_ENDIAN 6 6 depends on ATAGS 7 + select ARCH_OMAP 7 8 select ARCH_HAS_HOLES_MEMORYMODEL 8 9 select ARCH_OMAP 9 10 select CLKSRC_MMIO ··· 45 44 select ARCH_OMAP_OTG 46 45 select CPU_ARM926T 47 46 select OMAP_DM_TIMER 48 - 49 - config ARCH_OMAP1_ANY 50 - select ARCH_OMAP 51 - def_bool ARCH_OMAP730 || ARCH_OMAP850 || ARCH_OMAP15XX || ARCH_OMAP16XX 52 47 53 48 config ARCH_OMAP 54 49 bool
-4
arch/arm/mach-omap1/Makefile
··· 3 3 # Makefile for the linux kernel. 4 4 # 5 5 6 - ifdef CONFIG_ARCH_OMAP1_ANY 7 - 8 6 # Common support 9 7 obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \ 10 8 serial.o devices.o dma.o omap-dma.o fb.o ··· 57 59 obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o 58 60 obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o 59 61 obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o 60 - 61 - endif
+15 -17
arch/arm/mach-omap1/io.c
··· 22 22 * The machine specific code may provide the extra mapping besides the 23 23 * default mapping provided here. 24 24 */ 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 = { 26 27 { 27 28 .virtual = OMAP1_IO_VIRT, 28 29 .pfn = __phys_to_pfn(OMAP1_IO_PHYS), 29 30 .length = OMAP1_IO_SIZE, 30 31 .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 + }, 36 33 { 37 34 .virtual = OMAP7XX_DSP_BASE, 38 35 .pfn = __phys_to_pfn(OMAP7XX_DSP_START), ··· 47 50 #ifdef CONFIG_ARCH_OMAP15XX 48 51 static struct map_desc omap1510_io_desc[] __initdata = { 49 52 { 53 + .virtual = OMAP1_IO_VIRT, 54 + .pfn = __phys_to_pfn(OMAP1_IO_PHYS), 55 + .length = OMAP1_IO_SIZE, 56 + .type = MT_DEVICE 57 + }, 58 + { 50 59 .virtual = OMAP1510_DSP_BASE, 51 60 .pfn = __phys_to_pfn(OMAP1510_DSP_START), 52 61 .length = OMAP1510_DSP_SIZE, ··· 69 66 #if defined(CONFIG_ARCH_OMAP16XX) 70 67 static struct map_desc omap16xx_io_desc[] __initdata = { 71 68 { 69 + .virtual = OMAP1_IO_VIRT, 70 + .pfn = __phys_to_pfn(OMAP1_IO_PHYS), 71 + .length = OMAP1_IO_SIZE, 72 + .type = MT_DEVICE 73 + }, 74 + { 72 75 .virtual = OMAP16XX_DSP_BASE, 73 76 .pfn = __phys_to_pfn(OMAP16XX_DSP_START), 74 77 .length = OMAP16XX_DSP_SIZE, ··· 88 79 }; 89 80 #endif 90 81 91 - /* 92 - * Maps common IO regions for omap1 93 - */ 94 - static void __init omap1_map_common_io(void) 95 - { 96 - iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc)); 97 - } 98 - 99 82 #if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) 100 83 void __init omap7xx_map_io(void) 101 84 { 102 - omap1_map_common_io(); 103 85 iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc)); 104 86 } 105 87 #endif ··· 98 98 #ifdef CONFIG_ARCH_OMAP15XX 99 99 void __init omap15xx_map_io(void) 100 100 { 101 - omap1_map_common_io(); 102 101 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); 103 102 } 104 103 #endif ··· 105 106 #if defined(CONFIG_ARCH_OMAP16XX) 106 107 void __init omap16xx_map_io(void) 107 108 { 108 - omap1_map_common_io(); 109 109 iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc)); 110 110 } 111 111 #endif
-21
arch/arm/mach-omap1/mcbsp.c
··· 89 89 #define OMAP1610_MCBSP2_BASE 0xfffb1000 90 90 #define OMAP1610_MCBSP3_BASE 0xe1017000 91 91 92 - #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 93 92 struct resource omap7xx_mcbsp_res[][6] = { 94 93 { 95 94 { ··· 158 159 }; 159 160 #define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1]) 160 161 #define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res) 161 - #else 162 - #define omap7xx_mcbsp_res_0 NULL 163 - #define omap7xx_mcbsp_pdata NULL 164 - #define OMAP7XX_MCBSP_RES_SZ 0 165 - #define OMAP7XX_MCBSP_COUNT 0 166 - #endif 167 162 168 - #ifdef CONFIG_ARCH_OMAP15XX 169 163 struct resource omap15xx_mcbsp_res[][6] = { 170 164 { 171 165 { ··· 258 266 }; 259 267 #define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1]) 260 268 #define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res) 261 - #else 262 - #define omap15xx_mcbsp_res_0 NULL 263 - #define omap15xx_mcbsp_pdata NULL 264 - #define OMAP15XX_MCBSP_RES_SZ 0 265 - #define OMAP15XX_MCBSP_COUNT 0 266 - #endif 267 269 268 - #ifdef CONFIG_ARCH_OMAP16XX 269 270 struct resource omap16xx_mcbsp_res[][6] = { 270 271 { 271 272 { ··· 358 373 }; 359 374 #define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1]) 360 375 #define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res) 361 - #else 362 - #define omap16xx_mcbsp_res_0 NULL 363 - #define omap16xx_mcbsp_pdata NULL 364 - #define OMAP16XX_MCBSP_RES_SZ 0 365 - #define OMAP16XX_MCBSP_COUNT 0 366 - #endif 367 376 368 377 static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, 369 378 struct omap_mcbsp_platform_data *config, int size)
-7
arch/arm/mach-omap1/pm.h
··· 106 106 #define OMAP7XX_IDLECT3 0xfffece24 107 107 #define OMAP7XX_IDLE_LOOP_REQUEST 0x0C00 108 108 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 - 116 109 #ifndef __ASSEMBLER__ 117 110 118 111 #include <linux/clk.h>
+2 -2
include/linux/soc/ti/omap1-io.h
··· 5 5 #ifndef __ASSEMBLER__ 6 6 #include <linux/types.h> 7 7 8 - #ifdef CONFIG_ARCH_OMAP1_ANY 8 + #ifdef CONFIG_ARCH_OMAP1 9 9 /* 10 10 * NOTE: Please use ioremap + __raw_read/write where possible instead of these 11 11 */ ··· 15 15 extern void omap_writeb(u8 v, u32 pa); 16 16 extern void omap_writew(u16 v, u32 pa); 17 17 extern void omap_writel(u32 v, u32 pa); 18 - #else 18 + #elif defined(CONFIG_COMPILE_TEST) 19 19 static inline u8 omap_readb(u32 pa) { return 0; } 20 20 static inline u16 omap_readw(u32 pa) { return 0; } 21 21 static inline u32 omap_readl(u32 pa) { return 0; }