2019-06-04 16:11:33 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2005-07-11 02:58:12 +08:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-omap1/io.c
|
|
|
|
*
|
|
|
|
* OMAP1 I/O mapping code
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
2008-09-06 19:10:45 +08:00
|
|
|
#include <linux/io.h>
|
2019-08-06 22:16:03 +08:00
|
|
|
#include <linux/omap-dma.h>
|
2005-07-11 02:58:12 +08:00
|
|
|
|
2006-02-09 06:06:45 +08:00
|
|
|
#include <asm/tlb.h>
|
2005-07-11 02:58:12 +08:00
|
|
|
#include <asm/mach/map.h>
|
2012-02-25 02:34:34 +08:00
|
|
|
|
2019-08-06 22:16:03 +08:00
|
|
|
#include "tc.h"
|
2012-02-25 02:34:34 +08:00
|
|
|
#include "iomap.h"
|
|
|
|
#include "common.h"
|
2009-12-09 07:29:38 +08:00
|
|
|
|
2005-07-11 02:58:12 +08:00
|
|
|
/*
|
|
|
|
* The machine specific code may provide the extra mapping besides the
|
|
|
|
* default mapping provided here.
|
|
|
|
*/
|
2023-01-04 20:55:37 +08:00
|
|
|
static struct map_desc omap1_io_desc[] __initdata = {
|
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>
2023-01-04 16:35:09 +08:00
|
|
|
{
|
|
|
|
.virtual = OMAP1_IO_VIRT,
|
|
|
|
.pfn = __phys_to_pfn(OMAP1_IO_PHYS),
|
|
|
|
.length = OMAP1_IO_SIZE,
|
|
|
|
.type = MT_DEVICE
|
2005-10-28 22:19:00 +08:00
|
|
|
}, {
|
2023-01-04 20:55:37 +08:00
|
|
|
.virtual = OMAP1_DSP_BASE,
|
|
|
|
.pfn = __phys_to_pfn(OMAP1_DSP_START),
|
|
|
|
.length = OMAP1_DSP_SIZE,
|
2005-10-28 22:19:00 +08:00
|
|
|
.type = MT_DEVICE
|
|
|
|
}, {
|
2023-01-04 20:55:37 +08:00
|
|
|
.virtual = OMAP1_DSPREG_BASE,
|
|
|
|
.pfn = __phys_to_pfn(OMAP1_DSPREG_START),
|
|
|
|
.length = OMAP1_DSPREG_SIZE,
|
2005-10-28 22:19:00 +08:00
|
|
|
.type = MT_DEVICE
|
|
|
|
}
|
2005-07-11 02:58:12 +08:00
|
|
|
};
|
|
|
|
|
2023-01-04 20:55:37 +08:00
|
|
|
/*
|
|
|
|
* Maps common IO regions for omap1
|
|
|
|
*/
|
|
|
|
void __init omap1_map_io(void)
|
2011-10-06 06:14:02 +08:00
|
|
|
{
|
2023-01-04 20:55:37 +08:00
|
|
|
iotable_init(omap1_io_desc, ARRAY_SIZE(omap1_io_desc));
|
2006-02-09 06:06:45 +08:00
|
|
|
}
|
2005-09-09 06:07:38 +08:00
|
|
|
|
2006-02-09 06:06:45 +08:00
|
|
|
/*
|
2011-10-06 06:14:02 +08:00
|
|
|
* Common low-level hardware init for omap1.
|
2006-02-09 06:06:45 +08:00
|
|
|
*/
|
2012-03-06 08:11:04 +08:00
|
|
|
void __init omap1_init_early(void)
|
2006-02-09 06:06:45 +08:00
|
|
|
{
|
2011-10-06 06:14:02 +08:00
|
|
|
omap_check_revision();
|
|
|
|
|
2005-07-11 02:58:12 +08:00
|
|
|
/* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
|
|
|
|
* on a Posted Write in the TIPB Bridge".
|
|
|
|
*/
|
|
|
|
omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
|
|
|
|
omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
|
|
|
|
}
|
2005-09-09 06:07:38 +08:00
|
|
|
|
2012-04-26 13:49:29 +08:00
|
|
|
void __init omap1_init_late(void)
|
|
|
|
{
|
|
|
|
omap_serial_wakeup_init();
|
|
|
|
}
|
|
|
|
|
2010-12-11 01:46:24 +08:00
|
|
|
/*
|
|
|
|
* NOTE: Please use ioremap + __raw_read/write where possible instead of these
|
|
|
|
*/
|
|
|
|
|
|
|
|
u8 omap_readb(u32 pa)
|
|
|
|
{
|
|
|
|
return __raw_readb(OMAP1_IO_ADDRESS(pa));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(omap_readb);
|
|
|
|
|
|
|
|
u16 omap_readw(u32 pa)
|
|
|
|
{
|
|
|
|
return __raw_readw(OMAP1_IO_ADDRESS(pa));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(omap_readw);
|
|
|
|
|
|
|
|
u32 omap_readl(u32 pa)
|
|
|
|
{
|
|
|
|
return __raw_readl(OMAP1_IO_ADDRESS(pa));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(omap_readl);
|
|
|
|
|
|
|
|
void omap_writeb(u8 v, u32 pa)
|
|
|
|
{
|
|
|
|
__raw_writeb(v, OMAP1_IO_ADDRESS(pa));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(omap_writeb);
|
|
|
|
|
|
|
|
void omap_writew(u16 v, u32 pa)
|
|
|
|
{
|
|
|
|
__raw_writew(v, OMAP1_IO_ADDRESS(pa));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(omap_writew);
|
|
|
|
|
|
|
|
void omap_writel(u32 v, u32 pa)
|
|
|
|
{
|
|
|
|
__raw_writel(v, OMAP1_IO_ADDRESS(pa));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(omap_writel);
|