mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 14:06:51 +07:00
9cd11c0c47
This is a pretty significant branch. It's the introduction of the first multiplatform support on ARM, and with this (and the later branch) merged, it is now possible to build one kernel that contains support for highbank, vexpress, mvebu, socfpga, and picoxcell. More platforms will be convered over in the next few releases. Two critical last things had to be done for this to be practical and possible: * Today each platform has its own include directory under mach-<mach>/include/mach/*, and traditionally that is where a lot of driver/platform shared definitions have gone, such as platform data structures. They now need to move out to a common location instead, and this branch moves a large number of those out to include/linux/platform_data. * Each platform used to list the device trees to compile for its boards in mach-<mach>/Makefile.boot. Both of the above changes will mean that there are some merge conflicts to come (and some to resolve here). It's a one-time move and once it settles in, we should be good for quite a while. Sorry for the overhead. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJQaO7aAAoJEIwa5zzehBx3bUIP/02U8PhkHJJrrowyIsWRBOql 7LPJ53PRRgrpBdmEGzFD3TO3zaNyrjQRbYgNDvzHMO6NAMNvdRFouuWYjO11/tuB i32zssXCC+eUOEgbAo/U/lYq+UOvqw9gv6mU+3+i3OcGEhdKOaoT/DSLPQC4hoDm 222TeLfFB3HJXu5n720dEQ9V3fO6TS1+bbh8TU3cjHqzceXsOrffZqOA5CQxUcRr KWwOjA0nALDwWcqgv45GJNwY3GTyAQ/hPMQavnuWK0voJ+qUYk5HftKocAK7C+py 0T0OFOAHTwtyhvzJBxLC84M6Ox465BYXyeNjIB+2nG/Um9+mDoP0dnWpGy4c7DMU P5hyqbeLGeqjUXQuYtRmgMMc3UeHKoUGAfXW9eMsjLa6/M4NLGv//7E7LbZPpgMZ obkjwuesmcaYn/FRyj/yFmC35YlF4oCLziVzEtURZw3eKHHSUlhkTDSMNnkcZ0kZ Vv7kFxnD2Y46ixiwSJv30ErQnVkgI3MdqDlDxkE8r5+phYuK4gCrNaJtiwRh/oNw cFhpPxKuA0sJ9b6YRTzjC45eT/XZomEEr/uifCFeRNaCquyjYP00Mm8F0flSqwx9 zi+emzPAwNmk1bvxMUM/idGnaj0V4p+BAYUAvkbSoqU1p1flzyhU88fGTSIyKOt6 K5TCDS2v5hrVykK9TDwl =Tc6y -----END PGP SIGNATURE----- Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM soc multiplatform enablement from Olof Johansson: "This is a pretty significant branch. It's the introduction of the first multiplatform support on ARM, and with this (and the later branch) merged, it is now possible to build one kernel that contains support for highbank, vexpress, mvebu, socfpga, and picoxcell. More platforms will be convered over in the next few releases. Two critical last things had to be done for this to be practical and possible: * Today each platform has its own include directory under mach-<mach>/include/mach/*, and traditionally that is where a lot of driver/platform shared definitions have gone, such as platform data structures. They now need to move out to a common location instead, and this branch moves a large number of those out to include/linux/platform_data. * Each platform used to list the device trees to compile for its boards in mach-<mach>/Makefile.boot. Both of the above changes will mean that there are some merge conflicts to come (and some to resolve here). It's a one-time move and once it settles in, we should be good for quite a while. Sorry for the overhead." Fix conflicts as per Olof. * tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (51 commits) ARM: add v7 multi-platform defconfig ARM: msm: Move core.h contents into common.h ARM: highbank: call highbank_pm_init from .init_machine ARM: dtb: move all dtb targets to common Makefile ARM: spear: move platform_data definitions ARM: samsung: move platform_data definitions ARM: orion: move platform_data definitions ARM: vexpress: convert to multi-platform ARM: initial multiplatform support ARM: mvebu: move armada-370-xp.h in mach dir ARM: vexpress: remove dependency on mach/* headers ARM: picoxcell: remove dependency on mach/* headers ARM: move all dtb targets out of Makefile.boot ARM: picoxcell: move debug macros to include/debug ARM: socfpga: move debug macros to include/debug ARM: mvebu: move debug macros to include/debug ARM: vexpress: move debug macros to include/debug ARM: highbank: move debug macros to include/debug ARM: move debug macros to common location ARM: make mach/gpio.h headers optional ...
182 lines
4.0 KiB
C
182 lines
4.0 KiB
C
/*
|
|
* linux/arch/arm/mach-sa1100/cerf.c
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* Apr-2003 : Removed some old PDA crud [FB]
|
|
* Oct-2003 : Added uart2 resource [FB]
|
|
* Jan-2004 : Removed io map for flash [FB]
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/tty.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/mtd/mtd.h>
|
|
#include <linux/mtd/partitions.h>
|
|
#include <linux/gpio.h>
|
|
#include <linux/leds.h>
|
|
|
|
#include <mach/hardware.h>
|
|
#include <asm/setup.h>
|
|
|
|
#include <asm/mach-types.h>
|
|
#include <asm/mach/arch.h>
|
|
#include <asm/mach/flash.h>
|
|
#include <asm/mach/map.h>
|
|
#include <asm/mach/serial_sa1100.h>
|
|
|
|
#include <mach/cerf.h>
|
|
#include <linux/platform_data/mfd-mcp-sa11x0.h>
|
|
#include <mach/irqs.h>
|
|
#include "generic.h"
|
|
|
|
static struct resource cerfuart2_resources[] = {
|
|
[0] = DEFINE_RES_MEM(0x80030000, SZ_64K),
|
|
};
|
|
|
|
static struct platform_device cerfuart2_device = {
|
|
.name = "sa11x0-uart",
|
|
.id = 2,
|
|
.num_resources = ARRAY_SIZE(cerfuart2_resources),
|
|
.resource = cerfuart2_resources,
|
|
};
|
|
|
|
/* LEDs */
|
|
struct gpio_led cerf_gpio_leds[] = {
|
|
{
|
|
.name = "cerf:d0",
|
|
.default_trigger = "heartbeat",
|
|
.gpio = 0,
|
|
},
|
|
{
|
|
.name = "cerf:d1",
|
|
.default_trigger = "cpu0",
|
|
.gpio = 1,
|
|
},
|
|
{
|
|
.name = "cerf:d2",
|
|
.default_trigger = "default-on",
|
|
.gpio = 2,
|
|
},
|
|
{
|
|
.name = "cerf:d3",
|
|
.default_trigger = "default-on",
|
|
.gpio = 3,
|
|
},
|
|
|
|
};
|
|
|
|
static struct gpio_led_platform_data cerf_gpio_led_info = {
|
|
.leds = cerf_gpio_leds,
|
|
.num_leds = ARRAY_SIZE(cerf_gpio_leds),
|
|
};
|
|
|
|
static struct platform_device cerf_leds = {
|
|
.name = "leds-gpio",
|
|
.id = -1,
|
|
.dev = {
|
|
.platform_data = &cerf_gpio_led_info,
|
|
}
|
|
};
|
|
|
|
|
|
static struct platform_device *cerf_devices[] __initdata = {
|
|
&cerfuart2_device,
|
|
&cerf_leds,
|
|
};
|
|
|
|
#ifdef CONFIG_SA1100_CERF_FLASH_32MB
|
|
# define CERF_FLASH_SIZE 0x02000000
|
|
#elif defined CONFIG_SA1100_CERF_FLASH_16MB
|
|
# define CERF_FLASH_SIZE 0x01000000
|
|
#elif defined CONFIG_SA1100_CERF_FLASH_8MB
|
|
# define CERF_FLASH_SIZE 0x00800000
|
|
#else
|
|
# error "Undefined flash size for CERF"
|
|
#endif
|
|
|
|
static struct mtd_partition cerf_partitions[] = {
|
|
{
|
|
.name = "Bootloader",
|
|
.size = 0x00020000,
|
|
.offset = 0x00000000,
|
|
}, {
|
|
.name = "Params",
|
|
.size = 0x00040000,
|
|
.offset = 0x00020000,
|
|
}, {
|
|
.name = "Kernel",
|
|
.size = 0x00100000,
|
|
.offset = 0x00060000,
|
|
}, {
|
|
.name = "Filesystem",
|
|
.size = CERF_FLASH_SIZE-0x00160000,
|
|
.offset = 0x00160000,
|
|
}
|
|
};
|
|
|
|
static struct flash_platform_data cerf_flash_data = {
|
|
.map_name = "cfi_probe",
|
|
.parts = cerf_partitions,
|
|
.nr_parts = ARRAY_SIZE(cerf_partitions),
|
|
};
|
|
|
|
static struct resource cerf_flash_resource =
|
|
DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M);
|
|
|
|
static void __init cerf_init_irq(void)
|
|
{
|
|
sa1100_init_irq();
|
|
irq_set_irq_type(CERF_ETH_IRQ, IRQ_TYPE_EDGE_RISING);
|
|
}
|
|
|
|
static struct map_desc cerf_io_desc[] __initdata = {
|
|
{ /* Crystal Ethernet Chip */
|
|
.virtual = 0xf0000000,
|
|
.pfn = __phys_to_pfn(0x08000000),
|
|
.length = 0x00100000,
|
|
.type = MT_DEVICE
|
|
}
|
|
};
|
|
|
|
static void __init cerf_map_io(void)
|
|
{
|
|
sa1100_map_io();
|
|
iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc));
|
|
|
|
sa1100_register_uart(0, 3);
|
|
sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
|
|
sa1100_register_uart(2, 1);
|
|
|
|
/* set some GPDR bits here while it's safe */
|
|
GPDR |= CERF_GPIO_CF_RESET;
|
|
}
|
|
|
|
static struct mcp_plat_data cerf_mcp_data = {
|
|
.mccr0 = MCCR0_ADM,
|
|
.sclk_rate = 11981000,
|
|
};
|
|
|
|
static void __init cerf_init(void)
|
|
{
|
|
sa11x0_ppc_configure_mcp();
|
|
platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
|
|
sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);
|
|
sa11x0_register_mcp(&cerf_mcp_data);
|
|
}
|
|
|
|
MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
|
|
/* Maintainer: support@intrinsyc.com */
|
|
.map_io = cerf_map_io,
|
|
.nr_irqs = SA1100_NR_IRQS,
|
|
.init_irq = cerf_init_irq,
|
|
.timer = &sa1100_timer,
|
|
.init_machine = cerf_init,
|
|
.init_late = sa11x0_init_late,
|
|
.restart = sa11x0_restart,
|
|
MACHINE_END
|