EP93xx patches that have been floating for a while,

converting the platform to sparsemem, using SPI-MMC
 and a bit more.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZw4TxAAoJEEEQszewGV1zmM0P/0FNlDXZYfCtmFfol2iiIorK
 2dwdb5PlfolB8O36QGcvohCgPQEO61PH/0dsx2RU1UYJlpQEuxRFNYJWVc+LRFh8
 Pp/Kow+mKou0Fjfg1qtwRYVs9mjfJawR9MxBCs85GfIVncJGp82Kzv8OLFrZ5A3H
 A3ibecTQGbt8/3LXIrFLS1QI8PioDv36ig679IKGK2aDmmWAsmrt9ZsC0ZnXhdK7
 VvmezarpDUBXfxbcspUzOMW1BiO0Gzh8xPsBTyUZ1zBMYJo2rFH4OT6/AZfwl4Eb
 vayYnfjd7Y2E51AgHGj8e/GLq+bhRb3BD0m2Fm3NKZqNFtks0U4EutpNdl/ByDG0
 XkyEczv7tmiC7st/sKVvNo4x4hSCRuYmjWSxSdZHlR0tTPJ4YYJBrkZ3VcEIWFzn
 rAnI9HHNu6jihNKJ8mddxA0HcIAs9uRk6F6/vfxc21c+8GXfjkifssgpcKwbgpG9
 J0oOpUPFYKphDKuZBHGcgzUkewvjPYY7OaKl89lxc3dWXhoJ/Bg1G5kk1aQoPdwx
 OSN0S9b0+ItgNYcsnb2dKOlsKnoEXDwGBIFqrEnVDHgP3BiOTIrNFhvihsq78tFO
 E1RsSalo4Uba3HFQ1/cJBzpcRja4t0As/FRcIrkogYzLJ0F77tHvRjox05IVmvvT
 agHYN7VFApLst65ixdOd
 =TaBh
 -----END PGP SIGNATURE-----

Merge tag 'ep93xx-for-arm-soc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into next/soc

Pull "EP93xx improvements for v4.15"

EP93xx patches that have been floating for a while,
converting the platform to sparsemem, using SPI-MMC
and a bit more.

* tag 'ep93xx-for-arm-soc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
  ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards
  ARM: ep93xx: tidy up TS-72xx Watchdog resources
  ARM: ep93xx: simone: let the mmc_spi driver handle the card detect
  ARM: ep93xx: switch to SPARSEMEM
This commit is contained in:
Arnd Bergmann 2017-10-19 17:53:13 +02:00
commit e6fb383f5a
4 changed files with 39 additions and 66 deletions

View File

@ -378,7 +378,7 @@ config ARCH_EBSA110
config ARCH_EP93XX
bool "EP93xx-based"
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_SPARSEMEM_ENABLE
select ARM_AMBA
imply ARM_PATCH_PHYS_VIRT
select ARM_VIC

View File

@ -43,60 +43,12 @@ static struct ep93xxfb_mach_info __initdata simone_fb_info = {
.flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
};
/*
* GPIO lines used for MMC card detection.
*/
#define MMC_CARD_DETECT_GPIO EP93XX_GPIO_LINE_EGPIO0
/*
* MMC card detection GPIO setup.
*/
static int simone_mmc_spi_init(struct device *dev,
irqreturn_t (*irq_handler)(int, void *), void *mmc)
{
unsigned int gpio = MMC_CARD_DETECT_GPIO;
int irq, err;
err = gpio_request(gpio, dev_name(dev));
if (err)
return err;
err = gpio_direction_input(gpio);
if (err)
goto fail;
irq = gpio_to_irq(gpio);
if (irq < 0)
goto fail;
err = request_irq(irq, irq_handler, IRQF_TRIGGER_FALLING,
"MMC card detect", mmc);
if (err)
goto fail;
printk(KERN_INFO "%s: using irq %d for MMC card detection\n",
dev_name(dev), irq);
return 0;
fail:
gpio_free(gpio);
return err;
}
static void simone_mmc_spi_exit(struct device *dev, void *mmc)
{
unsigned int gpio = MMC_CARD_DETECT_GPIO;
free_irq(gpio_to_irq(gpio), mmc);
gpio_free(gpio);
}
static struct mmc_spi_platform_data simone_mmc_spi_data = {
.init = simone_mmc_spi_init,
.exit = simone_mmc_spi_exit,
.detect_delay = 500,
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
.flags = MMC_SPI_USE_CD_GPIO,
.cd_gpio = EP93XX_GPIO_LINE_EGPIO0,
.cd_debounce = 1,
};
static struct spi_board_info simone_spi_devices[] __initdata = {

View File

@ -18,7 +18,10 @@
#include <linux/io.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/spi/spi.h>
#include <linux/platform_data/spi-ep93xx.h>
#include <mach/gpio-ep93xx.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@ -186,24 +189,22 @@ static struct platform_device ts72xx_rtc_device = {
.num_resources = ARRAY_SIZE(ts72xx_rtc_resources),
};
/*************************************************************************
* Watchdog (in CPLD)
*************************************************************************/
#define TS72XX_WDT_CONTROL_PHYS_BASE (EP93XX_CS2_PHYS_BASE + 0x03800000)
#define TS72XX_WDT_FEED_PHYS_BASE (EP93XX_CS2_PHYS_BASE + 0x03c00000)
static struct resource ts72xx_wdt_resources[] = {
{
.start = TS72XX_WDT_CONTROL_PHYS_BASE,
.end = TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
{
.start = TS72XX_WDT_FEED_PHYS_BASE,
.end = TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, 0x01),
DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, 0x01),
};
static struct platform_device ts72xx_wdt_device = {
.name = "ts72xx-wdt",
.id = -1,
.num_resources = ARRAY_SIZE(ts72xx_wdt_resources),
.resource = ts72xx_wdt_resources,
.num_resources = ARRAY_SIZE(ts72xx_wdt_resources),
};
static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
@ -232,6 +233,27 @@ static struct platform_device ts73xx_fpga_device = {
#endif
/*************************************************************************
* SPI Bus
*************************************************************************/
static struct spi_board_info ts72xx_spi_devices[] __initdata = {
{
.modalias = "tmp122",
.max_speed_hz = 2 * 1000 * 1000,
.bus_num = 0,
.chip_select = 0,
},
};
static int ts72xx_spi_chipselects[] __initdata = {
EP93XX_GPIO_LINE_F(2), /* DIO_17 */
};
static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
.chipselect = ts72xx_spi_chipselects,
.num_chipselect = ARRAY_SIZE(ts72xx_spi_chipselects),
};
static void __init ts72xx_init_machine(void)
{
ep93xx_init_devices();
@ -244,6 +266,8 @@ static void __init ts72xx_init_machine(void)
if (board_is_ts7300())
platform_device_register(&ts73xx_fpga_device);
#endif
ep93xx_register_spi(&ts72xx_spi_info, ts72xx_spi_devices,
ARRAY_SIZE(ts72xx_spi_devices));
}
MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")

View File

@ -38,9 +38,6 @@
#define TS72XX_OPTIONS2_TS9420 0x04
#define TS72XX_OPTIONS2_TS9420_BOOT 0x02
#define TS72XX_WDT_CONTROL_PHYS_BASE 0x23800000
#define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000
#ifndef __ASSEMBLY__
static inline int ts72xx_model(void)