mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 06:04:14 +08:00
b274776c54
A large number of cleanups, all over the platforms. This is dominated largely by the Samsung platforms (s3c, s5p, exynos) and a few of the others moving code out of arch/arm into more appropriate subsystems. The clocksource and irqchip drivers are now abstracted to the point where platforms that are already cleaned up do not need to even specify the driver they use, it can all get configured from the device tree as we do for normal device drivers. The clocksource changes basically touch every single platform in the process. We further clean up the use of platform specific header files here, with the goal of turning more of the platforms over to being "multiplatform" enabled, which implies that they cannot expose their headers to architecture independent code any more. It is expected that no functional changes are part of the cleanup. The overall reduction in total code lines is mostly the result of removing broken and obsolete code. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIVAwUAUSUyKmCrR//JCVInAQIN8RAAnb/uPytmlMjn5yCksF4Mvb/FVbn/TVwz KRIGpCHOzyKK1q7pM8NRUVWfjW2SZqbXJFqx6zBGKSlDPvFTOhsLyyupU+Tnyu5W IX4eIUBwb+a6H7XDHw0X2YI8uHzi5RNLhne0A1QyDKcnuHs1LDAttXnJHaK4Ap6Y NN2YFt3l3ld7DXWXJtMsw5v8lC10aeIFGTvXefaPDAdeMLivmI57qEUMDXknNr7W Odz/Rc0/cw3BNBVl/zNHA0jw7FOjKAymCYYNUa4xDCJEr+JnIRTqizd0N/YIIC7x aA2xjJ3oKUFyF51yiJE6nFuTyJznhwtehc+uiMOSIkjrPLym52LEHmd7G5Yqlmjz oiei09qBb870q3lGxwfht9iaeIwYgQFYGfD0yW5QWArCO5pxhtCPLPH7YZNZtcQd ZJRSGGqT/ljBz3bm0K9OLESeeTTN7+Nxvtpiz/CD+Piegz0gWJzDYJRTzkJ3UWpA WTVhVQdWUeX2JrNkgM7Z3Tu8iXOe+LIEs7kVXGJZSREmIIZiRvR36UrODZtAkp9I 7YQ+srX/uaR832pgK0RrHK0zY0psU6MmIvhYxJZFbx7keiPA9eH6drb0x7tGqcUD FzEUzvcZvyqppndfBi+R60H/YKAhJDEXdwxzo6dyCpPQaW1T9GnzIqXuE1zin+Aw X7Y8YywMbHI= =DvgJ -----END PGP SIGNATURE----- Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC cleanups from Arnd Bergmann: "A large number of cleanups, all over the platforms. This is dominated largely by the Samsung platforms (s3c, s5p, exynos) and a few of the others moving code out of arch/arm into more appropriate subsystems. The clocksource and irqchip drivers are now abstracted to the point where platforms that are already cleaned up do not need to even specify the driver they use, it can all get configured from the device tree as we do for normal device drivers. The clocksource changes basically touch every single platform in the process. We further clean up the use of platform specific header files here, with the goal of turning more of the platforms over to being "multiplatform" enabled, which implies that they cannot expose their headers to architecture independent code any more. It is expected that no functional changes are part of the cleanup. The overall reduction in total code lines is mostly the result of removing broken and obsolete code." * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (133 commits) ARM: mvebu: correct gated clock documentation ARM: kirkwood: add missing include for nsa310 ARM: exynos: move exynos4210-combiner to drivers/irqchip mfd: db8500-prcmu: update resource passing drivers/db8500-cpufreq: delete dangling include ARM: at91: remove NEOCORE 926 board sunxi: Cleanup the reset code and add meaningful registers defines ARM: S3C24XX: header mach/regs-mem.h local ARM: S3C24XX: header mach/regs-power.h local ARM: S3C24XX: header mach/regs-s3c2412-mem.h local ARM: S3C24XX: Remove plat-s3c24xx directory in arch/arm/ ARM: S3C24XX: transform s3c2443 subirqs into new structure ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs ARM: S3C24XX: move s3c2443 irq code to irq.c ARM: S3C24XX: transform s3c2416 irqs into new structure ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs ARM: S3C24XX: move s3c2416 irq init to common irq code ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property ARM: S3C24XX: Move irq syscore-ops to irq-pm clocksource: always define CLOCKSOURCE_OF_DECLARE ...
177 lines
3.9 KiB
C
177 lines
3.9 KiB
C
/*
|
|
* linux/arch/arm/mach-sa1100/lart.c
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/platform_data/sa11x0-serial.h>
|
|
#include <linux/tty.h>
|
|
#include <linux/gpio.h>
|
|
#include <linux/leds.h>
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <video/sa1100fb.h>
|
|
|
|
#include <mach/hardware.h>
|
|
#include <asm/setup.h>
|
|
#include <asm/mach-types.h>
|
|
#include <asm/page.h>
|
|
|
|
#include <asm/mach/arch.h>
|
|
#include <asm/mach/map.h>
|
|
#include <linux/platform_data/mfd-mcp-sa11x0.h>
|
|
#include <mach/irqs.h>
|
|
|
|
#include "generic.h"
|
|
|
|
static struct mcp_plat_data lart_mcp_data = {
|
|
.mccr0 = MCCR0_ADM,
|
|
.sclk_rate = 11981000,
|
|
};
|
|
|
|
#ifdef LART_GREY_LCD
|
|
static struct sa1100fb_mach_info lart_grey_info = {
|
|
.pixclock = 150000, .bpp = 4,
|
|
.xres = 320, .yres = 240,
|
|
|
|
.hsync_len = 1, .vsync_len = 1,
|
|
.left_margin = 4, .upper_margin = 0,
|
|
.right_margin = 2, .lower_margin = 0,
|
|
|
|
.cmap_greyscale = 1,
|
|
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
|
|
|
|
.lccr0 = LCCR0_Mono | LCCR0_Sngl | LCCR0_Pas | LCCR0_4PixMono,
|
|
.lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
|
|
};
|
|
#endif
|
|
#ifdef LART_COLOR_LCD
|
|
static struct sa1100fb_mach_info lart_color_info = {
|
|
.pixclock = 150000, .bpp = 16,
|
|
.xres = 320, .yres = 240,
|
|
|
|
.hsync_len = 2, .vsync_len = 3,
|
|
.left_margin = 69, .upper_margin = 14,
|
|
.right_margin = 8, .lower_margin = 4,
|
|
|
|
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
|
|
.lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
|
|
};
|
|
#endif
|
|
#ifdef LART_VIDEO_OUT
|
|
static struct sa1100fb_mach_info lart_video_info = {
|
|
.pixclock = 39721, .bpp = 16,
|
|
.xres = 640, .yres = 480,
|
|
|
|
.hsync_len = 95, .vsync_len = 2,
|
|
.left_margin = 40, .upper_margin = 32,
|
|
.right_margin = 24, .lower_margin = 11,
|
|
|
|
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
|
|
|
|
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
|
|
.lccr3 = LCCR3_OutEnL | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
|
|
};
|
|
#endif
|
|
|
|
#ifdef LART_KIT01_LCD
|
|
static struct sa1100fb_mach_info lart_kit01_info = {
|
|
.pixclock = 63291, .bpp = 16,
|
|
.xres = 640, .yres = 480,
|
|
|
|
.hsync_len = 64, .vsync_len = 3,
|
|
.left_margin = 122, .upper_margin = 45,
|
|
.right_margin = 10, .lower_margin = 10,
|
|
|
|
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
|
|
.lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg
|
|
};
|
|
#endif
|
|
|
|
static void __init lart_init(void)
|
|
{
|
|
struct sa1100fb_mach_info *inf = NULL;
|
|
|
|
#ifdef LART_GREY_LCD
|
|
inf = &lart_grey_info;
|
|
#endif
|
|
#ifdef LART_COLOR_LCD
|
|
inf = &lart_color_info;
|
|
#endif
|
|
#ifdef LART_VIDEO_OUT
|
|
inf = &lart_video_info;
|
|
#endif
|
|
#ifdef LART_KIT01_LCD
|
|
inf = &lart_kit01_info;
|
|
#endif
|
|
|
|
if (inf)
|
|
sa11x0_register_lcd(inf);
|
|
|
|
sa11x0_ppc_configure_mcp();
|
|
sa11x0_register_mcp(&lart_mcp_data);
|
|
}
|
|
|
|
static struct map_desc lart_io_desc[] __initdata = {
|
|
{ /* main flash memory */
|
|
.virtual = 0xe8000000,
|
|
.pfn = __phys_to_pfn(0x00000000),
|
|
.length = 0x00400000,
|
|
.type = MT_DEVICE
|
|
}, { /* main flash, alternative location */
|
|
.virtual = 0xec000000,
|
|
.pfn = __phys_to_pfn(0x08000000),
|
|
.length = 0x00400000,
|
|
.type = MT_DEVICE
|
|
}
|
|
};
|
|
|
|
/* LEDs */
|
|
struct gpio_led lart_gpio_leds[] = {
|
|
{
|
|
.name = "lart:red",
|
|
.default_trigger = "cpu0",
|
|
.gpio = 23,
|
|
},
|
|
};
|
|
|
|
static struct gpio_led_platform_data lart_gpio_led_info = {
|
|
.leds = lart_gpio_leds,
|
|
.num_leds = ARRAY_SIZE(lart_gpio_leds),
|
|
};
|
|
|
|
static struct platform_device lart_leds = {
|
|
.name = "leds-gpio",
|
|
.id = -1,
|
|
.dev = {
|
|
.platform_data = &lart_gpio_led_info,
|
|
}
|
|
};
|
|
static void __init lart_map_io(void)
|
|
{
|
|
sa1100_map_io();
|
|
iotable_init(lart_io_desc, ARRAY_SIZE(lart_io_desc));
|
|
|
|
sa1100_register_uart(0, 3);
|
|
sa1100_register_uart(1, 1);
|
|
sa1100_register_uart(2, 2);
|
|
|
|
GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
|
|
GPDR |= GPIO_UART_TXD;
|
|
GPDR &= ~GPIO_UART_RXD;
|
|
PPAR |= PPAR_UPR;
|
|
|
|
platform_device_register(&lart_leds);
|
|
}
|
|
|
|
MACHINE_START(LART, "LART")
|
|
.atag_offset = 0x100,
|
|
.map_io = lart_map_io,
|
|
.nr_irqs = SA1100_NR_IRQS,
|
|
.init_irq = sa1100_init_irq,
|
|
.init_machine = lart_init,
|
|
.init_late = sa11x0_init_late,
|
|
.init_time = sa1100_timer_init,
|
|
.restart = sa11x0_restart,
|
|
MACHINE_END
|