diff options
author | Uwe Kleine-König <uwe@kleine-koenig.org> | 2013-02-07 16:14:58 +0100 |
---|---|---|
committer | Uwe Kleine-König <uwe@kleine-koenig.org> | 2013-02-07 16:14:58 +0100 |
commit | 4c7fd84c45806feaaf77ff6167380edb55449649 (patch) | |
tree | 7e87f98da61773e9d1daba27ea9017ab332f24fe | |
parent | 9d60ea13b2254064f23cdb139fafab857f5f2366 (diff) | |
download | OSELAS.BSP-EnergyMicro-Gecko-4c7fd84c45806feaaf77ff6167380edb55449649.tar.gz OSELAS.BSP-EnergyMicro-Gecko-4c7fd84c45806feaaf77ff6167380edb55449649.tar.xz |
platform-energymicro-efm32gg-dk3750: kernel updates
- uses dt now
- untested driver for board fpga
- probes ethernet chip
- drop pinmuxing (moved into bootloader now)
14 files changed, 573 insertions, 1021 deletions
diff --git a/kernelconfig-3.8-rc5 b/kernelconfig-3.8-rc5 index 5093ac7..60c1854 100644 --- a/kernelconfig-3.8-rc5 +++ b/kernelconfig-3.8-rc5 @@ -4,7 +4,6 @@ # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_GENERIC_GPIO=y CONFIG_NO_IOPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y @@ -39,7 +38,9 @@ CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_LZO is not set CONFIG_DEFAULT_HOSTNAME="(none)" # CONFIG_SYSVIPC is not set +# CONFIG_POSIX_MQUEUE is not set # CONFIG_FHANDLE is not set +# CONFIG_AUDIT is not set CONFIG_HAVE_GENERIC_HARDIRQS=y # @@ -66,6 +67,7 @@ CONFIG_HIGH_RES_TIMERS=y # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set # # RCU Subsystem @@ -84,10 +86,12 @@ CONFIG_UIDGID_CONVERTED=y # CONFIG_RELAY is not set # CONFIG_BLK_DEV_INITRD is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_EXPERT=y CONFIG_HAVE_UID16=y # CONFIG_UID16 is not set +# CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set CONFIG_HOTPLUG=y @@ -161,7 +165,7 @@ CONFIG_INLINE_READ_UNLOCK=y CONFIG_INLINE_READ_UNLOCK_IRQ=y CONFIG_INLINE_WRITE_UNLOCK=y CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_FREEZER=y +# CONFIG_FREEZER is not set # # System Type @@ -205,8 +209,8 @@ CONFIG_ARCH_EFM32=y # CONFIG_PLAT_SPEAR is not set # CONFIG_ARCH_DAVINCI is not set # CONFIG_ARCH_VT8500_SINGLE is not set +CONFIG_EFM32_NONDT=y CONFIG_MACH_EFM32GG_DK3750=y -# CONFIG_EFM32GG_DK3750_FPGA is not set # CONFIG_ARCH_VT8500 is not set # @@ -281,11 +285,12 @@ CONFIG_FORCE_MAX_ZONEORDER=9 # # Boot options # -# CONFIG_USE_OF is not set +CONFIG_USE_OF=y CONFIG_ATAGS=y # CONFIG_DEPRECATED_PARAM_STRUCT is not set CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_ARM_APPENDED_DTB is not set CONFIG_CMDLINE="" CONFIG_XIP_KERNEL=y CONFIG_XIP_PHYS_ADDR=0x00000000 @@ -322,20 +327,55 @@ CONFIG_HAVE_AOUT=y # # Power management options # -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -CONFIG_PM_SLEEP=y -# CONFIG_PM_AUTOSLEEP is not set -# CONFIG_PM_WAKELOCKS is not set +# CONFIG_SUSPEND is not set # CONFIG_PM_RUNTIME is not set -CONFIG_PM=y -# CONFIG_PM_DEBUG is not set -# CONFIG_APM_EMULATION is not set -CONFIG_PM_CLK=y -CONFIG_CPU_PM=y CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARM_CPU_SUSPEND=y -# CONFIG_NET is not set +# CONFIG_ARM_CPU_SUSPEND is not set +CONFIG_NET=y + +# +# Networking options +# +# CONFIG_PACKET is not set +# CONFIG_UNIX is not set +# CONFIG_NET_KEY is not set +# CONFIG_INET is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +# CONFIG_NETFILTER is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +CONFIG_HAVE_NET_DSA=y +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set +# CONFIG_BATMAN_ADV is not set +# CONFIG_OPENVSWITCH is not set +CONFIG_BQL=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_WIRELESS is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_NFC is not set CONFIG_HAVE_BPF_JIT=y # @@ -359,10 +399,12 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # # Bus devices # +# CONFIG_CONNECTOR is not set CONFIG_MTD=y # CONFIG_MTD_REDBOOT_PARTS is not set # CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_AFS_PARTS is not set +CONFIG_MTD_OF_PARTS=y # CONFIG_MTD_AR7_PARTS is not set # @@ -404,6 +446,7 @@ CONFIG_MTD_ROM=y # # CONFIG_MTD_COMPLEX_MAPPINGS is not set # CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_PHYSMAP_OF is not set CONFIG_MTD_UCLINUX=y # CONFIG_MTD_PLATRAM is not set @@ -430,6 +473,21 @@ CONFIG_MTD_UCLINUX=y # # CONFIG_MTD_LPDDR is not set # CONFIG_MTD_UBI is not set +CONFIG_DTC=y +CONFIG_OF=y + +# +# Device Tree and Open Firmware support +# +# CONFIG_PROC_DEVICETREE is not set +# CONFIG_OF_SELFTEST is not set +CONFIG_OF_FLATTREE=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_IRQ=y +CONFIG_OF_DEVICE=y +CONFIG_OF_NET=y +CONFIG_OF_MTD=y # CONFIG_PARPORT is not set # CONFIG_BLK_DEV is not set @@ -468,6 +526,61 @@ CONFIG_SCSI_MOD=y # CONFIG_SCSI_NETLINK is not set # CONFIG_ATA is not set # CONFIG_MD is not set +CONFIG_NETDEVICES=y +CONFIG_NET_CORE=y +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +CONFIG_MII=y +# CONFIG_NET_TEAM is not set +# CONFIG_MACVLAN is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_TUN is not set +# CONFIG_VETH is not set + +# +# CAIF transport drivers +# + +# +# Distributed Switch Architecture drivers +# +# CONFIG_NET_DSA_MV88E6XXX is not set +# CONFIG_NET_DSA_MV88E6060 is not set +# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_MV88E6131 is not set +# CONFIG_NET_DSA_MV88E6123_61_65 is not set +CONFIG_ETHERNET=y +# CONFIG_NET_CADENCE is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_CALXEDA_XGMAC is not set +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_DM9000 is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_FARADAY is not set +# CONFIG_NET_VENDOR_INTEL is not set +CONFIG_NET_VENDOR_MICREL=y +CONFIG_KS8851=y +# CONFIG_KS8851_MLL is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_ETHOC is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_WIZNET is not set +# CONFIG_PHYLIB is not set +# CONFIG_MICREL_KS8995MA is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_WLAN is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_ISDN is not set # # Input device support @@ -488,6 +601,7 @@ CONFIG_SCSI_MOD=y # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_NONSTANDARD=y # CONFIG_N_HDLC is not set +# CONFIG_N_GSM is not set # CONFIG_TRACE_SINK is not set # CONFIG_DEVKMEM is not set # CONFIG_STALDRV is not set @@ -508,7 +622,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_TIMBERDALE is not set # CONFIG_SERIAL_ALTERA_JTAGUART is not set # CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_IFX6X60 is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set CONFIG_SERIAL_EFM32_UART=y CONFIG_SERIAL_EFM32_UART_CONSOLE=y # CONFIG_SERIAL_ARC is not set @@ -530,8 +644,6 @@ CONFIG_SPI_MASTER=y # CONFIG_SPI_ALTERA is not set CONFIG_SPI_BITBANG=y CONFIG_SPI_EFM32=y -# CONFIG_SPI_GPIO is not set -# CONFIG_SPI_OC_TINY is not set # CONFIG_SPI_PXA2XX_PCI is not set # CONFIG_SPI_XILINX is not set # CONFIG_SPI_DESIGNWARE is not set @@ -561,87 +673,11 @@ CONFIG_SPI_EFM32=y # Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. # # CONFIG_PTP_1588_CLOCK_PCH is not set -CONFIG_PINCTRL=y - -# -# Pin controllers -# -CONFIG_PINMUX=y -CONFIG_PINCONF=y -# CONFIG_DEBUG_PINCTRL is not set -CONFIG_PINCTRL_EFM32=y -# CONFIG_PINCTRL_EXYNOS5440 is not set CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y -CONFIG_GPIOLIB=y -# CONFIG_DEBUG_GPIO is not set -CONFIG_GPIO_SYSFS=y - -# -# Memory mapped GPIO drivers: -# -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_EM is not set -# CONFIG_GPIO_TS5500 is not set - -# -# I2C GPIO expanders: -# - -# -# PCI GPIO expanders: -# - -# -# SPI GPIO expanders: -# -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MCP23S08 is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_74X164 is not set - -# -# AC97 GPIO expanders: -# - -# -# MODULbus GPIO expanders: -# - -# -# USB GPIO expanders: -# # CONFIG_W1 is not set # CONFIG_POWER_SUPPLY is not set # CONFIG_POWER_AVS is not set -CONFIG_HWMON=y -# CONFIG_HWMON_VID is not set -# CONFIG_HWMON_DEBUG_CHIP is not set - -# -# Native drivers -# -# CONFIG_SENSORS_AD7314 is not set -# CONFIG_SENSORS_ADCXX is not set -CONFIG_SENSORS_EFM32_ADC=y -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_GPIO_FAN is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_LM70 is not set -# CONFIG_SENSORS_MAX1111 is not set -# CONFIG_SENSORS_MAX197 is not set -# CONFIG_SENSORS_NTC_THERMISTOR is not set -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_SHT15 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_SCH56XX_COMMON is not set -# CONFIG_SENSORS_ADS7871 is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_HWMON is not set # CONFIG_THERMAL is not set # CONFIG_WATCHDOG is not set CONFIG_SSB_POSSIBLE=y @@ -660,13 +696,10 @@ CONFIG_BCMA_POSSIBLE=y # # Multifunction device drivers # -# CONFIG_MFD_CORE is not set +CONFIG_MFD_CORE=y # CONFIG_MFD_SM501 is not set -# CONFIG_MFD_ASIC3 is not set # CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_HTC_EGPIO is not set # CONFIG_HTC_PASIC3 is not set -# CONFIG_MFD_TPS65912_SPI is not set # CONFIG_MFD_STMPE is not set # CONFIG_MFD_TMIO is not set # CONFIG_MFD_T7L66XB is not set @@ -678,6 +711,8 @@ CONFIG_BCMA_POSSIBLE=y # CONFIG_MFD_MC13XXX_SPI is not set # CONFIG_ABX500_CORE is not set # CONFIG_EZX_PCAP is not set +# CONFIG_MFD_SYSCON is not set +CONFIG_MFD_EFM32BOARD=y # CONFIG_REGULATOR is not set # CONFIG_MEDIA_SUPPORT is not set @@ -780,7 +815,8 @@ CONFIG_CLKSRC_MMIO=y # # Pseudo filesystems # -# CONFIG_PROC_FS is not set +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y CONFIG_SYSFS=y # CONFIG_HUGETLB_PAGE is not set # CONFIG_CONFIGFS_FS is not set @@ -811,6 +847,7 @@ CONFIG_ROMFS_ON_MTD=y # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # CONFIG_F2FS_FS is not set +# CONFIG_NETWORK_FILESYSTEMS is not set # CONFIG_NLS is not set # @@ -834,6 +871,9 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_PANIC_ON_OOPS is not set CONFIG_PANIC_ON_OOPS_VALUE=0 # CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set # CONFIG_DEBUG_OBJECTS is not set # CONFIG_SLUB_STATS is not set CONFIG_HAVE_DEBUG_KMEMLEAK=y @@ -849,8 +889,7 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_BUGVERBOSE is not set -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_INFO_REDUCED is not set +# CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_NOMMU_REGIONS is not set # CONFIG_DEBUG_WRITECOUNT is not set @@ -868,6 +907,7 @@ CONFIG_DEBUG_INFO=y # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set # CONFIG_NOTIFIER_ERROR_INJECTION is not set # CONFIG_FAULT_INJECTION is not set +# CONFIG_LATENCYTOP is not set # CONFIG_DEBUG_PAGEALLOC is not set CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_C_RECORDMCOUNT=y @@ -882,6 +922,11 @@ CONFIG_HAVE_ARCH_KGDB=y CONFIG_ARM_UNWIND=y # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_LL is not set +# CONFIG_DEBUG_EFM32_USART1 is not set +# CONFIG_DEBUG_EFM32_UART1 is not set +# CONFIG_DEBUG_LL_UART_NONE is not set +# CONFIG_DEBUG_ICEDCC is not set +# CONFIG_DEBUG_SEMIHOSTING is not set CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" # @@ -922,6 +967,8 @@ CONFIG_CRC32_SLICEBY8=y # CONFIG_XZ_DEC_BCJ is not set CONFIG_HAS_IOMEM=y CONFIG_HAS_DMA=y +CONFIG_DQL=y +CONFIG_NLATTR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y # CONFIG_AVERAGE is not set diff --git a/patches/linux-3.8-rc5/0012-spi-new-controller-driver-for-efm32-SoCs.patch b/patches/linux-3.8-rc5/0012-spi-new-controller-driver-for-efm32-SoCs.patch index e5b2579..9b11e21 100644 --- a/patches/linux-3.8-rc5/0012-spi-new-controller-driver-for-efm32-SoCs.patch +++ b/patches/linux-3.8-rc5/0012-spi-new-controller-driver-for-efm32-SoCs.patch @@ -12,8 +12,8 @@ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/spi/Kconfig | 5 + drivers/spi/Makefile | 1 + - drivers/spi/spi-efm32.c | 458 +++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 464 insertions(+) + drivers/spi/spi-efm32.c | 456 +++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 462 insertions(+) create mode 100644 drivers/spi/spi-efm32.c diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig @@ -46,10 +46,10 @@ index 64e970b..d115638 100644 obj-$(CONFIG_SPI_FSL_LIB) += spi-fsl-lib.o diff --git a/drivers/spi/spi-efm32.c b/drivers/spi/spi-efm32.c new file mode 100644 -index 0000000..96b2db4 +index 0000000..5964d01 --- /dev/null +++ b/drivers/spi/spi-efm32.c -@@ -0,0 +1,458 @@ +@@ -0,0 +1,456 @@ +/* + * Copyright (C) 2012 Uwe Kleine-Koenig for Pengutronix + * @@ -148,31 +148,11 @@ index 0000000..96b2db4 + return readl_relaxed(ddata->base + offset); +} + -+static const struct gpio usart1_gpios[] = { -+ { -+ .gpio = 48, -+ .flags = GPIOF_OUT_INIT_LOW, -+ .label = DRIVER_NAME, -+ }, { -+ .gpio = 49, -+ .flags = GPIOF_IN, -+ .label = DRIVER_NAME, -+ }, { -+ .gpio = 50, -+ .flags = GPIOF_OUT_INIT_LOW, -+ .label = DRIVER_NAME, -+ }, { -+ .gpio = 51, -+ .flags = GPIOF_OUT_INIT_HIGH, -+ .label = DRIVER_NAME, -+ }, -+}; -+ +static int efm32_spi_setup(struct spi_device *spi) +{ + pr_debug("%s\n", __func__); + -+ return gpio_request_array(usart1_gpios, ARRAY_SIZE(usart1_gpios)); ++ return 0; + +} + @@ -183,10 +163,16 @@ index 0000000..96b2db4 + +static void efm32_spi_chipselect(struct spi_device *spi, int is_on) +{ -+ int gpio = /* XXX */51; + int value = !(spi->mode & SPI_CS_HIGH) == !(is_on == BITBANG_CS_ACTIVE); ++ void __iomem *addr; + -+ gpio_set_value(gpio, value); ++ /* XXX */ ++ if (!value) ++ addr = (void *)0x40006080; ++ else ++ addr = (void *)0x4000607c; ++ ++ writel(0x8, addr); +} + +static int efm32_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) @@ -378,6 +364,8 @@ index 0000000..96b2db4 + } + platform_set_drvdata(pdev, master); + ++ master->dev.of_node = pdev->dev.of_node; ++ + master->bus_num = pdev->id; + master->num_chipselect = 1; + master->setup = efm32_spi_setup; @@ -493,6 +481,15 @@ index 0000000..96b2db4 + return 0; +} + ++static const struct of_device_id efm32_spi_dt_ids[] = { ++ { ++ .compatible = "efm32,spi", ++ }, { ++ /* sentinel */ ++ } ++}; ++MODULE_DEVICE_TABLE(of, efm32_uart_dt_ids); ++ +static struct platform_driver efm32_spi_driver = { + .probe = efm32_spi_probe, + .remove = efm32_spi_remove, @@ -500,6 +497,7 @@ index 0000000..96b2db4 + .driver = { + .name = DRIVER_NAME, + .owner = THIS_MODULE, ++ .of_match_table = efm32_spi_dt_ids, + }, +}; +module_platform_driver(efm32_spi_driver); diff --git a/patches/linux-3.8-rc5/0013-Cortex-M3-Add-NVIC-support.patch b/patches/linux-3.8-rc5/0013-Cortex-M3-Add-NVIC-support.patch index ffefcd2..afbb98d 100644 --- a/patches/linux-3.8-rc5/0013-Cortex-M3-Add-NVIC-support.patch +++ b/patches/linux-3.8-rc5/0013-Cortex-M3-Add-NVIC-support.patch @@ -50,7 +50,7 @@ index e8a4e58..68031d0 100644 obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o diff --git a/arch/arm/common/nvic.c b/arch/arm/common/nvic.c new file mode 100644 -index 0000000..beffbef +index 0000000..bac0207 --- /dev/null +++ b/arch/arm/common/nvic.c @@ -0,0 +1,140 @@ @@ -73,6 +73,7 @@ index 0000000..beffbef +#include <linux/export.h> +#include <linux/err.h> +#include <linux/of.h> ++#include <linux/of_address.h> +#include <linux/irqdomain.h> + +#include <asm/irq.h> @@ -142,8 +143,7 @@ index 0000000..beffbef + if (IS_ERR_VALUE(irq_base)) { + WARN(1, "Cannot allocate irq_descs\n"); + irq_base = 16; -+ } else -+ printk("%s: irq_base = %u\n", __func__, irq_base); ++ } + nvic_data.domain = irq_domain_add_legacy(node, irqs - 16, irq_base, 0, + &irq_domain_simple_ops, NULL); + if (WARN_ON(!nvic_data.domain)) @@ -196,7 +196,7 @@ index 0000000..beffbef +#endif diff --git a/arch/arm/include/asm/hardware/nvic.h b/arch/arm/include/asm/hardware/nvic.h new file mode 100644 -index 0000000..d072dbc +index 0000000..dc9ec11 --- /dev/null +++ b/arch/arm/include/asm/hardware/nvic.h @@ -0,0 +1,20 @@ @@ -217,6 +217,6 @@ index 0000000..d072dbc +void nvic_init(void); + +struct device_node; -+void nvic_of_init(struct device_node *node, struct device_node *parent); ++int nvic_of_init(struct device_node *node, struct device_node *parent); + +#endif diff --git a/patches/linux-3.8-rc5/0015-ARM-new-platform-for-Energy-Micro-s-EFM32-Cortex-M3-.patch b/patches/linux-3.8-rc5/0015-ARM-new-platform-for-Energy-Micro-s-EFM32-Cortex-M3-.patch index 7755360..304e80a 100644 --- a/patches/linux-3.8-rc5/0015-ARM-new-platform-for-Energy-Micro-s-EFM32-Cortex-M3-.patch +++ b/patches/linux-3.8-rc5/0015-ARM-new-platform-for-Energy-Micro-s-EFM32-Cortex-M3-.patch @@ -10,13 +10,13 @@ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> arch/arm/Kconfig | 13 +- arch/arm/Kconfig.debug | 16 +++ arch/arm/Makefile | 1 + - arch/arm/boot/dts/efm32gg-dk3750.dts | 41 ++++++ + arch/arm/boot/dts/efm32gg-dk3750.dts | 69 ++++++++++ arch/arm/mach-efm32/Makefile | 3 + arch/arm/mach-efm32/Makefile.boot | 1 + arch/arm/mach-efm32/clk.c | 38 ++++++ arch/arm/mach-efm32/cmu.h | 11 ++ arch/arm/mach-efm32/common.h | 1 + - arch/arm/mach-efm32/dtmachine.c | 47 +++++++ + arch/arm/mach-efm32/dtmachine.c | 43 ++++++ arch/arm/mach-efm32/include/mach/debug-macro.S | 48 +++++++ arch/arm/mach-efm32/include/mach/entry-macro.S | 12 ++ arch/arm/mach-efm32/include/mach/io.h | 6 + @@ -24,7 +24,7 @@ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> arch/arm/mach-efm32/include/mach/system.h | 18 +++ arch/arm/mach-efm32/include/mach/timex.h | 7 + arch/arm/mach-efm32/time.c | 170 ++++++++++++++++++++++++ - 17 files changed, 438 insertions(+), 1 deletion(-) + 17 files changed, 462 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/efm32gg-dk3750.dts create mode 100644 arch/arm/mach-efm32/Makefile create mode 100644 arch/arm/mach-efm32/Makefile.boot @@ -112,10 +112,10 @@ index 69a5955..374e25a 100644 machine-$(CONFIG_ARCH_H720X) += h720x diff --git a/arch/arm/boot/dts/efm32gg-dk3750.dts b/arch/arm/boot/dts/efm32gg-dk3750.dts new file mode 100644 -index 0000000..13fcc0c +index 0000000..3fc2369 --- /dev/null +++ b/arch/arm/boot/dts/efm32gg-dk3750.dts -@@ -0,0 +1,41 @@ +@@ -0,0 +1,69 @@ +/dts-v1/; +/include/ "skeleton.dtsi" + @@ -124,7 +124,7 @@ index 0000000..13fcc0c + compatible = "efm32,dk3750"; + + aliases { -+ serial1 = &uart1; ++ serial4 = &uart4; + }; + + nvic: nv-interrupt-controller@0xe0000000 { @@ -135,11 +135,11 @@ index 0000000..13fcc0c + }; + + chosen { -+ bootargs = "console=ttyefm1,115200 init=/linuxrc ignore_loglevel ihash_entries=64 dhash_entries=64"; ++ bootargs = "console=ttyefm4,115200 init=/linuxrc ignore_loglevel ihash_entries=64 dhash_entries=64 earlyprintk uclinux.physaddr=0x8c000000 root=/dev/mtdblock0"; + }; + + memory { -+ reg = <0x80000000 0x100000>; ++ reg = <0x88000000 0x400000>; + }; + + soc { @@ -149,11 +149,39 @@ index 0000000..13fcc0c + interrupt-parent = <&nvic>; + ranges; + -+ uart1: uart@0x4000c400 { /* USART1 */ -+ compatible = "efm32,uart"; ++ spi@0x4000c400 { /* USART1 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "efm32,spi"; + reg = <0x4000c400 0x400>; + interrupts = <15>; + status = "ok"; ++ ++ ks8851@0 { ++ compatible = "ks8851"; ++ spi-max-frequency = <6000000>; ++ reg = <0>; ++ interrupt-parent = <&boardfpga>; ++ interrupts = <4>; ++ status = "ok"; ++ }; ++ }; ++ ++ uart4: uart@0x4000e400 { /* UART1 */ ++ compatible = "efm32,uart"; ++ reg = <0x4000e400 0x400>; ++ interrupts = <22>; ++ location = <2>; ++ status = "ok"; ++ }; ++ ++ boardfpga: boardfpga@0x80000000 { ++ compatible = "efm32board"; ++ reg = <0x80000000 0x400>; ++ /* this is a lie, gpio_even = 1 */ ++ interrupts = <1>; ++ interrupt-controller; ++ #interrupt-cells = <1>; + }; + }; +}; @@ -243,10 +271,10 @@ index 0000000..d2ff797 +extern struct sys_timer efm32_timer; diff --git a/arch/arm/mach-efm32/dtmachine.c b/arch/arm/mach-efm32/dtmachine.c new file mode 100644 -index 0000000..42d091c +index 0000000..a64c4a4 --- /dev/null +++ b/arch/arm/mach-efm32/dtmachine.c -@@ -0,0 +1,47 @@ +@@ -0,0 +1,43 @@ +#include <linux/kernel.h> +#include <linux/pinctrl/machine.h> +#include <linux/irqdomain.h> @@ -258,28 +286,24 @@ index 0000000..42d091c +#include <asm/mach/time.h> + +#include "common.h" -+ -+static void __init efm32_nvic_add_irq_domain(struct device_node *np, -+ struct device_node *interrupt_parent) -+{ -+ irq_domain_add_simple(np, 0); -+} ++#include "devices.h" + +static const struct of_device_id efm32_irq_match[] __initconst = { + { + .compatible = "arm,cortex-m3-nvic", -+ .data = efm32_nvic_add_irq_domain, ++ .data = nvic_of_init, + }, { + /* sentinel */ + } +}; + -+static void __init efm32_init(void) ++static void __init efm32_init_irq(void) +{ -+ int ret; -+ + of_irq_init(efm32_irq_match); ++} + ++static void __init efm32_init(void) ++{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + @@ -289,7 +313,7 @@ index 0000000..42d091c +}; + +DT_MACHINE_START(EFM32DT, "EFM32 (Device Tree Support)") -+ .init_irq = nvic_init, ++ .init_irq = efm32_init_irq, + .timer = &efm32_timer, + .init_machine = efm32_init, + .dt_compat = efm32gg_compat, @@ -429,7 +453,7 @@ index 0000000..b408dce +#endif /* __MACH_TIMEX_H__ */ diff --git a/arch/arm/mach-efm32/time.c b/arch/arm/mach-efm32/time.c new file mode 100644 -index 0000000..c8038b1 +index 0000000..f91a3ef --- /dev/null +++ b/arch/arm/mach-efm32/time.c @@ -0,0 +1,170 @@ @@ -472,7 +496,7 @@ index 0000000..c8038b1 + +#define TIMER_CLOCKSOURCE 1 +#define TIMER_CLOCKEVENT 2 -+#define IRQ_CLOCKEVENT 13 ++#define IRQ_CLOCKEVENT NVIC_IRQ(13) + +static void efm32_timer_write(unsigned timerno, u32 val, unsigned offset) +{ diff --git a/patches/linux-3.8-rc5/0016-ARM-efm32-add-support-for-non-dt-builds-and-add-more.patch b/patches/linux-3.8-rc5/0016-ARM-efm32-add-support-for-non-dt-builds-and-add-more.patch index 3d8ca1e..6d9420b 100644 --- a/patches/linux-3.8-rc5/0016-ARM-efm32-add-support-for-non-dt-builds-and-add-more.patch +++ b/patches/linux-3.8-rc5/0016-ARM-efm32-add-support-for-non-dt-builds-and-add-more.patch @@ -12,30 +12,27 @@ ready for mainline. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- - arch/arm/Kconfig | 5 + - arch/arm/Kconfig-nommu | 6 + - arch/arm/mach-efm32/Kconfig | 5 + - arch/arm/mach-efm32/Makefile | 4 +- - arch/arm/mach-efm32/common.c | 207 +++++++++++++++++++++ - arch/arm/mach-efm32/common.h | 9 + - arch/arm/mach-efm32/devices.h | 20 ++ - arch/arm/mach-efm32/devices/Makefile | 3 + - arch/arm/mach-efm32/devices/pdev-efm32-adc.c | 18 ++ - arch/arm/mach-efm32/devices/pdev-efm32-pinctrl.c | 24 +++ - arch/arm/mach-efm32/devices/pdev-efm32-uart.c | 103 +++++++++++ - arch/arm/mach-efm32/dtmachine.c | 18 ++ - arch/arm/mach-efm32/include/mach/gpio.h | 1 + - arch/arm/mach-efm32/machines/Kconfig | 11 ++ - arch/arm/mach-efm32/machines/Makefile | 1 + - arch/arm/mach-efm32/machines/efm32gg_dk3750.c | 216 ++++++++++++++++++++++ - arch/arm/mach-efm32/time.c | 2 +- - 17 files changed, 651 insertions(+), 2 deletions(-) + arch/arm/Kconfig | 2 + + arch/arm/Kconfig-nommu | 4 + + arch/arm/mach-efm32/Kconfig | 8 + + arch/arm/mach-efm32/Makefile | 4 +- + arch/arm/mach-efm32/common.c | 207 +++++++++++++++++++++++++ + arch/arm/mach-efm32/common.h | 9 ++ + arch/arm/mach-efm32/devices.h | 17 ++ + arch/arm/mach-efm32/devices/Makefile | 2 + + arch/arm/mach-efm32/devices/pdev-efm32-adc.c | 18 +++ + arch/arm/mach-efm32/devices/pdev-efm32-uart.c | 103 ++++++++++++ + arch/arm/mach-efm32/dtmachine.c | 7 + + arch/arm/mach-efm32/include/mach/gpio.h | 1 + + arch/arm/mach-efm32/machines/Kconfig | 4 + + arch/arm/mach-efm32/machines/Makefile | 1 + + arch/arm/mach-efm32/machines/efm32gg_dk3750.c | 95 ++++++++++++ + 15 files changed, 481 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-efm32/Kconfig create mode 100644 arch/arm/mach-efm32/common.c create mode 100644 arch/arm/mach-efm32/devices.h create mode 100644 arch/arm/mach-efm32/devices/Makefile create mode 100644 arch/arm/mach-efm32/devices/pdev-efm32-adc.c - create mode 100644 arch/arm/mach-efm32/devices/pdev-efm32-pinctrl.c create mode 100644 arch/arm/mach-efm32/devices/pdev-efm32-uart.c create mode 100644 arch/arm/mach-efm32/include/mach/gpio.h create mode 100644 arch/arm/mach-efm32/machines/Kconfig @@ -43,23 +40,10 @@ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> create mode 100644 arch/arm/mach-efm32/machines/efm32gg_dk3750.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 029f074..814886d 100644 +index 029f074..46a8762 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -425,9 +425,12 @@ config ARCH_EFM32 - select CLKSRC_MMIO - select CPU_V7M - select GENERIC_CLOCKEVENTS -+ select GENERIC_GPIO -+ select ARCH_REQUIRE_GPIOLIB - select HAVE_CLK - select NO_DMA - select NO_IOPORT -+ select PINCTRL - - config ARCH_EP93XX - bool "EP93xx-based" -@@ -1041,6 +1044,8 @@ source "arch/arm/mach-davinci/Kconfig" +@@ -1041,6 +1041,8 @@ source "arch/arm/mach-davinci/Kconfig" source "arch/arm/mach-dove/Kconfig" @@ -69,20 +53,18 @@ index 029f074..814886d 100644 source "arch/arm/mach-footbridge/Kconfig" diff --git a/arch/arm/Kconfig-nommu b/arch/arm/Kconfig-nommu -index c859495..4340f4f 100644 +index c859495..fcbb5c4 100644 --- a/arch/arm/Kconfig-nommu +++ b/arch/arm/Kconfig-nommu -@@ -11,18 +11,24 @@ config SET_MEM_PARAM +@@ -11,18 +11,22 @@ config SET_MEM_PARAM config DRAM_BASE hex '(S)DRAM Base Address' if SET_MEM_PARAM -+ default 0x80000000 if EFM32GG_DK3750_FPGA + default 0x88000000 if MACH_EFM32GG_DK3750 default 0x00800000 config DRAM_SIZE hex '(S)DRAM SIZE' if SET_MEM_PARAM -+ default 0x00100000 if EFM32GG_DK3750_FPGA + default 0x00400000 if MACH_EFM32GG_DK3750 default 0x00800000 @@ -99,17 +81,20 @@ index c859495..4340f4f 100644 config PROCESSOR_ID diff --git a/arch/arm/mach-efm32/Kconfig b/arch/arm/mach-efm32/Kconfig new file mode 100644 -index 0000000..e82747f +index 0000000..61a7231 --- /dev/null +++ b/arch/arm/mach-efm32/Kconfig -@@ -0,0 +1,5 @@ +@@ -0,0 +1,8 @@ +if ARCH_EFM32 + ++config EFM32_NONDT ++ bool ++ +source "arch/arm/mach-efm32/machines/Kconfig" + +endif diff --git a/arch/arm/mach-efm32/Makefile b/arch/arm/mach-efm32/Makefile -index 10a3426..f3a6932 100644 +index 10a3426..ba4d6ee 100644 --- a/arch/arm/mach-efm32/Makefile +++ b/arch/arm/mach-efm32/Makefile @@ -1,3 +1,5 @@ @@ -118,7 +103,7 @@ index 10a3426..f3a6932 100644 obj-$(CONFIG_OF) += dtmachine.o + -+obj-y += machines/ devices/ ++obj-$(CONFIG_EFM32_NONDT) += machines/ devices/ diff --git a/arch/arm/mach-efm32/common.c b/arch/arm/mach-efm32/common.c new file mode 100644 index 0000000..cb073ba @@ -349,19 +334,16 @@ index d2ff797..2a52d17 100644 +void efm32_print_reset_cause(void); diff --git a/arch/arm/mach-efm32/devices.h b/arch/arm/mach-efm32/devices.h new file mode 100644 -index 0000000..6459921 +index 0000000..785f070 --- /dev/null +++ b/arch/arm/mach-efm32/devices.h -@@ -0,0 +1,20 @@ +@@ -0,0 +1,17 @@ +#include <linux/platform_device.h> + +extern const struct platform_device_info efm32_adc_devinfo[]; +#define efm32_add_efm32_adc() \ + platform_device_register_full(&efm32_adc_devinfo[0]) + -+#include <linux/platform_data/efm32-pinctrl.h> -+void efm32_add_efm32_pinctrl(const struct efm32_pinctrl_pdata *); -+ +extern const struct platform_device_info efm32_spi_devinfo[]; +#define efm32_add_efm32_spi(id) \ + platform_device_register_full(&efm32_spi_devinfo[id]) @@ -375,12 +357,11 @@ index 0000000..6459921 + _efm32gg_add_efm32_uart(&efm32_uart_devinfo[id + 3], loc) diff --git a/arch/arm/mach-efm32/devices/Makefile b/arch/arm/mach-efm32/devices/Makefile new file mode 100644 -index 0000000..1492b3f +index 0000000..d3a4495 --- /dev/null +++ b/arch/arm/mach-efm32/devices/Makefile -@@ -0,0 +1,3 @@ +@@ -0,0 +1,2 @@ +obj-y += pdev-efm32-adc.o -+obj-y += pdev-efm32-pinctrl.o +obj-y += pdev-efm32-uart.o diff --git a/arch/arm/mach-efm32/devices/pdev-efm32-adc.c b/arch/arm/mach-efm32/devices/pdev-efm32-adc.c new file mode 100644 @@ -406,36 +387,6 @@ index 0000000..be8154b + .num_res = ARRAY_SIZE(efm32_adc0_resources), + }, +}; -diff --git a/arch/arm/mach-efm32/devices/pdev-efm32-pinctrl.c b/arch/arm/mach-efm32/devices/pdev-efm32-pinctrl.c -new file mode 100644 -index 0000000..4a878f1 ---- /dev/null -+++ b/arch/arm/mach-efm32/devices/pdev-efm32-pinctrl.c -@@ -0,0 +1,24 @@ -+#include <linux/ioport.h> -+#include <linux/platform_device.h> -+#include <linux/platform_data/efm32-pinctrl.h> -+#include <linux/pinctrl/pinctrl.h> -+ -+#include "../devices.h" -+ -+static const struct resource efm32_pinctrl_resources[] __initconst = { -+ DEFINE_RES_MEM(0x40006000, 0x1000), -+}; -+ -+static struct platform_device_info efm32_pinctrl_devinfo __initdata = { -+ .name = "efm32-pinctrl", -+ .id = -1, -+ .res = efm32_pinctrl_resources, -+ .num_res = ARRAY_SIZE(efm32_pinctrl_resources), -+ .size_data = sizeof(struct efm32_pinctrl_pdata), -+}; -+ -+void __init efm32_add_efm32_pinctrl(const struct efm32_pinctrl_pdata *pdata) -+{ -+ efm32_pinctrl_devinfo.data = pdata; -+ platform_device_register_full(&efm32_pinctrl_devinfo); -+} diff --git a/arch/arm/mach-efm32/devices/pdev-efm32-uart.c b/arch/arm/mach-efm32/devices/pdev-efm32-uart.c new file mode 100644 index 0000000..8527aeb @@ -546,38 +497,20 @@ index 0000000..8527aeb + return platform_device_register_full(&_devinfo); +} diff --git a/arch/arm/mach-efm32/dtmachine.c b/arch/arm/mach-efm32/dtmachine.c -index 42d091c..ca6585e 100644 +index a64c4a4..d416abe 100644 --- a/arch/arm/mach-efm32/dtmachine.c +++ b/arch/arm/mach-efm32/dtmachine.c -@@ -9,6 +9,17 @@ - #include <asm/mach/time.h> - - #include "common.h" -+#include "devices.h" -+ -+static const struct pinmux_map efm32_pinmux[] = { -+ { -+ .name = "us1@0", -+ .ctrl_dev_name = "pinctrl.0", -+ .function = "us1", -+ .group = "us1_loc0", -+ .hog_on_boot = 1, -+ }, -+}; - - static void __init efm32_nvic_add_irq_domain(struct device_node *np, - struct device_node *interrupt_parent) -@@ -32,6 +43,13 @@ static void __init efm32_init(void) - of_irq_init(efm32_irq_match); - +@@ -28,6 +28,13 @@ static void __init efm32_init_irq(void) + static void __init efm32_init(void) + { of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + + /* + * Pinmuxing isn't specified in the device tree. Probably it's too heavy + * considering that there is only 4 MiB of RAM + */ -+ efm32gg990_add_efm32_pinctrl(); -+ pinmux_register_mappings(efm32_pinmux, ARRAY_SIZE(efm32_pinmux)); ++ //efm32gg990_add_efm32_pinctrl(); ++ //pinmux_register_mappings(efm32_pinmux, ARRAY_SIZE(efm32_pinmux)); } static const char *const efm32gg_compat[] __initconst = { @@ -590,21 +523,14 @@ index 0000000..40a8c17 +/* empty */ diff --git a/arch/arm/mach-efm32/machines/Kconfig b/arch/arm/mach-efm32/machines/Kconfig new file mode 100644 -index 0000000..f060c08 +index 0000000..c8095cc --- /dev/null +++ b/arch/arm/mach-efm32/machines/Kconfig -@@ -0,0 +1,11 @@ +@@ -0,0 +1,4 @@ +config MACH_EFM32GG_DK3750 + bool "EFM32GG_DK3750" ++ select EFM32_NONDT + default y -+ -+config EFM32GG_DK3750_FPGA -+ bool "pre-silicon Gecko" -+ depends on MACH_EFM32GG_DK3750 -+ help -+ This option enables handling for the FPGA version of the Giant Gecko. -+ Namely: -+ - only one MiB of external DRAM diff --git a/arch/arm/mach-efm32/machines/Makefile b/arch/arm/mach-efm32/machines/Makefile new file mode 100644 index 0000000..d76f15d @@ -614,10 +540,10 @@ index 0000000..d76f15d +obj-$(CONFIG_MACH_EFM32GG_DK3750) += efm32gg_dk3750.o diff --git a/arch/arm/mach-efm32/machines/efm32gg_dk3750.c b/arch/arm/mach-efm32/machines/efm32gg_dk3750.c new file mode 100644 -index 0000000..cdc7506 +index 0000000..631d04a --- /dev/null +++ b/arch/arm/mach-efm32/machines/efm32gg_dk3750.c -@@ -0,0 +1,216 @@ +@@ -0,0 +1,95 @@ +/* + * Copyright (C) 2012 Uwe Kleine-Koenig for Pengutronix + * @@ -627,12 +553,10 @@ index 0000000..cdc7506 + */ +#include <linux/kernel.h> +#include <linux/init.h> -+#include <linux/pinctrl/machine.h> +#include <linux/spi/spi.h> +#include <linux/spi/spi_gpio.h> +#include <linux/spi/mmc_spi.h> +#include <linux/gpio.h> -+#include <linux/platform_data/efm32-pinctrl.h> + +#include <asm/hardware/nvic.h> +#include <asm/mach/arch.h> @@ -659,35 +583,6 @@ index 0000000..cdc7506 + .size_data = sizeof(efm32gg_dk3750_spi_gpio_us0_pdata), +}; + -+static struct mmc_spi_platform_data efm32gg_dk3750_mmc_spi_pdata = { -+}; -+ -+static const struct spi_board_info -+ efm32gg_dk3750_spi_us0_board_info[] __initconst = { -+ { -+ .modalias = "mmc_spi", -+ .bus_num = 0, -+ .chip_select = 0, -+ .platform_data = &efm32gg_dk3750_mmc_spi_pdata, -+ .controller_data = (void *)68, /* PE4 */ -+ .mode = SPI_MODE_0, -+ }, -+}; -+ -+static void __init efm32gg_dk3750_prepare_microsd(void) -+{ -+ /* enable microSD mux, XXX: pretty please */ -+ { -+ u16 perfControl = readw((void __iomem *)0x80000018); -+ perfControl |= 1; /* Micro-SD SPI enable */ -+ writew(perfControl, (void __iomem *)0x80000018); -+ } -+ -+ spi_register_board_info(efm32gg_dk3750_spi_us0_board_info, -+ ARRAY_SIZE(efm32gg_dk3750_spi_us0_board_info)); -+ platform_device_register_full(&efm32gg_dk3750_spi_gpio_us0_devinfo); -+} -+ +static struct spi_board_info + efm32gg_dk3750_spi_us1_board_info[] __initdata = { + { @@ -702,111 +597,28 @@ index 0000000..cdc7506 + +static void __init efm32gg_dk3750_prepare_ethernet(void) +{ -+ /* enable ethernet mux, XXX: pretty please */ -+ { -+ u16 perfControl = readw((void __iomem *)0x80000018); -+ -+ writew(1 /* BC_SPI_DEMUX_SLAVE_ETHERNET */, (void __iomem *)0x8000001a); -+ perfControl |= 3 << 8; /* I2S/ETH/TFT SPI enable + I2S/ETH mux select */ -+ writew(perfControl, (void __iomem *)0x80000018); -+ } -+ ++#if 0 ++ /* this depends on a hardware modification */ + gpio_request_one(7, GPIOF_DIR_IN, "eth-irq"); -+ efm32gg_dk3750_spi_us1_board_info[0].irq = gpio_to_irq(7); ++ efm32gg_dk3750_spi_us1_board_info[0].irq = 7; //gpio_to_irq(7); ++#else ++ efm32gg_dk3750_spi_us1_board_info[0].irq = 4; ++#endif + + spi_register_board_info(efm32gg_dk3750_spi_us1_board_info, + ARRAY_SIZE(efm32gg_dk3750_spi_us1_board_info)); + efm32_add_efm32_spi(1); +} + -+static irqreturn_t c9wakeup_handler(int irq, void *null) -+{ -+ pr_info("tralala\n"); -+ return IRQ_HANDLED; -+} -+ -+static int __init efm32gg_dk3750_prepare_c9wakeup(void) -+{ -+ int ret; -+ ret = gpio_request(41, "c9wakeup"); -+ if (ret) { -+ pr_warn("failed to request gpio41 (%d)\n", ret); -+ goto err_gpio_request; -+ } -+ -+ /* XXX: filter */ -+ ret = gpio_direction_input(41); -+ if (ret) { -+ pr_warn("failed to set gpio41 to input\n"); -+ goto err_direction_input; -+ } ++static const struct resource efm32gg_dk3750_board_res[] __initconst = { ++ { .start = 0x80000000, .end = 0x80000400, .flags = IORESOURCE_MEM, }, ++ { .start = 1, .flags = IORESOURCE_IRQ, }, ++}; + -+ ret = gpio_to_irq(41); -+ if (ret < 0) { -+ pr_warn("gpio41 doesn't map to an irq (%d)\n", ret); -+ goto err_to_irq; -+ } -+ pr_info("using irq %d\n", ret); -+ -+ ret = request_irq(ret, c9wakeup_handler, IRQF_TRIGGER_FALLING, "c9wakup", NULL); -+ if (ret) { -+ pr_warn("failed to request irq for gpio41 (%d)", ret); -+err_gpio_request: -+err_direction_input: -+err_to_irq: -+ gpio_free(41); -+ } -+ return ret; -+} -+module_init(efm32gg_dk3750_prepare_c9wakeup); -+ -+const static struct efm32_pinctrl_pdata efm32gg_dk3750_pinctrl_pdata __initconst = { -+ .pindef = { -+ [7] = { /* PA7, eth irq */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOIN, -+ .mode_gpio_in = EFM32_MODE_INPUT, -+ }, -+ [14] = { /* GPIO for EM demo */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOOUT, -+ .mode_gpio_out = EFM32_MODE_PUSHPULL, -+ }, -+ [41] = { /* PC9, wakeup */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOIN, -+ .mode_gpio_in = EFM32_MODE_INPUTPULLUPFILTER, -+ }, -+ [48] = { /* PD0, ETH_MOSI */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOOUT, -+ .mode_gpio_out = EFM32_MODE_PUSHPULL, -+ }, -+ [49] = { /* PD1, ETH_MISO */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOIN, -+ .mode_gpio_in = EFM32_MODE_INPUT, -+ }, -+ [50] = { /* PD2, ETH_SCLK */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOOUT, -+ .mode_gpio_out = EFM32_MODE_PUSHPULL, -+ }, -+ [51] = { /* PD3, ETH_#CS */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOOUT, -+ .mode_gpio_out = EFM32_MODE_PUSHPULL, -+ }, -+ [68] = { /* PE4, spi cs */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOOUT, -+ .mode_gpio_out = EFM32_MODE_PUSHPULL, -+ }, -+ [69] = { /* PE5, spi sck */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOOUT, -+ .mode_gpio_out = EFM32_MODE_PUSHPULL, -+ }, -+ [70] = { /* PE6, spi miso */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOIN, -+ .mode_gpio_in = EFM32_MODE_INPUT, -+ }, -+ [71] = { /* PE7, spi mosi */ -+ .flags = EFM32_PINCTRL_FLAG_GPIOOUT, -+ .mode_gpio_out = EFM32_MODE_PUSHPULL, -+ } -+ }, ++static const struct platform_device_info efm32gg_dk3750_board_pdevinfo __initconst = { ++ .name = "efm32board", ++ .res = &efm32gg_dk3750_board_res, ++ .num_res = ARRAY_SIZE(efm32gg_dk3750_board_res), +}; + +static void __init efm32gg_dk3750_init(void) @@ -814,18 +626,11 @@ index 0000000..cdc7506 + efm32_print_cpuinfo(); + efm32_print_reset_cause(); + -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ efm32gg_add_efm32_usart(1, 0); -+#else + efm32gg_add_efm32_uart(1, 2); -+#endif -+ -+ efm32_add_efm32_pinctrl(&efm32gg_dk3750_pinctrl_pdata); + -+ efm32gg_dk3750_prepare_microsd(); + efm32gg_dk3750_prepare_ethernet(); + efm32_add_efm32_adc(); -+ ++ platform_device_register_full(&efm32gg_dk3750_board_pdevinfo); +} + +MACHINE_START(EFM32GG_DK3750, "EFM32 Giant Gecko Development Kit") @@ -834,16 +639,3 @@ index 0000000..cdc7506 + .init_machine = efm32gg_dk3750_init, + .restart = cm3_restart, +MACHINE_END -diff --git a/arch/arm/mach-efm32/time.c b/arch/arm/mach-efm32/time.c -index c8038b1..f91a3ef 100644 ---- a/arch/arm/mach-efm32/time.c -+++ b/arch/arm/mach-efm32/time.c -@@ -37,7 +37,7 @@ - - #define TIMER_CLOCKSOURCE 1 - #define TIMER_CLOCKEVENT 2 --#define IRQ_CLOCKEVENT 13 -+#define IRQ_CLOCKEVENT NVIC_IRQ(13) - - static void efm32_timer_write(unsigned timerno, u32 val, unsigned offset) - { diff --git a/patches/linux-3.8-rc5/0017-efm-board-controller-driver.patch b/patches/linux-3.8-rc5/0017-efm-board-controller-driver.patch new file mode 100644 index 0000000..4801e63 --- /dev/null +++ b/patches/linux-3.8-rc5/0017-efm-board-controller-driver.patch @@ -0,0 +1,208 @@ +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> +Date: Thu, 7 Feb 2013 09:45:30 +0100 +Subject: [PATCH] efm board controller driver + +--- + drivers/mfd/Kconfig | 4 ++ + drivers/mfd/Makefile | 1 + + drivers/mfd/efm32board.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 172 insertions(+) + create mode 100644 drivers/mfd/efm32board.c + +diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig +index 47ad4e2..42c37b5 100644 +--- a/drivers/mfd/Kconfig ++++ b/drivers/mfd/Kconfig +@@ -1113,6 +1113,10 @@ config MFD_AS3711 + help + Support for the AS3711 PMIC from AMS + ++config MFD_EFM32BOARD ++ tristate "efm32 board" ++ select MFD_CORE ++ + endmenu + endif + +diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile +index 8b977f8..cb0556f 100644 +--- a/drivers/mfd/Makefile ++++ b/drivers/mfd/Makefile +@@ -148,3 +148,4 @@ obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o + obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o vexpress-sysreg.o + obj-$(CONFIG_MFD_RETU) += retu-mfd.o + obj-$(CONFIG_MFD_AS3711) += as3711.o ++obj-$(CONFIG_MFD_EFM32BOARD) += efm32board.o +diff --git a/drivers/mfd/efm32board.c b/drivers/mfd/efm32board.c +new file mode 100644 +index 0000000..7cfd64e +--- /dev/null ++++ b/drivers/mfd/efm32board.c +@@ -0,0 +1,167 @@ ++#include <linux/platform_device.h> ++#include <linux/irq.h> ++#include <linux/irqdomain.h> ++#include <linux/export.h> ++#include <asm/io.h> ++ ++#define DRIVER_NAME "efm32board" ++ ++#define MAGIC 0x04 ++#define INTFLAG 0x40 ++#define INTEN 0x42 ++ ++struct efm32board_ddata { ++ void __iomem *base; ++ unsigned int irq; ++ struct irq_chip chip; ++ struct irq_domain *domain; ++}; ++ ++static void efm32board_irq_ack(struct irq_data *data) ++{ ++ struct efm32board_ddata *ddata = irq_get_chip_data(data->irq); ++ unsigned short val; ++ ++ /* XXX: lock */ ++ val = readw(ddata->base + INTFLAG); ++ val &= ~(1 << data->hwirq); ++ writew(val, ddata->base + INTFLAG); ++} ++ ++static void efm32board_irq_mask(struct irq_data *data) ++{ ++ struct efm32board_ddata *ddata = irq_get_chip_data(data->irq); ++ unsigned short val; ++ ++ /* XXX: lock */ ++ val = readw(ddata->base + INTEN); ++ val &= ~(1 << data->hwirq); ++ writew(val, ddata->base + INTEN); ++} ++ ++static void efm32board_irq_unmask(struct irq_data *data) ++{ ++ struct efm32board_ddata *ddata = irq_get_chip_data(data->irq); ++ unsigned short val; ++ ++ /* XXX: lock */ ++ val = readw(ddata->base + INTEN); ++ val |= 1 << data->hwirq; ++ writew(val, ddata->base + INTEN); ++} ++ ++static void efm32board_handler(unsigned int irq, struct irq_desc *desc) ++{ ++ unsigned short val; ++ struct efm32board_ddata *ddata = irq_get_handler_data(irq); ++ ++ /* ack gpio irq. XXX: this should go into a gpio driver */ ++ writel(1, (void __iomem *)0x4000611c); ++ ++ val = readw(ddata->base + INTFLAG); ++ /* ack BC irq */ ++ writew(0, ddata->base + INTFLAG); ++ ++ while (val) { ++ int line = __fls(val); ++ pr_info("val = %hx, line = %d\n", val, line); ++ generic_handle_irq(irq_create_mapping(ddata->domain, line)); ++ val &= ~(1 << line); ++ } ++ pr_info("/%s\n", __func__); ++} ++ ++int efm32board_irqdomain_map(struct irq_domain *d, unsigned int virq, ++ irq_hw_number_t hw) ++{ ++ struct efm32board_ddata *ddata = d->host_data; ++ ++ irq_set_chip_data(virq, ddata); ++ irq_set_chip_and_handler(virq, &ddata->chip, handle_edge_irq); ++ ++ set_irq_flags(virq, IRQF_VALID); ++ ++ return 0; ++} ++ ++const struct irq_domain_ops efm32board_irqdomain_ops = { ++ .map = efm32board_irqdomain_map, ++ .xlate = irq_domain_xlate_onecell, ++}; ++ ++static int efm32board_probe(struct platform_device *pdev) ++{ ++ struct resource *res; ++ int irq; ++ struct efm32board_ddata *ddata; ++ unsigned short val; ++ ++ ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); ++ if (!ddata) { ++ dev_err(&pdev->dev, "cannot allocate driver data"); ++ return -ENOMEM; ++ } ++ ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!res) { ++ dev_err(&pdev->dev, "can't get device resources\n"); ++ return -ENOENT; ++ } ++ ++ irq = platform_get_irq(pdev, 0); ++ if (irq <= 0) { ++ dev_err(&pdev->dev, "can't get irq number\n"); ++ return -ENOENT; ++ } ++ ddata->irq = irq; ++ ++ ddata->base = devm_request_and_ioremap(&pdev->dev, res); ++ if (!ddata->base) { ++ dev_err(&pdev->dev, "cannot request and ioremap register set\n"); ++ return -EADDRNOTAVAIL; ++ } ++ ++ val = readw(ddata->base + MAGIC); ++ if (val != 0xef32) { ++ dev_err(&pdev->dev, "Magic not found (0x%hx)\n", val); ++ return -ENODEV; ++ } ++ ++ /* disable and clear all irqs */ ++ writew(0, ddata->base + INTEN); ++ writew(0, ddata->base + INTFLAG); ++ ++ /* XXX: enable joystick irq */ ++ writew(4, ddata->base + INTEN); ++ ++ ddata->chip.name = DRIVER_NAME; ++ ddata->chip.irq_ack = efm32board_irq_ack; ++ ddata->chip.irq_mask = efm32board_irq_mask; ++ ddata->chip.irq_unmask = efm32board_irq_unmask; ++ ++ irq_set_handler_data(irq, ddata); ++ irq_set_chained_handler(irq, efm32board_handler); ++ ++ ddata->domain = irq_domain_add_simple(pdev->dev.of_node, 5, 0, ++ &efm32board_irqdomain_ops, ddata); ++ if (!ddata->domain) { ++ dev_err(&pdev->dev, "cannot create irq domain\n"); ++ return -ENOMEM; ++ } ++ return 0; ++} ++ ++static const struct of_device_id efm32board_dt_ids[] = { ++ { .compatible = "efm32board", }, ++ { /* sentinel */ } ++}; ++ ++static struct platform_driver efm32board_driver = { ++ .probe = efm32board_probe, ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = efm32board_dt_ids, ++ }, ++}; ++module_platform_driver(efm32board_driver); diff --git a/patches/linux-3.8-rc5/0017-pinctrl-add-a-driver-for-Energy-Micro-s-efm32-SoCs.patch b/patches/linux-3.8-rc5/0017-pinctrl-add-a-driver-for-Energy-Micro-s-efm32-SoCs.patch deleted file mode 100644 index f92145f..0000000 --- a/patches/linux-3.8-rc5/0017-pinctrl-add-a-driver-for-Energy-Micro-s-efm32-SoCs.patch +++ /dev/null @@ -1,520 +0,0 @@ -From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> -Date: Thu, 8 Dec 2011 23:37:41 +0100 -Subject: [PATCH] pinctrl: add a driver for Energy Micro's efm32 SoCs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> ---- - drivers/pinctrl/Kconfig | 6 + - drivers/pinctrl/Makefile | 1 + - drivers/pinctrl/pinctrl-efm32.c | 415 +++++++++++++++++++++++++++ - include/linux/platform_data/efm32-pinctrl.h | 47 +++ - 4 files changed, 469 insertions(+) - create mode 100644 drivers/pinctrl/pinctrl-efm32.c - create mode 100644 include/linux/platform_data/efm32-pinctrl.h - -diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig -index c31aeb0..ac75540 100644 ---- a/drivers/pinctrl/Kconfig -+++ b/drivers/pinctrl/Kconfig -@@ -40,6 +40,12 @@ config PINCTRL_BCM2835 - select PINMUX - select PINCONF - -+config PINCTRL_EFM32 -+ bool "EFM32 pin controller driver" -+ depends on ARCH_EFM32 -+ default y -+ select PINMUX -+ - config PINCTRL_IMX - bool - select PINMUX -diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile -index fc4606f..a235af0 100644 ---- a/drivers/pinctrl/Makefile -+++ b/drivers/pinctrl/Makefile -@@ -11,6 +11,7 @@ endif - obj-$(CONFIG_GENERIC_PINCONF) += pinconf-generic.o - obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o - obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o -+obj-$(CONFIG_PINCTRL_EFM32) += pinctrl-efm32.o - obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o - obj-$(CONFIG_PINCTRL_IMX35) += pinctrl-imx35.o - obj-$(CONFIG_PINCTRL_IMX51) += pinctrl-imx51.o -diff --git a/drivers/pinctrl/pinctrl-efm32.c b/drivers/pinctrl/pinctrl-efm32.c -new file mode 100644 -index 0000000..160774b ---- /dev/null -+++ b/drivers/pinctrl/pinctrl-efm32.c -@@ -0,0 +1,415 @@ -+#include <linux/module.h> -+#include <linux/gpio.h> -+#include <linux/slab.h> -+#include <linux/platform_device.h> -+#include <linux/irq.h> -+#include <asm/io.h> -+#include <asm/mach/irq.h> -+#include <linux/platform_data/efm32-pinctrl.h> -+ -+#define DRIVER_NAME "efm32-pinctrl" -+ -+#define EFM32_REG_Px_CTRL 0x000 -+#define EFM32_REG_Px_MODEL 0x004 -+#define EFM32_REG_Px_MODEH 0x008 -+#define EFM32_REG_Px_DOUTSET 0x010 -+#define EFM32_REG_Px_DOUTCLR 0x014 -+#define EFM32_REG_Px_DIN 0x01c -+ -+#define EFM32_REG_EXTIPSELL 0x100 -+#define EFM32_REG_EXTIPSELH 0x104 -+#define EFM32_REG_EXTIRISE 0x108 -+#define EFM32_REG_EXTIFALL 0x10c -+#define EFM32_REG_IEN 0x110 -+#define EFM32_REG_IF 0x114 -+#define EFM32_REG_IFS 0x118 -+#define EFM32_REG_IFC 0x11c -+ -+#define NVIC_IRQ(x) ((x) + 16) -+ -+struct efm32_pinctrl_ddata { -+ struct platform_device *pdev; -+ spinlock_t lock; -+ struct irq_chip ic; -+ struct gpio_chip gc; -+ void __iomem *base; -+ -+ /* -1 = unused, 0 -> irq triggers on port A, ... */ -+ s8 irqport[16]; -+ -+ /* shadow values */ -+ u32 ien; -+ u32 extirise, extifall; -+ -+ /* track level sensitivity which is emulated using edge triggering */ -+ u32 extilow, extihigh; -+}; -+ -+#define from_gpio_chip(chip) container_of((chip), struct efm32_pinctrl_ddata, gc) -+ -+static void __efm32_pinctrl_set_mode(struct efm32_pinctrl_ddata *ddata, -+ unsigned pin, unsigned mode, unsigned dout) -+{ -+ unsigned bank = pin / 16; -+ unsigned bankpin = pin % 16; -+ unsigned bank_regoff = bank * 0x24; -+ unsigned mode_regoff = bankpin < 8 ? EFM32_REG_Px_MODEL : EFM32_REG_Px_MODEH; -+ unsigned dout_regoff = dout ? EFM32_REG_Px_DOUTSET : EFM32_REG_Px_DOUTCLR; -+ u32 regmode; -+ -+ if (mode & 0xf) -+ writel(1 << bankpin, ddata->base + bank_regoff + dout_regoff); -+ -+ regmode = readl(ddata->base + bank_regoff + mode_regoff); -+ -+ regmode &= ~(0xf << (4 * (bankpin % 8))); -+ regmode |= (mode & 0xf) << (4 * (bankpin % 8)); -+ -+ writel(regmode, ddata->base + bank_regoff + mode_regoff); -+ -+ if (!(mode & 0xf)) -+ writel(1 << bankpin, ddata->base + bank_regoff + dout_regoff); -+ -+} -+static void efm32_pinctrl_set_mode(struct efm32_pinctrl_ddata *ddata, -+ unsigned pin, unsigned mode, unsigned dout) -+{ -+ unsigned long flags; -+ -+ spin_lock_irqsave(&ddata->lock, flags); -+ __efm32_pinctrl_set_mode(ddata, pin, mode, dout); -+ spin_unlock_irqrestore(&ddata->lock, flags); -+} -+ -+static int efm32_pinctrl_gpio_direction_input(struct gpio_chip *chip, -+ unsigned offset) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_gpio_chip(chip); -+ struct efm32_pinctrl_pdata *pdata = dev_get_platdata(&ddata->pdev->dev); -+ -+ dev_dbg(&ddata->pdev->dev, "%s(%u)\n", __func__, offset); -+ -+ if (!pdata || !(pdata->pindef[offset].flags & -+ EFM32_PINCTRL_FLAG_GPIOIN)) { -+ dev_dbg(&ddata->pdev->dev, "%s(%u) -> EINVAL\n", __func__, offset); -+ return -EINVAL; -+ } -+ -+ efm32_pinctrl_set_mode(ddata, offset, -+ pdata->pindef[offset].mode_gpio_in & 0xf, -+ pdata->pindef[offset].mode_gpio_in & 0x10); -+ -+ return 0; -+} -+ -+static int efm32_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_gpio_chip(chip); -+ unsigned bank = offset / 16; -+ unsigned bankpin = offset % 16; -+ unsigned bank_regoff = bank * 0x24; -+ u32 regdin; -+ -+ regdin = readl(ddata->base + bank_regoff + EFM32_REG_Px_DIN); -+ dev_dbg(&ddata->pdev->dev, "%s(%u) -> %x\n", __func__, -+ offset, regdin & (1 << bankpin)); -+ -+ return regdin & (1 << bankpin); -+} -+ -+static int efm32_pinctrl_gpio_direction_output(struct gpio_chip *chip, -+ unsigned offset, int value) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_gpio_chip(chip); -+ struct efm32_pinctrl_pdata *pdata = dev_get_platdata(&ddata->pdev->dev); -+ -+ dev_dbg(&ddata->pdev->dev, "%s(%u, %d)\n", __func__, offset, value); -+ -+ if (!pdata || !(pdata->pindef[offset].flags & -+ EFM32_PINCTRL_FLAG_GPIOOUT)) { -+ dev_dbg(&ddata->pdev->dev, "%s(%u) -> EINVAL\n", __func__, offset); -+ return -EINVAL; -+ } -+ -+ efm32_pinctrl_set_mode(ddata, offset, -+ pdata->pindef[offset].mode_gpio_out & 0xf, value); -+ return 0; -+} -+ -+static void efm32_pinctrl_gpio_set(struct gpio_chip *chip, -+ unsigned offset, int value) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_gpio_chip(chip); -+ unsigned bank = offset / 16; -+ unsigned bankpin = offset % 16; -+ unsigned bank_regoff = bank * 0x24; -+ unsigned dout_regoff = value ? -+ EFM32_REG_Px_DOUTSET : EFM32_REG_Px_DOUTCLR; -+ -+ dev_dbg(&ddata->pdev->dev, "%s(%u, %d)\n", __func__, offset, value); -+ -+ writel(1 << bankpin, ddata->base + bank_regoff + dout_regoff); -+} -+ -+/* XXX */ -+#define EFM32_GPIO_IRQ_OFFSET 50 -+ -+static int efm32_pinctrl_gpio_to_irq(struct gpio_chip *chip, -+ unsigned offset) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_gpio_chip(chip); -+ -+ unsigned bank = offset / 16; -+ unsigned bankpin = offset % 16; -+ unsigned extipsel_refoff = bankpin < 8 ? EFM32_REG_EXTIPSELL : EFM32_REG_EXTIPSELH; -+ u32 extipsel; -+ unsigned long flags; -+ -+ int ret = bankpin + EFM32_GPIO_IRQ_OFFSET; -+ -+ spin_lock_irqsave(&ddata->lock, flags); -+ if (ddata->irqport[bankpin] >= 0 && ddata->irqport[bankpin] != bank) { -+ ret = -EINVAL; -+ goto out_unlock; -+ } -+ -+ ddata->irqport[bankpin] = bank; -+ -+ extipsel = readl(ddata->base + extipsel_refoff); -+ extipsel &= ~(0x7 << 4 * (bankpin % 8)); -+ extipsel |= bank << 4 * (bankpin % 8); -+ -+ writel(extipsel, ddata->base + extipsel_refoff); -+ -+out_unlock: -+ spin_unlock_irqrestore(&ddata->lock, flags); -+ -+ return ret; -+} -+ -+#define from_irq_chip(chip) container_of((chip), struct efm32_pinctrl_ddata, ic) -+#define from_irq_data(data) from_irq_chip(irq_data_get_irq_chip((data))) -+#define efm32irq(data) (((data)->irq - EFM32_GPIO_IRQ_OFFSET) & 0xf) -+ -+static void efm32_pinctrl_irq_ack(struct irq_data *data) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_irq_data(data); -+ -+ writel(1 << efm32irq(data), ddata->base + EFM32_REG_IFC); -+} -+ -+static void efm32_pinctrl_irq_mask(struct irq_data *data) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_irq_data(data); -+ unsigned long flags; -+ -+ spin_lock_irqsave(&ddata->lock, flags); -+ -+ ddata->ien &= ~(1 << efm32irq(data)); -+ writel(ddata->ien, ddata->base + EFM32_REG_IEN); -+ -+ spin_unlock_irqrestore(&ddata->lock, flags); -+} -+ -+static void efm32_pinctrl_irq_unmask(struct irq_data *data) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_irq_data(data); -+ unsigned long flags; -+ u32 bitmask = 1 << efm32irq(data); -+ -+ spin_lock_irqsave(&ddata->lock, flags); -+ -+ ddata->ien |= bitmask; -+ writel(ddata->ien, ddata->base + EFM32_REG_IEN); -+ -+ BUG_ON(ddata->irqport[efm32irq(data)] < 0); -+ -+ /* retrigger irq on level sensitivity */ -+ if ((ddata->extilow | ddata->extihigh) & bitmask) { -+ u32 din = readl(ddata->base + 0x24 * ddata->irqport[efm32irq(data)] + EFM32_REG_Px_DIN); -+ if ((din ^ ddata->extilow) & bitmask) -+ writel(bitmask, ddata->base + EFM32_REG_IFS); -+ } -+ -+ spin_unlock_irqrestore(&ddata->lock, flags); -+} -+ -+static int efm32_pinctrl_irq_set_type(struct irq_data *data, -+ unsigned int flow_type) -+{ -+ struct efm32_pinctrl_ddata *ddata = from_irq_data(data); -+ unsigned long flags; -+ -+ if ((flow_type & IRQ_TYPE_LEVEL_MASK) == IRQ_TYPE_LEVEL_MASK) -+ return -EINVAL; -+ -+ spin_lock_irqsave(&ddata->lock, flags); -+ -+ ddata->extirise &= ~(1 << efm32irq(data)); -+ if (flow_type & IRQ_TYPE_EDGE_RISING) -+ ddata->extirise |= 1 << efm32irq(data); -+ -+ ddata->extifall &= ~(1 << efm32irq(data)); -+ if (flow_type & IRQ_TYPE_EDGE_FALLING) -+ ddata->extifall |= 1 << efm32irq(data); -+ -+ /* -+ * There is no explict way to trigger on level sensitive irqs, so -+ * trigger on the corresponding edge and set the irq pending in the -+ * unmask irq callback if the level matches the corresponding level. -+ */ -+ ddata->extilow &= ~(1 << efm32irq(data)); -+ ddata->extihigh &= ~(1 << efm32irq(data)); -+ if (flow_type & IRQ_TYPE_LEVEL_LOW) { -+ ddata->extilow |= 1 << efm32irq(data); -+ ddata->extifall |= 1 << efm32irq(data); -+ } else if (flow_type & IRQ_TYPE_LEVEL_HIGH) { -+ ddata->extihigh |= 1 << efm32irq(data); -+ ddata->extirise |= 1 << efm32irq(data); -+ } -+ -+ writel(ddata->extirise, ddata->base + EFM32_REG_EXTIRISE); -+ writel(ddata->extifall, ddata->base + EFM32_REG_EXTIFALL); -+ -+ spin_unlock_irqrestore(&ddata->lock, flags); -+ -+ return 0; -+} -+ -+static void efm32_pinctrl_gpio_handler(unsigned int irq, struct irq_desc *desc, u32 mask) -+{ -+ struct irq_chip *parent_chip = irq_get_chip(irq); -+ struct efm32_pinctrl_ddata *ddata = irq_get_handler_data(irq); -+ u32 iflag; -+ -+ chained_irq_enter(parent_chip, desc); -+ -+ iflag = readl(ddata->base + EFM32_REG_IF); -+ iflag &= mask; -+ while (iflag) { -+ int bit = __ffs(iflag); -+ -+ generic_handle_irq(EFM32_GPIO_IRQ_OFFSET + bit); -+ iflag &= ~BIT(bit); -+ } -+ -+ chained_irq_exit(parent_chip, desc); -+} -+ -+static void efm32_pinctrl_gpio_handler_even(unsigned int irq, struct irq_desc *desc) -+{ -+ efm32_pinctrl_gpio_handler(irq, desc, 0x5555); -+} -+ -+static void efm32_pinctrl_gpio_handler_odd(unsigned int irq, struct irq_desc *desc) -+{ -+ efm32_pinctrl_gpio_handler(irq, desc, 0xaaaa); -+} -+ -+static int efm32_pinctrl_probe(struct platform_device *pdev) -+{ -+ struct efm32_pinctrl_ddata *ddata; -+ struct efm32_pinctrl_pdata *pdata; -+ struct resource *res; -+ int ret, i; -+ -+ ddata = kzalloc(sizeof(*ddata), GFP_KERNEL); -+ if (!ddata) -+ return -ENOMEM; -+ -+ ddata->pdev = pdev; -+ -+ spin_lock_init(&ddata->lock); -+ -+ for (i = 0; i < ARRAY_SIZE(ddata->irqport); ++i) -+ ddata->irqport[i] = -1; -+ -+ ddata->ic.name = "efm32 gpio"; -+ ddata->ic.irq_ack = efm32_pinctrl_irq_ack; -+ ddata->ic.irq_mask = efm32_pinctrl_irq_mask; -+ ddata->ic.irq_unmask = efm32_pinctrl_irq_unmask; -+ ddata->ic.irq_set_type = efm32_pinctrl_irq_set_type; -+ -+ ddata->gc.label = "efm32 gpio"; -+ ddata->gc.dev = &pdev->dev; -+ ddata->gc.owner = THIS_MODULE; -+ ddata->gc.direction_input = efm32_pinctrl_gpio_direction_input; -+ ddata->gc.get = efm32_pinctrl_gpio_get; -+ ddata->gc.direction_output = efm32_pinctrl_gpio_direction_output; -+ ddata->gc.set = efm32_pinctrl_gpio_set; -+ ddata->gc.to_irq = efm32_pinctrl_gpio_to_irq; -+ ddata->gc.ngpio = 6 * 16; -+ ddata->gc.base = 0; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!res) { -+ ret = -ENODEV; -+ dev_dbg(&pdev->dev, "getting base address failed\n"); -+ goto err_get_base; -+ } -+ -+ ddata->base = ioremap(res->start, 0x140); -+ if (!ddata->base) { -+ ret = -ENOMEM; -+ dev_dbg(&pdev->dev, "failed to remap\n"); -+ goto err_ioremap; -+ } -+ -+ irq_set_chained_handler(NVIC_IRQ(1) /* IRQ_GPIO_EVEN */, -+ efm32_pinctrl_gpio_handler_even); -+ irq_set_handler_data(NVIC_IRQ(1), ddata); -+ -+ irq_set_chained_handler(NVIC_IRQ(11) /* IRQ_GPIO_ODD */, -+ efm32_pinctrl_gpio_handler_odd); -+ irq_set_handler_data(NVIC_IRQ(11), ddata); -+ -+ for (i = 0; i < 16; ++i) { -+ irq_set_chip_and_handler(EFM32_GPIO_IRQ_OFFSET + i, &ddata->ic, -+ handle_level_irq); -+ set_irq_flags(EFM32_GPIO_IRQ_OFFSET + i, IRQF_VALID); -+ } -+ -+ pdata = dev_get_platdata(&pdev->dev); -+ if (pdata) { -+ for (i = 0; i < ARRAY_SIZE(pdata->pindef); ++i) -+ if (pdata->pindef[i].mode_initial > 0) { -+ unsigned mode = -+ pdata->pindef[i].mode_initial & 0xf; -+ unsigned dout = -+ pdata->pindef[i].mode_initial & 0x10; -+ -+ __efm32_pinctrl_set_mode(ddata, i, mode, dout); -+ } -+ } -+ -+ ret = gpiochip_add(&ddata->gc); -+ if (ret) { -+ dev_dbg(&pdev->dev, "failed to add gpio chip"); -+ -+ iounmap(ddata->base); -+err_ioremap: -+err_get_base: -+ -+ kfree(ddata); -+ } -+ -+ dev_dbg(&pdev->dev, "%s returns %d\n", __func__, ret); -+ return ret; -+} -+ -+static struct platform_driver efm32_pinctrl_driver = { -+ .driver = { -+ .name = DRIVER_NAME, -+ .owner = THIS_MODULE, -+ }, -+ .probe = efm32_pinctrl_probe, -+}; -+ -+static int __init efm32_pinctrl_init(void) -+{ -+ return platform_driver_register(&efm32_pinctrl_driver); -+} -+postcore_initcall(efm32_pinctrl_init); -+ -+MODULE_AUTHOR("Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>"); -+MODULE_LICENSE("GPL v2"); -diff --git a/include/linux/platform_data/efm32-pinctrl.h b/include/linux/platform_data/efm32-pinctrl.h -new file mode 100644 -index 0000000..3602f67 ---- /dev/null -+++ b/include/linux/platform_data/efm32-pinctrl.h -@@ -0,0 +1,47 @@ -+#ifndef __LINUX_PLATFORM_DATA_EFM32_PINCTRL_H__ -+#define __LINUX_PLATFORM_DATA_EFM32_PINCTRL_H__ -+ -+#define EFM32_MODE_DISABLED 0x00 -+#define EFM32_MODE_INPUT 0x01 -+#define EFM32_MODE_INPUTFILTER 0x11 -+#define EFM32_MODE_INPUTPULLDOWN 0x02 -+#define EFM32_MODE_INPUTPULLUP 0x12 -+#define EFM32_MODE_INPUTPULLDOWNFILTER 0x03 -+#define EFM32_MODE_INPUTPULLUPFILTER 0x13 -+#define EFM32_MODE_PUSHPULL 0x04 -+#define EFM32_MODE_PUSHPULLDRIVE 0x05 -+#define EFM32_MODE_WIREDOR 0x06 -+#define EFM32_MODE_WIREDORPULLDOWN 0x07 -+#define EFM32_MODE_WIREDAND 0x08 -+#define EFM32_MODE_WIREDANDFILTER 0x09 -+#define EFM32_MODE_WIREDANDPULLUP 0x0a -+#define EFM32_MODE_WIREDANDPULLUPFILTER 0x0b -+#define EFM32_MODE_WIREDANDDRIVE 0x0c -+#define EFM32_MODE_WIREDANDDRIVEFILTER 0x0d -+#define EFM32_MODE_WIREDANDDRIVEPULLUP 0x0e -+#define EFM32_MODE_WIREDANDDRIVEPULLUPFILTER 0x0f -+ -+struct efm32_pinctrl_pindef { -+#define EFM32_PINCTRL_FLAG_INITIAL 1 -+#define EFM32_PINCTRL_FLAG_GPIOIN 2 -+#define EFM32_PINCTRL_FLAG_GPIOOUT 4 -+ -+ unsigned short flags; -+ -+ /* -+ * These either take a value of the form -+ * ,-4-+-3-----0-. -+ * |DAT| MODE | -+ * `---+---------' -+ * with MODE being one of the EFM32_MODE_... above and DAT being the -+ * value written to DOUT (which matters also for the input modes). -+ */ -+ unsigned short mode_initial; -+ unsigned short mode_gpio_in, mode_gpio_out; -+}; -+ -+struct efm32_pinctrl_pdata { -+ struct efm32_pinctrl_pindef pindef[96]; -+}; -+ -+#endif /* ifndef __LINUX_PLATFORM_DATA_EFM32_PINCTRL_H__ */ diff --git a/patches/linux-3.8-rc5/0021-ARM-v7m-add-trivial-suspend-support.patch b/patches/linux-3.8-rc5/0018-ARM-v7m-add-trivial-suspend-support.patch index 8950e0b..deb16a9 100644 --- a/patches/linux-3.8-rc5/0021-ARM-v7m-add-trivial-suspend-support.patch +++ b/patches/linux-3.8-rc5/0018-ARM-v7m-add-trivial-suspend-support.patch @@ -13,10 +13,10 @@ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 814886d..0962c33 100644 +index 46a8762..09eb7f5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -2318,7 +2318,7 @@ source "kernel/power/Kconfig" +@@ -2315,7 +2315,7 @@ source "kernel/power/Kconfig" config ARCH_SUSPEND_POSSIBLE depends on !ARCH_S5PC100 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ diff --git a/patches/linux-3.8-rc5/0022-ARM-efm32-add-trivial-suspend-support.patch b/patches/linux-3.8-rc5/0019-ARM-efm32-add-trivial-suspend-support.patch index c096f67..7f2ba23 100644 --- a/patches/linux-3.8-rc5/0022-ARM-efm32-add-trivial-suspend-support.patch +++ b/patches/linux-3.8-rc5/0019-ARM-efm32-add-trivial-suspend-support.patch @@ -13,16 +13,16 @@ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> create mode 100644 arch/arm/mach-efm32/pm.c diff --git a/arch/arm/mach-efm32/Makefile b/arch/arm/mach-efm32/Makefile -index c882ed0..420780e 100644 +index ba4d6ee..0f593e7 100644 --- a/arch/arm/mach-efm32/Makefile +++ b/arch/arm/mach-efm32/Makefile -@@ -3,5 +3,6 @@ obj-y += bootloader.o +@@ -1,5 +1,6 @@ obj-y += clk.o common.o time.o obj-$(CONFIG_OF) += dtmachine.o +obj-$(CONFIG_PM) += pm.o - obj-y += machines/ devices/ + obj-$(CONFIG_EFM32_NONDT) += machines/ devices/ diff --git a/arch/arm/mach-efm32/pm.c b/arch/arm/mach-efm32/pm.c new file mode 100644 index 0000000..de03941 diff --git a/patches/linux-3.8-rc5/0018-HACK-ARM-allow-a-bootloader-to-be-embedded-and-do-it.patch b/patches/linux-3.8-rc5/0020-HACK-ARM-allow-a-bootloader-to-be-embedded-and-do-it.patch index 9bbbf28..2ff70a4 100644 --- a/patches/linux-3.8-rc5/0018-HACK-ARM-allow-a-bootloader-to-be-embedded-and-do-it.patch +++ b/patches/linux-3.8-rc5/0020-HACK-ARM-allow-a-bootloader-to-be-embedded-and-do-it.patch @@ -9,9 +9,9 @@ Content-Transfer-Encoding: 8bit Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- arch/arm/kernel/vmlinux.lds.S | 5 + - arch/arm/mach-efm32/Makefile | 2 + - arch/arm/mach-efm32/bootloader.S | 274 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 281 insertions(+) + arch/arm/mach-efm32/Makefile | 6 + + arch/arm/mach-efm32/bootloader.S | 252 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 263 insertions(+) create mode 100644 arch/arm/mach-efm32/bootloader.S diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S @@ -31,35 +31,33 @@ index 11c1785..d573600 100644 _text = .; HEAD_TEXT diff --git a/arch/arm/mach-efm32/Makefile b/arch/arm/mach-efm32/Makefile -index f3a6932..c882ed0 100644 +index 0f593e7..878dc84 100644 --- a/arch/arm/mach-efm32/Makefile +++ b/arch/arm/mach-efm32/Makefile -@@ -1,3 +1,5 @@ +@@ -1,3 +1,9 @@ +obj-y += bootloader.o + ++ifeq ($(CONFIG_USE_OF),y) ++$(obj)/bootloader.o: $(obj)/../boot/dts/efm32gg-dk3750.dtb ++endif ++ obj-y += clk.o common.o time.o obj-$(CONFIG_OF) += dtmachine.o diff --git a/arch/arm/mach-efm32/bootloader.S b/arch/arm/mach-efm32/bootloader.S new file mode 100644 -index 0000000..af727b2 +index 0000000..d4dbf0b --- /dev/null +++ b/arch/arm/mach-efm32/bootloader.S -@@ -0,0 +1,274 @@ -+#if defined(CONFIG_OF) && !defined(CONFIG_EFM32GG_DK3750_FPGA) +@@ -0,0 +1,252 @@ ++#if defined(CONFIG_OF) +#define EFM32_USE_OF +#endif +#define EFM32_DT_IN_SRAM + -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+/* USART1 */ -+#define UARTBASE 0x4000c400 -+#define UARTLOCATION 0 -+#else +/* UART1 */ +#define UARTBASE 0x4000e400 +#define UARTLOCATION 2 -+#endif + + .thumb + @@ -70,7 +68,7 @@ index 0000000..af727b2 + .int reset + 1 @ Reset + +reset: -+ /* init external RAM and serial port */ ++ /* init external RAM, serial port, EBI and stuff */ + adr r0, reginit +1: + ldr r1, [r0] @@ -80,26 +78,27 @@ index 0000000..af727b2 + cmp r0, #(reginit_end) + blo 1b + -+#ifndef CONFIG_EFM32GG_DK3750_FPGA -+ /* enable UART mux */ -+ ldr r0, =(0x80000018) -+ mov r1, #0x1000 -+ strh r1, [r0] + -+ mov r1, #0x0001 -+ strh r1, [r0, #-4] ++ /* init some BC registers */ ++ adr r0, bcinit ++1: ++ ldrh r1, [r0] ++ ldrh r2, [r0, #2] ++ add r1, r1, #0x80000000 ++ strh r2, [r1] ++ add r0, #4 ++ cmp r0, #(bcinit_end) ++ blo 1b + + /* give mux some time to enable the level shifter */ + ldr r0, =0x4000 +1: subs r0, r0, #1 + bne 1b -+#endif + + ldr r0, =(UARTBASE + 0x34) + mov r1, 0x55 + str r1, [r0] + -+#ifndef CONFIG_EFM32GG_DK3750_FPGA + /* Zero PSRAM */ + ldr r0, =(0x88000000) + ldr r1, =(0x88400000) @@ -128,7 +127,6 @@ index 0000000..af727b2 + bcc 1b + mov r7, #'>' + str r7, [r6] -+#endif + +#if defined(EFM32_USE_OF) && defined(EFM32_DT_IN_SRAM) +#define dtbaddr 0x10000000 @@ -182,9 +180,7 @@ index 0000000..af727b2 + .int 0x43900814, 0x00000001 @ CMU_HFCORECLKEN0 |= EBI via bitband + .int 0x439008b4, 0x00000001 @ CMU_HFPERCLKEN0 |= GPIO via bitband + .int 0x43900884, 0x00000001 @ CMU_HFPERCLKEN0 |= USART1 via bitband -+#ifndef CONFIG_EFM32GG_DK3750_FPGA + .int 0x43900890, 0x00000001 @ CMU_HFPERCLKEN0 |= UART1 via bitband -+#endif + + /* XXX */ + .int 0x439008c0, 0x00000001 @ CMU_HFPERCLKEN0 |= ADC via bitband @@ -195,50 +191,37 @@ index 0000000..af727b2 + .int 0x40006004, 0x04444444 @ GPIO_PA_MODEL; EBI AD9..15 set mode=pushpull + .int 0x40006008, 0x40000000 @ GPIO_PA_MODEH; EBI AD8 set mode=pushpull + .int 0x40006024, 0x00000000 @ GPIO_PB_CTRL, reset default -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ .int 0x40006034, 0x00008000 @ GPIO_PB_DOUTSET; EBI mode on PB15 MCU_EBI_CONNECT (1) -+#else + .int 0x40006038, 0x00008000 @ GPIO_PB_DOUTCLR; EBI mode on PB15 MCU_EBI_CONNECT (0) -+#endif + .int 0x40006038, 0x0000007f @ GPIO_PB_DOUTCLR; EBI A16-22 + .int 0x40006028, 0x04444444 @ GPIO_PB_MODEL; EBI A16-22 -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ .int 0x4000602c, 0x40000000 @ GPIO_PB_MODEH; MCU_EBI_CONNECT -> output -+#else + .int 0x40006034, 0x00000200 @ GPIO_PB_DOUTSET; set UART_TX to avoid false start + .int 0x4000602c, 0x40000140 @ GPIO_PB_MODEH; MCU_EBI_CONNECT -> output, UART_TX, UART_RX -+#endif + + .int 0x40006048, 0x00000000 @ GPIO_PC_CTRL, reset default -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ .int 0x40006058, 0x00000001 @ GPIO_PC_DOUTSET; set PC0 (USART1_TX) high to avoid false start -+#endif + .int 0x4000605c, 0x00000001 @ GPIO_PC_DOUTCLR; PC11 (EBI_ALE) -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ .int 0x4000604c, 0x00000014 @ GPIO_PC_MODEL; PC0: Push-pull output, PC1 (USART1_RX): input -+#endif + .int 0x40006050, 0x00004000 @ GPIO_PC_MODEH; PC11: Push-pull output + .int 0x4000606c, 0x00000000 @ GPIO_PD_CTRL, reset default -+ .int 0x4000607c, 0x00003e00 @ GPIO_PD_DOUTSET, EBI CS0-3, spiconnect set dataout to 1 ++ .int 0x4000607c, 0x00003e08 @ GPIO_PD_DOUTSET, EBI CS0-3, spiconnect set dataout to 1; ETH_SPI_#CS (D3) ++ .int 0x40006080, 0x00000007 @ GPIO_PD_DOUTCLR, ETH_SPI_{TX, RX, CLK} ++ .int 0x40006070, 0x00004414 @ GPIO_PD_MODEL; ETH_SPI_ + .int 0x40006074, 0x00444440 @ GPIO_PD_MODEH; EBI CS0-3, spiconnect set mode=pushpull + .int 0x40006090, 0x00000000 @ GPIO_PE_CTRL, reset default ++ .int 0x400060a0, 0x00000001 @ GPIO_PE_DOUTSET; FPGA irq line + .int 0x400060a4, 0x0000ff00 @ GPIO_PE_DOUTCLR; EBI AD0..7 set dataout to 0 ++ .int 0x40006094, 0x00000002 @ GPIO_PE_MODEL; FPGA irq line set mode=inputpull + .int 0x40006098, 0x44444444 @ GPIO_PE_MODEH; EBI AD0..7 set mode=pushpull ++ + .int 0x400060b4, 0x00000000 @ GPIO_PF_CTRL, reset default + .int 0x400060c8, 0x000003c0 @ GPIO_PF_DOUTCLR; EBI Wen+Ren set dataout to 0 + .int 0x400060b8, 0x44000000 @ GPIO_PF_MODEL; EBI Byte Lane 0 support BL0/BL1 + .int 0x400060bc, 0x00000044 @ GPIO_PF_MODEH; EBI WEN, REN + ++ .int 0x40006100, 0x00000004 @ GPIO_EXTIPSELL: select port E for irq 0 ++ .int 0x4000610c, 0x00000001 @ GPIO_EXTIFALL: trigger for falling FPGA irq line ++ .int 0x4000611c, 0x0000ffff @ ? GPIO_IFC: clear all irqs ++ .int 0x40006110, 0x00000001 @ GPIO_IEN: enable irq 0 ++ + /* EBI */ -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ .int 0x40008010, 0x00000000 @ EBI_POLARITY, ardy, ale, we, re, cs and bl active low -+ .int 0x40008000, 0x41000003 @ EBI_CTRL, enable ITS, D16, BL -+ .int 0x40008008, 0x00010101 @ EBI_RDTIMING, setup = strobe = hold = 1 -+ .int 0x4000800c, 0x00020202 @ EBI_WRTIMING, setup = strobe = hold = 2 -+ .int 0x40008004, 0x00000303 @ EBI_ADDRTIMING, setup = hold = 3 -+ .int 0x40008014, 0x00540083 @ EBI_ROUTE -+ .int 0x40008000, 0x41000103 @ EBI_CTRL, bank0en -+#else + .int 0x40008000, 0x4f00d051 @ EBI_CTRL, enable ITS, mode0=mode2=mode3=D16A16ALE, bl0-3, noidle[023] + /* EBI PSRAM */ + .int 0x40008028, 0x10000000 @ EBI_ADDRTIMING2; HALFALE @@ -260,7 +243,6 @@ index 0000000..af727b2 + + .int 0x40008014, 0x105e00bb @ EBI_ROUTE + .int 0x40008000, 0x4f00dd51 @ EBI_CTRL, enable ITS, mode0=mode2=mode3=D16A16ALE, bl0-3, noidle[023], bank[023]en -+#endif + + .int UARTBASE + 0x00, 0x00000000 @ UART1_CTRL + .int UARTBASE + 0x04, 0x00001005 @ UART1_FRAME @@ -272,6 +254,17 @@ index 0000000..af727b2 +reginit_end: + .size reginit, . - reginit + ++ .align 3 ++ /* register value pairs to initialize the board controller */ ++ .type bcinit, %object ++bcinit: ++ .short 0x0018, 0x1300 @ enable UART mux and ETH ++ .short 0x0014, 0x0001 @ / ++ .short 0x001a, 0x0001 @ ETH ++ ++bcinit_end: ++ .size bcinit, . - bcinit ++ + .align 3 +#ifdef EFM32_USE_OF + .type dtb, %object @@ -294,24 +287,13 @@ index 0000000..af727b2 + /* ATAG_MEM */ + .int 0x00000004 /* .size */ + .int 0x54410002 /* .tag = ATAG_MEM */ -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ .int 0x00100000 /* .size = 1 MiB */ -+ .int 0x80000000 /* .start = SRAM_BASE */ -+#else + .int 0x00400000 /* .size = 4 MiB */ + .int 0x88000000 /* .start = SRAM_BASE */ -+#endif + /* ATAG_CMDLINE */ +cmdline: + .int (cmdline_end - cmdline) >> 2 /* .size */ + .int 0x54410009 /* .tag = ATAG_CMDLINE */ -+ .ascii "console=ttyefm" -+#ifdef CONFIG_EFM32GG_DK3750_FPGA -+ .ascii "1" -+#else -+ .ascii "4" -+#endif -+ .asciz ",115200 ignore_loglevel ihash_entries=64 dhash_entries=64 rootfstype=romfs init=/linuxrc uclinux.physaddr=0x8c000000 root=/dev/mtdblock0 earlyprintk" ++ .asciz "console=ttyefm4,115200 ignore_loglevel ihash_entries=64 dhash_entries=64 rootfstype=romfs init=/linuxrc uclinux.physaddr=0x8c000000 root=/dev/mtdblock0 earlyprintk" + .align 2, 0 +cmdline_end: + /* ATAG_NONE */ diff --git a/patches/linux-3.8-rc5/0019-HACK-don-t-reserve-memory-for-device-tree-if-it-s-be.patch b/patches/linux-3.8-rc5/0021-HACK-don-t-reserve-memory-for-device-tree-if-it-s-be.patch index b7f5680..b7f5680 100644 --- a/patches/linux-3.8-rc5/0019-HACK-don-t-reserve-memory-for-device-tree-if-it-s-be.patch +++ b/patches/linux-3.8-rc5/0021-HACK-don-t-reserve-memory-for-device-tree-if-it-s-be.patch diff --git a/patches/linux-3.8-rc5/0020-HACK-make-stack-dumps-provoked-by-BUG-a-bit-more-hel.patch b/patches/linux-3.8-rc5/0022-HACK-make-stack-dumps-provoked-by-BUG-a-bit-more-hel.patch index b99bcec..b99bcec 100644 --- a/patches/linux-3.8-rc5/0020-HACK-make-stack-dumps-provoked-by-BUG-a-bit-more-hel.patch +++ b/patches/linux-3.8-rc5/0022-HACK-make-stack-dumps-provoked-by-BUG-a-bit-more-hel.patch diff --git a/patches/linux-3.8-rc5/0024-HACK-work-around-for-big-images.patch b/patches/linux-3.8-rc5/0024-HACK-work-around-for-big-images.patch new file mode 100644 index 0000000..06691a1 --- /dev/null +++ b/patches/linux-3.8-rc5/0024-HACK-work-around-for-big-images.patch @@ -0,0 +1,20 @@ +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> +Date: Thu, 7 Feb 2013 09:43:24 +0100 +Subject: [PATCH] HACK! work around for big images + +--- + arch/arm/kernel/head-nommu.S | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S +index e2988bb..a6f510f 100644 +--- a/arch/arm/kernel/head-nommu.S ++++ b/arch/arm/kernel/head-nommu.S +@@ -61,6 +61,7 @@ ENTRY(stext) + #endif + bl __lookup_processor_type @ r5=procinfo r9=cpuid + movs r10, r5 @ invalid processor (r5=0)? ++ it eq + beq __error_p @ yes, error 'p' + + adr lr, BSYM(__after_proc_init) @ return (PIC) address diff --git a/patches/linux-3.8-rc5/series b/patches/linux-3.8-rc5/series index e84ac64..ba6a57b 100644 --- a/patches/linux-3.8-rc5/series +++ b/patches/linux-3.8-rc5/series @@ -16,11 +16,12 @@ 0014-Cortex-M3-Allow-the-building-of-Cortex-M3-kernel-por.patch 0015-ARM-new-platform-for-Energy-Micro-s-EFM32-Cortex-M3-.patch 0016-ARM-efm32-add-support-for-non-dt-builds-and-add-more.patch -0017-pinctrl-add-a-driver-for-Energy-Micro-s-efm32-SoCs.patch -0018-HACK-ARM-allow-a-bootloader-to-be-embedded-and-do-it.patch -0019-HACK-don-t-reserve-memory-for-device-tree-if-it-s-be.patch -0020-HACK-make-stack-dumps-provoked-by-BUG-a-bit-more-hel.patch -0021-ARM-v7m-add-trivial-suspend-support.patch -0022-ARM-efm32-add-trivial-suspend-support.patch +0017-efm-board-controller-driver.patch +0018-ARM-v7m-add-trivial-suspend-support.patch +0019-ARM-efm32-add-trivial-suspend-support.patch +0020-HACK-ARM-allow-a-bootloader-to-be-embedded-and-do-it.patch +0021-HACK-don-t-reserve-memory-for-device-tree-if-it-s-be.patch +0022-HACK-make-stack-dumps-provoked-by-BUG-a-bit-more-hel.patch 0023-HACK-ARM-increase-TASK_SIZE-for-MMU.patch -# 83f4722f8d8b5527b250fca17c57308a - git-ptx-patches magic +0024-HACK-work-around-for-big-images.patch +# 1659ab9769424059b871ff1ae1310d18 - git-ptx-patches magic |