Commit aebbfafc authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC platform updates from Arnd Bergmann:
 "The APM X-Gene platform is now maintained by folks from Ampere
  computing that took over the product line a while ago, this gets
  reflected in the MAINTAINERS file.

  Cleanups continue on the older mach-davinci and mach-pxa platform, to
  get them to be more like the modern ones. For pxa, we now remove the
  Raumfeld platform code as it now works with device tree based booting.

  i.MX adds a couple new features for the i.MX7ULP SoC

  Mediatek gains support for a new SoC: MT7629 is a new wireless router
  platform, following MT7623.

  Aside from those, there are the usual minor cleanups and bugfixes
  across several platforms"

* tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (49 commits)
  MAINTAINERS: Update Ampere email address
  usb: ohci-da8xx: remove unused callbacks from platform data
  ARM: davinci: da830-evm: remove legacy usb helpers
  ARM: davinci: omapl138-hawk: remove legacy usb helpers
  usb: ohci-da8xx: add vbus and overcurrent gpios
  ARM: davinci: da830-evm: use gpio lookup entries for usb gpios
  ARM: davinci: omapl138-hawk: use gpio lookup entries for usb gpios
  usb: ohci-da8xx: add a helper pointer to &pdev->dev
  usb: ohci-da8xx: add a new line after local variables
  arm64: meson: enable g12a clock controller
  MAINTAINERS: Add entry for uDPU board
  ARM: davinci: da850-evm: use GPIO hogs instead of the legacy API
  arm: mediatek: add MT7629 smp bring up code
  Revert "ARM: mediatek: add MT7623a smp bringup code"
  dt-bindings: soc: fix typo of MT8173 power dt-bindings
  ARM: meson: remove COMMON_CLK_AMLOGIC selection
  arm64: meson: remove COMMON_CLK_AMLOGIC selection
  ARM: lpc32xx: remove platform data of ARM PL111 LCD controller
  ARM: lpc32xx: remove platform data of ARM PL180 SD/MMC controller
  ARM: lpc32xx: Use kmemdup to replace duplicating its implementation
  ...
parents fa29f5ba 49b35cd5
......@@ -1036,26 +1036,26 @@ F: drivers/net/appletalk/
F: net/appletalk/
APPLIED MICRO (APM) X-GENE DEVICE TREE SUPPORT
M: Duc Dang <dhdang@apm.com>
M: Khuong Dinh <khuong@os.amperecomputing.com>
S: Supported
F: arch/arm64/boot/dts/apm/
APPLIED MICRO (APM) X-GENE SOC EDAC
M: Loc Ho <lho@apm.com>
M: Khuong Dinh <khuong@os.amperecomputing.com>
S: Supported
F: drivers/edac/xgene_edac.c
F: Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
APPLIED MICRO (APM) X-GENE SOC ETHERNET (V2) DRIVER
M: Iyappan Subramanian <isubramanian@apm.com>
M: Keyur Chudgar <kchudgar@apm.com>
M: Iyappan Subramanian <iyappan@os.amperecomputing.com>
M: Keyur Chudgar <keyur@os.amperecomputing.com>
S: Supported
F: drivers/net/ethernet/apm/xgene-v2/
APPLIED MICRO (APM) X-GENE SOC ETHERNET DRIVER
M: Iyappan Subramanian <isubramanian@apm.com>
M: Keyur Chudgar <kchudgar@apm.com>
M: Quan Nguyen <qnguyen@apm.com>
M: Iyappan Subramanian <iyappan@os.amperecomputing.com>
M: Keyur Chudgar <keyur@os.amperecomputing.com>
M: Quan Nguyen <quan@os.amperecomputing.com>
S: Supported
F: drivers/net/ethernet/apm/xgene/
F: drivers/net/phy/mdio-xgene.c
......@@ -1063,7 +1063,7 @@ F: Documentation/devicetree/bindings/net/apm-xgene-enet.txt
F: Documentation/devicetree/bindings/net/apm-xgene-mdio.txt
APPLIED MICRO (APM) X-GENE SOC PMU
M: Tai Nguyen <ttnguyen@apm.com>
M: Khuong Dinh <khuong@os.amperecomputing.com>
S: Supported
F: drivers/perf/xgene_pmu.c
F: Documentation/perf/xgene-pmu.txt
......@@ -1530,21 +1530,14 @@ ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
M: Shawn Guo <shawnguo@kernel.org>
M: Sascha Hauer <s.hauer@pengutronix.de>
R: Pengutronix Kernel Team <kernel@pengutronix.de>
R: Fabio Estevam <fabio.estevam@nxp.com>
R: Fabio Estevam <festevam@gmail.com>
R: NXP Linux Team <linux-imx@nxp.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git
F: arch/arm/mach-imx/
F: arch/arm/mach-mxs/
F: arch/arm/boot/dts/imx*
F: arch/arm/configs/imx*_defconfig
F: arch/arm64/boot/dts/freescale/imx*
F: drivers/clk/imx/
F: drivers/firmware/imx/
F: drivers/soc/imx/
F: include/linux/firmware/imx/
F: include/soc/imx/
N: imx
N: mxs
X: drivers/media/i2c/
ARM/FREESCALE VYBRID ARM ARCHITECTURE
M: Shawn Guo <shawnguo@kernel.org>
......@@ -2108,6 +2101,8 @@ Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
S: Supported
F: arch/arm/boot/dts/emev2*
F: arch/arm/boot/dts/gr-peach*
F: arch/arm/boot/dts/iwg20d-q7*
F: arch/arm/boot/dts/r7s*
F: arch/arm/boot/dts/r8a*
F: arch/arm/boot/dts/r9a*
......@@ -9888,6 +9883,11 @@ S: Maintained
F: drivers/mtd/nand/raw/meson_*
F: Documentation/devicetree/bindings/mtd/amlogic,meson-nand.txt
METHODE UDPU SUPPORT
M: Vladimir Vid <vladimir.vid@sartura.hr>
S: Maintained
F: arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts
MICROBLAZE ARCHITECTURE
M: Michal Simek <monstr@monstr.eu>
W: http://www.monstr.eu/fdt/
......@@ -11613,7 +11613,7 @@ F: Documentation/devicetree/bindings/pci/altera-pcie.txt
F: drivers/pci/controller/pcie-altera.c
PCI DRIVER FOR APPLIEDMICRO XGENE
M: Tanmay Inamdar <tinamdar@apm.com>
M: Toan Le <toan@os.amperecomputing.com>
L: linux-pci@vger.kernel.org
L: linux-arm-kernel@lists.infradead.org
S: Maintained
......@@ -11791,7 +11791,7 @@ F: Documentation/devicetree/bindings/pci/altera-pcie-msi.txt
F: drivers/pci/controller/pcie-altera-msi.c
PCI MSI DRIVER FOR APPLIEDMICRO XGENE
M: Duc Dang <dhdang@apm.com>
M: Toan Le <toan@os.amperecomputing.com>
L: linux-pci@vger.kernel.org
L: linux-arm-kernel@lists.infradead.org
S: Maintained
......@@ -14759,7 +14759,7 @@ S: Maintained
F: drivers/tty/serial/8250/8250_dw.c
SYNOPSYS DESIGNWARE APB GPIO DRIVER
M: Hoan Tran <hotran@apm.com>
M: Hoan Tran <hoan@os.amperecomputing.com>
L: linux-gpio@vger.kernel.org
S: Maintained
F: drivers/gpio/gpio-dwapb.c
......
......@@ -66,9 +66,6 @@ CONFIG_MACH_MIOA701=y
CONFIG_PXA_EZX=y
CONFIG_MACH_MP900C=y
CONFIG_ARCH_PXA_PALM=y
CONFIG_MACH_RAUMFELD_RC=y
CONFIG_MACH_RAUMFELD_CONNECTOR=y
CONFIG_MACH_RAUMFELD_SPEAKER=y
CONFIG_PXA_SHARPSL=y
CONFIG_MACH_POODLE=y
CONFIG_MACH_CORGI=y
......@@ -498,7 +495,6 @@ CONFIG_SND_PXA2XX_SOC_E800=m
CONFIG_SND_PXA2XX_SOC_EM_X270=m
CONFIG_SND_PXA2XX_SOC_PALM27X=y
CONFIG_SND_SOC_ZYLONITE=m
CONFIG_SND_SOC_RAUMFELD=m
CONFIG_SND_PXA2XX_SOC_HX4700=m
CONFIG_SND_PXA2XX_SOC_MAGICIAN=m
CONFIG_SND_PXA2XX_SOC_MIOA701=m
......
# CONFIG_LOCALVERSION_AUTO is not set
# CONFIG_SWAP is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_LBDAF is not set
# CONFIG_BLK_DEV_BSG is not set
CONFIG_ARCH_PXA=y
CONFIG_MACH_RAUMFELD_RC=y
CONFIG_MACH_RAUMFELD_CONNECTOR=y
CONFIG_MACH_RAUMFELD_SPEAKER=y
CONFIG_NO_HZ=y
CONFIG_AEABI=y
# CONFIG_OABI_COMPAT is not set
CONFIG_CMDLINE="console=ttyS0,115200 rw"
CONFIG_CPU_FREQ=y
CONFIG_CPU_IDLE=y
CONFIG_PM=y
CONFIG_APM_EMULATION=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_PNP=y
CONFIG_SYN_COOKIES=y
CONFIG_IPV6=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_NFTL=y
CONFIG_NFTL_RW=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_MARVELL=y
CONFIG_MTD_UBI=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_ISL29003=y
CONFIG_IIO=y
CONFIG_AD5446=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
CONFIG_NETDEVICES=y
CONFIG_NET_ETHERNET=y
CONFIG_SMSC911X=y
CONFIG_LIBERTAS=y
CONFIG_LIBERTAS_SDIO=m
CONFIG_USB_USBNET=y
# CONFIG_USB_NET_AX8817X is not set
# CONFIG_USB_NET_NET1080 is not set
CONFIG_USB_NET_MCS7830=y
# CONFIG_USB_NET_CDC_SUBSET is not set
# CONFIG_USB_NET_ZAURUS is not set
CONFIG_INPUT_EVDEV=y
CONFIG_KEYBOARD_GPIO=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_EETI=m
CONFIG_INPUT_MISC=y
CONFIG_INPUT_GPIO_ROTARY_ENCODER=y
CONFIG_SERIAL_PXA=y
CONFIG_SERIAL_PXA_CONSOLE=y
CONFIG_HW_RANDOM=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_PXA=y
CONFIG_SPI=y
CONFIG_SPI_DEBUG=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_SPIDEV=y
CONFIG_DEBUG_GPIO=y
CONFIG_W1_MASTER_GPIO=m
CONFIG_POWER_SUPPLY=y
CONFIG_PDA_POWER=y
CONFIG_BATTERY_DS2760=m
CONFIG_SENSORS_LIS3_SPI=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_DEBUG=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_MAX8660=y
CONFIG_FB=y
CONFIG_FB_PXA=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_BACKLIGHT_PWM=y
# CONFIG_VGA_CONSOLE is not set
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
# CONFIG_LOGO_LINUX_CLUT224 is not set
CONFIG_SOUND=y
CONFIG_SND=y
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_USB is not set
CONFIG_SND_SOC=y
CONFIG_SND_PXA2XX_SOC=y
CONFIG_SND_SOC_RAUMFELD=y
CONFIG_HID_DRAGONRISE=y
CONFIG_HID_GYRATION=y
CONFIG_HID_TWINHAN=y
CONFIG_HID_NTRIG=y
CONFIG_HID_PANTHERLORD=y
CONFIG_HID_PETALYNX=y
CONFIG_HID_SAMSUNG=y
CONFIG_HID_SONY=y
CONFIG_HID_SUNPLUS=y
CONFIG_HID_GREENASIA=y
CONFIG_HID_SMARTJOYPLUS=y
CONFIG_HID_TOPSEED=y
CONFIG_HID_THRUSTMASTER=y
CONFIG_HID_ZEROPLUS=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_MON=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_USBAT=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_MMC=y
CONFIG_MMC_PXA=m
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_LT3593=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_PXA=y
CONFIG_DMADEVICES=y
CONFIG_UIO=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XIP=y
CONFIG_EXT3_FS=y
CONFIG_FSCACHE=y
CONFIG_FSCACHE_STATS=y
CONFIG_CACHEFILES=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y
CONFIG_NFS_FSCACHE=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=y
CONFIG_NLS_CODEPAGE_775=y
CONFIG_NLS_CODEPAGE_850=y
CONFIG_NLS_CODEPAGE_852=y
CONFIG_NLS_CODEPAGE_855=y
CONFIG_NLS_CODEPAGE_857=y
CONFIG_NLS_CODEPAGE_860=y
CONFIG_NLS_CODEPAGE_861=y
CONFIG_NLS_CODEPAGE_862=y
CONFIG_NLS_CODEPAGE_863=y
CONFIG_NLS_CODEPAGE_864=y
CONFIG_NLS_CODEPAGE_865=y
CONFIG_NLS_CODEPAGE_866=y
CONFIG_NLS_CODEPAGE_869=y
CONFIG_NLS_CODEPAGE_936=y
CONFIG_NLS_CODEPAGE_950=y
CONFIG_NLS_CODEPAGE_932=y
CONFIG_NLS_CODEPAGE_949=y
CONFIG_NLS_CODEPAGE_874=y
CONFIG_NLS_ISO8859_8=y
CONFIG_NLS_CODEPAGE_1250=y
CONFIG_NLS_CODEPAGE_1251=y
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=y
CONFIG_NLS_ISO8859_3=y
CONFIG_NLS_ISO8859_4=y
CONFIG_NLS_ISO8859_5=y
CONFIG_NLS_ISO8859_6=y
CONFIG_NLS_ISO8859_7=y
CONFIG_NLS_ISO8859_9=y
CONFIG_NLS_ISO8859_13=y
CONFIG_NLS_ISO8859_14=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_KOI8_R=y
CONFIG_NLS_KOI8_U=y
CONFIG_NLS_UTF8=y
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_LL=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_HW is not set
......@@ -18,7 +18,7 @@
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/platform_data/pcf857x.h>
#include <linux/platform_data/at24.h>
#include <linux/property.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/spi/spi.h>
......@@ -52,62 +52,19 @@ static const short da830_evm_usb11_pins[] = {
-1
};
static da8xx_ocic_handler_t da830_evm_usb_ocic_handler;
static int da830_evm_usb_set_power(unsigned port, int on)
{
gpio_set_value(ON_BD_USB_DRV, on);
return 0;
}
static int da830_evm_usb_get_power(unsigned port)
{
return gpio_get_value(ON_BD_USB_DRV);
}
static int da830_evm_usb_get_oci(unsigned port)
{
return !gpio_get_value(ON_BD_USB_OVC);
}
static irqreturn_t da830_evm_usb_ocic_irq(int, void *);
static int da830_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
{
int irq = gpio_to_irq(ON_BD_USB_OVC);
int error = 0;
if (handler != NULL) {
da830_evm_usb_ocic_handler = handler;
error = request_irq(irq, da830_evm_usb_ocic_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
"OHCI over-current indicator", NULL);
if (error)
pr_err("%s: could not request IRQ to watch over-current indicator changes\n",
__func__);
} else
free_irq(irq, NULL);
return error;
}
static struct gpiod_lookup_table da830_evm_usb_gpio_lookup = {
.dev_id = "ohci-da8xx",
.table = {
GPIO_LOOKUP("davinci_gpio", ON_BD_USB_DRV, "vbus", 0),
GPIO_LOOKUP("davinci_gpio", ON_BD_USB_OVC, "oc", 0),
},
};
static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = {
.set_power = da830_evm_usb_set_power,
.get_power = da830_evm_usb_get_power,
.get_oci = da830_evm_usb_get_oci,
.ocic_notify = da830_evm_usb_ocic_notify,
/* TPS2065 switch @ 5V */
.potpgt = (3 + 1) / 2, /* 3 ms max */
};
static irqreturn_t da830_evm_usb_ocic_irq(int irq, void *dev_id)
{
da830_evm_usb_ocic_handler(&da830_evm_usb11_pdata, 1);
return IRQ_HANDLED;
}
static __init void da830_evm_usb_init(void)
{
int ret;
......@@ -142,21 +99,7 @@ static __init void da830_evm_usb_init(void)
return;
}
ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
if (ret) {
pr_err("%s: failed to request GPIO for USB 1.1 port power control: %d\n",
__func__, ret);
return;
}
gpio_direction_output(ON_BD_USB_DRV, 0);
ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
if (ret) {
pr_err("%s: failed to request GPIO for USB 1.1 port over-current indicator: %d\n",
__func__, ret);
return;
}
gpio_direction_input(ON_BD_USB_OVC);
gpiod_add_lookup_table(&da830_evm_usb_gpio_lookup);
ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
if (ret)
......@@ -457,12 +400,9 @@ static struct nvmem_cell_lookup da830_evm_nvmem_cell_lookup = {
.con_id = "mac-address",
};
static struct at24_platform_data da830_evm_i2c_eeprom_info = {
.byte_len = SZ_256K / 8,
.page_size = 64,
.flags = AT24_FLAG_ADDR16,
.setup = davinci_get_mac_addr,
.context = (void *)0x7f00,
static const struct property_entry da830_evm_i2c_eeprom_properties[] = {
PROPERTY_ENTRY_U32("pagesize", 64),
{ }
};
static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
......@@ -496,7 +436,7 @@ static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
{
I2C_BOARD_INFO("24c256", 0x50),
.platform_data = &da830_evm_i2c_eeprom_info,
.properties = da830_evm_i2c_eeprom_properties,
},
{
I2C_BOARD_INFO("tlv320aic3x", 0x18),
......
......@@ -150,32 +150,6 @@ static struct spi_board_info da850evm_spi_info[] = {
},
};
#ifdef CONFIG_MTD
static void da850_evm_m25p80_notify_add(struct mtd_info *mtd)
{
char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
size_t retlen;
if (!strcmp(mtd->name, "MAC-Address")) {
mtd_read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
if (retlen == ETH_ALEN)
pr_info("Read MAC addr from SPI Flash: %pM\n",
mac_addr);
}
}
static struct mtd_notifier da850evm_spi_notifier = {
.add = da850_evm_m25p80_notify_add,
};
static void da850_evm_setup_mac_addr(void)
{
register_mtd_user(&da850evm_spi_notifier);
}
#else
static void da850_evm_setup_mac_addr(void) { }
#endif
static struct mtd_partition da850_evm_norflash_partition[] = {
{
.name = "bootloaders + env",
......@@ -1064,6 +1038,17 @@ static const short da850_evm_rmii_pins[] = {
-1
};
static struct gpiod_hog da850_evm_emac_gpio_hogs[] = {
{
.chip_label = "davinci_gpio",
.chip_hwnum = DA850_MII_MDIO_CLKEN_PIN,
.line_name = "mdio_clk_en",
.lflags = 0,
/* dflags set in da850_evm_config_emac() */
},
{ }
};
static int __init da850_evm_config_emac(void)
{
void __iomem *cfg_chip3_base;
......@@ -1102,14 +1087,9 @@ static int __init da850_evm_config_emac(void)
if (ret)
pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
if (ret) {
pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
return ret;
}
/* Enable/Disable MII MDIO clock */
gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
da850_evm_emac_gpio_hogs[0].dflags = rmii_en ? GPIOD_OUT_HIGH
: GPIOD_OUT_LOW;
gpiod_add_hogs(da850_evm_emac_gpio_hogs);
soc_info->emac_pdata->phy_id = DA850_EVM_PHY_ID;
......@@ -1494,8 +1474,6 @@ static __init void da850_evm_init(void)
if (ret)
pr_warn("%s: SATA registration failed: %d\n", __func__, ret);
da850_evm_setup_mac_addr();
ret = da8xx_register_rproc();
if (ret)
pr_warn("%s: dsp/rproc registration failed: %d\n",
......
......@@ -18,7 +18,7 @@
#include <linux/i2c.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/platform_data/at24.h>
#include <linux/property.h>
#include <linux/leds.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
......@@ -225,18 +225,15 @@ static struct nvmem_cell_lookup davinci_nvmem_cell_lookup = {
.con_id = "mac-address",
};
static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8,
.page_size = 64,
.flags = AT24_FLAG_ADDR16,
.setup = davinci_get_mac_addr,
.context = (void *)0x7f00,
static const struct property_entry eeprom_properties[] = {
PROPERTY_ENTRY_U32("pagesize", 64),
{ }
};
static struct i2c_board_info i2c_info[] = {
{
I2C_BOARD_INFO("24c256", 0x50),
.platform_data = &eeprom_info,
.properties = eeprom_properties,
},
{
I2C_BOARD_INFO("tlv320aic3x", 0x18),
......
......@@ -16,8 +16,8 @@
#include <linux/gpio/machine.h>
#include <linux/i2c.h>
#include <linux/platform_data/pcf857x.h>
#include <linux/platform_data/at24.h>
#include <linux/platform_data/gpio-davinci.h>
#include <linux/property.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
......@@ -532,12 +532,9 @@ static struct nvmem_cell_lookup dm644evm_nvmem_cell_lookup = {
.con_id = "mac-address",
};
static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8,
.page_size = 64,
.flags = AT24_FLAG_ADDR16,
.setup = davinci_get_mac_addr,
.context = (void *)0x7f00,
static const struct property_entry eeprom_properties[] = {
PROPERTY_ENTRY_U32("pagesize", 64),
{ }
};
/*
......@@ -647,7 +644,7 @@ static struct i2c_board_info __initdata i2c_info[] = {
},
{
I2C_BOARD_INFO("24c256", 0x50),
.platform_data = &eeprom_info,
.properties = eeprom_properties,
},
{
I2C_BOARD_INFO("tlv320aic33", 0x1b),
......
......@@ -22,7 +22,7 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/platform_data/at24.h>
#include <linux/property.h>
#include <linux/platform_data/pcf857x.h>
#include <linux/platform_data/ti-aemif.h>
......@@ -364,12 +364,9 @@ static struct nvmem_cell_lookup dm646x_evm_nvmem_cell_lookup = {
.con_id = "mac-address",
};
static struct at24_platform_data eeprom_info = {
.byte_len = (256*1024) / 8,
.page_size = 64,
.flags = AT24_FLAG_ADDR16,
.setup = davinci_get_mac_addr,
.context = (void *)0x7f00,
static const struct property_entry eeprom_properties[] = {
PROPERTY_ENTRY_U32("pagesize", 64),
{ }
};
#endif
......@@ -440,7 +437,7 @@ static void evm_init_cpld(void)
static struct i2c_board_info __initdata i2c_info[] = {
{
I2C_BOARD_INFO("24c256", 0x50),
.platform_data = &eeprom_info,
.properties = eeprom_properties,
},
{
I2C_BOARD_INFO("pcf8574a", 0x38),
......
......@@ -14,11 +14,13 @@
#include <linux/init.h>
#include <linux/console.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/mtd/partitions.h>
#include <linux/notifier.h>
#include <linux/nvmem-consumer.h>
#include <linux/nvmem-provider.h>
#include <linux/regulator/machine.h>
#include <linux/i2c.h>
#include <linux/platform_data/at24.h>
#include <linux/etherdevice.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
......@@ -117,11 +119,15 @@ static void mityomapl138_cpufreq_init(const char *partnum)
static void mityomapl138_cpufreq_init(const char *partnum) { }
#endif
static void read_factory_config(struct nvmem_device *nvmem, void *context)
static int read_factory_config(struct notifier_block *nb,
unsigned long event, void *data)
{
int ret;
const char *partnum = NULL;
struct davinci_soc_info *soc_info = &davinci_soc_info;
struct nvmem_device *nvmem = data;
if (strcmp(nvmem_dev_name(nvmem), "1-00500") != 0)
return NOTIFY_DONE;
if (!IS_BUILTIN(CONFIG_NVMEM)) {
pr_warn("Factory Config not available without CONFIG_NVMEM\n");
......@@ -147,21 +153,20 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
goto bad_config;
}
pr_info("Found MAC = %pM\n", factory_config.mac);
if (is_valid_ether_addr(factory_config.mac))
memcpy(soc_info->emac_pdata->mac_addr,
factory_config.mac, ETH_ALEN);
else
pr_warn("Invalid MAC found in factory config block\n");
partnum = factory_config.partnum;
pr_info("Part Number = %s\n", partnum);
bad_config:
/* default maximum speed is valid for all platforms */
mityomapl138_cpufreq_init(partnum);
return NOTIFY_STOP;
}
static struct notifier_block mityomapl138_nvmem_notifier = {
.notifier_call = read_factory_config,
};
/*
* We don't define a cell for factory config as it will be accessed from the
* board file using the nvmem notifier chain.
......@@ -187,12 +192,10 @@ static struct nvmem_cell_lookup mityomapl138_nvmem_cell_lookup = {
.con_id = "mac-address",
};
static struct at24_platform_data mityomapl138_fd_chip = {
.byte_len = 256,
.page_size = 8,
.flags = AT24_FLAG_READONLY | AT24_FLAG_IRUGO,
.setup = read_factory_config,
.context = NULL,
static const struct property_entry mityomapl138_fd_chip_properties[] = {
PROPERTY_ENTRY_U32("pagesize", 8),
PROPERTY_ENTRY_BOOL("read-only"),
{ }
};
static struct davinci_i2c_platform_data mityomap_i2c_0_pdata = {
......@@ -321,7 +324,7 @@ static struct i2c_board_info __initdata mityomap_tps65023_info[] = {
},
{
I2C_BOARD_INFO("24c02", 0x50),
.platform_data = &mityomapl138_fd_chip,
.properties = mityomapl138_fd_chip_properties,
},
};
......@@ -569,6 +572,7 @@ static void __init mityomapl138_init(void)
davinci_serial_init(da8xx_serial_device);
nvmem_register_notifier(&mityomapl138_nvmem_notifier);
nvmem_add_cell_table(&mityomapl138_nvmem_cell_table);
nvmem_add_cell_lookups(&mityomapl138_nvmem_cell_lookup, 1);
......
......@@ -294,66 +294,24 @@ static int omapl138_hawk_register_aemif(void)
return platform_device_register(&omapl138_hawk_aemif_device);
}
static irqreturn_t omapl138_hawk_usb_ocic_irq(int irq, void *dev_id);
static da8xx_ocic_handler_t hawk_usb_ocic_handler;
static const short da850_hawk_usb11_pins[] = {
DA850_GPIO2_4, DA850_GPIO6_13,
-1
};
static int hawk_usb_set_power(unsigned port, int on)
{
gpio_set_value(DA850_USB1_VBUS_PIN, on);
return 0;
}
static int hawk_usb_get_power(unsigned port)
{
return gpio_get_value(DA850_USB1_VBUS_PIN);
}
static int hawk_usb_get_oci(unsigned port)
{
return !gpio_get_value(DA850_USB1_OC_PIN);
}
static int hawk_usb_ocic_notify(da8xx_ocic_handler_t handler)
{
int irq = gpio_to_irq(DA850_USB1_OC_PIN);
int error = 0;
if (handler != NULL) {
hawk_usb_ocic_handler = handler;
error = request_irq(irq, omapl138_hawk_usb_ocic_irq,
IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING,
"OHCI over-current indicator", NULL);
if (error)
pr_err("%s: could not request IRQ to watch "
"over-current indicator changes\n", __func__);
} else {
free_irq(irq, NULL);
}
return error;
}
static struct gpiod_lookup_table hawk_usb_gpio_lookup = {
.dev_id = "ohci-da8xx",
.table = {
GPIO_LOOKUP("davinci_gpio", DA850_USB1_VBUS_PIN, "vbus", 0),
GPIO_LOOKUP("davinci_gpio", DA850_USB1_OC_PIN, "oc", 0),
},
};
static struct da8xx_ohci_root_hub omapl138_hawk_usb11_pdata = {
.set_power = hawk_usb_set_power,
.get_power = hawk_usb_get_power,
.get_oci = hawk_usb_get_oci,
.ocic_notify = hawk_usb_ocic_notify,
/* TPS2087 switch @ 5V */
.potpgt = (3 + 1) / 2, /* 3 ms max */
};
static irqreturn_t omapl138_hawk_usb_ocic_irq(int irq, void *dev_id)
{
hawk_usb_ocic_handler(&omapl138_hawk_usb11_pdata, 1);
return IRQ_HANDLED;
}
static __init void omapl138_hawk_usb_init(void)
{
int ret;
......@@ -374,34 +332,13 @@ static __init void omapl138_hawk_usb_init(void)
pr_warn("%s: USB PHY registration failed: %d\n",
__func__, ret);
ret = gpio_request_one(DA850_USB1_VBUS_PIN,
GPIOF_DIR_OUT, "USB1 VBUS");
if (ret < 0) {
pr_err("%s: failed to request GPIO for USB 1.1 port "
"power control: %d\n", __func__, ret);
return;
}
ret = gpio_request_one(DA850_USB1_OC_PIN,
GPIOF_DIR_IN, "USB1 OC");
if (ret < 0) {
pr_err("%s: failed to request GPIO for USB 1.1 port "
"over-current indicator: %d\n", __func__, ret);
goto usb11_setup_oc_fail;
}
gpiod_add_lookup_table(&hawk_usb_gpio_lookup);
ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata);
if (ret) {
if (ret)
pr_warn("%s: USB 1.1 registration failed: %d\n", __func__, ret);
goto usb11_setup_fail;
}
return;
usb11_setup_fail:
gpio_free(DA850_USB1_OC_PIN);
usb11_setup_oc_fail:
gpio_free(DA850_USB1_VBUS_PIN);
}
static __init void omapl138_hawk_init(void)
......
......@@ -26,7 +26,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/platform_data/at24.h>
#include <linux/property.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
......@@ -92,16 +92,15 @@ static struct platform_device davinci_sffsdr_nandflash_device = {
.resource = davinci_sffsdr_nandflash_resource,
};
static struct at24_platform_data eeprom_info = {
.byte_len = (64*1024) / 8,
.page_size = 32,
.flags = AT24_FLAG_ADDR16,
static const struct property_entry eeprom_properties[] = {
PROPERTY_ENTRY_U32("pagesize", 32),
{ }
};
static struct i2c_board_info __initdata i2c_info[] = {
{
I2C_BOARD_INFO("24lc64", 0x50),
.platform_data = &eeprom_info,
I2C_BOARD_INFO("24c64", 0x50),
.properties = eeprom_properties,
},
/* Other I2C devices:
* MSP430, addr 0x23 (not used)
......
......@@ -26,21 +26,6 @@ EXPORT_SYMBOL(davinci_soc_info);
void __iomem *davinci_intc_base;
int davinci_intc_type;
void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context)
{
char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
off_t offset = (off_t)context;
if (!IS_BUILTIN(CONFIG_NVMEM)) {
pr_warn("Cannot read MAC addr from EEPROM without CONFIG_NVMEM\n");
return;
}
/* Read MAC addr from EEPROM */
if (nvmem_device_read(nvmem, offset, ETH_ALEN, mac_addr) == ETH_ALEN)
pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
}
static int __init davinci_init_id(struct davinci_soc_info *soc_info)
{
int i;
......
......@@ -26,7 +26,6 @@
#include <mach/gpio-ep93xx.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <mach/gpio-ep93xx.h>
#include <asm/mach-types.h>
#include <asm/mach/map.h>
......
......@@ -336,9 +336,9 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
/* wait max 10 ms until cpu1 is on */
while (exynos_cpu_power_state(core_id)
!= S5P_CORE_LOCAL_PWR_EN) {
if (timeout-- == 0)
if (timeout == 0)
break;
timeout--;
mdelay(1);
}
......
......@@ -29,9 +29,10 @@ obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o
obj-$(CONFIG_SOC_IMX6SLL) += cpuidle-imx6sx.o
obj-$(CONFIG_SOC_IMX6SX) += cpuidle-imx6sx.o
obj-$(CONFIG_SOC_IMX6UL) += cpuidle-imx6sx.o
obj-$(CONFIG_SOC_IMX7ULP) += cpuidle-imx7ulp.o
endif
ifdef CONFIG_SND_IMX_SOC
ifdef CONFIG_SND_SOC_IMX_PCM_FIQ
obj-y += ssi-fiq.o
obj-y += ssi-fiq-ksym.o
endif
......
......@@ -72,6 +72,15 @@ enum mxc_cpu_pwr_mode {
STOP_POWER_OFF, /* STOP + SRPG */
};
enum ulp_cpu_pwr_mode {
ULP_PM_HSRUN, /* High speed run mode */
ULP_PM_RUN, /* Run mode */
ULP_PM_WAIT, /* Wait mode */
ULP_PM_STOP, /* Stop mode */
ULP_PM_VLPS, /* Very low power stop mode */
ULP_PM_VLLS, /* very low leakage stop mode */
};
void imx_enable_cpu(int cpu, bool enable);
void imx_set_cpu_jump(int cpu, void *jump_addr);
u32 imx_get_cpu_arg(int cpu);
......@@ -98,6 +107,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode);
void imx6_set_int_mem_clk_lpm(bool enable);
void imx6sl_set_wait_clk(bool enter);
int imx_mmdc_get_ddr_type(void);
int imx7ulp_set_lpm(enum ulp_cpu_pwr_mode mode);
void imx_cpu_die(unsigned int cpu);
int imx_cpu_kill(unsigned int cpu);
......
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2016 Freescale Semiconductor, Inc.
* Copyright 2017-2018 NXP
* Anson Huang <Anson.Huang@nxp.com>
*/
#include <linux/cpuidle.h>
#include <linux/module.h>
#include <asm/cpuidle.h>
#include "common.h"
#include "cpuidle.h"
static int imx7ulp_enter_wait(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index)
{
if (index == 1)
imx7ulp_set_lpm(ULP_PM_WAIT);
else
imx7ulp_set_lpm(ULP_PM_STOP);
cpu_do_idle();
imx7ulp_set_lpm(ULP_PM_RUN);
return index;
}
static struct cpuidle_driver imx7ulp_cpuidle_driver = {
.name = "imx7ulp_cpuidle",
.owner = THIS_MODULE,
.states = {
/* WFI */
ARM_CPUIDLE_WFI_STATE,
/* WAIT */
{
.exit_latency = 50,
.target_residency = 75,
.enter = imx7ulp_enter_wait,
.name = "WAIT",
.desc = "PSTOP2",
},
/* STOP */
{
.exit_latency = 100,
.target_residency = 150,
.enter = imx7ulp_enter_wait,
.name = "STOP",
.desc = "PSTOP1",
},
},
.state_count = 3,
.safe_state_index = 0,
};
int __init imx7ulp_cpuidle_init(void)
{
return cpuidle_register(&imx7ulp_cpuidle_driver, NULL);
}
......@@ -15,6 +15,7 @@ extern int imx5_cpuidle_init(void);
extern int imx6q_cpuidle_init(void);
extern int imx6sl_cpuidle_init(void);
extern int imx6sx_cpuidle_init(void);
extern int imx7ulp_cpuidle_init(void);
#else
static inline int imx5_cpuidle_init(void)
{
......@@ -32,4 +33,8 @@ static inline int imx6sx_cpuidle_init(void)
{
return 0;
}
static inline int imx7ulp_cpuidle_init(void)
{
return 0;
}
#endif
......@@ -6,17 +6,57 @@
*/
#include <linux/irqchip.h>
#include <linux/mfd/syscon.h>
#include <linux/of_platform.h>
#include <linux/regmap.h>
#include <asm/mach/arch.h>
#include "common.h"
#include "cpuidle.h"
#include "hardware.h"
#define SIM_JTAG_ID_REG 0x8c
static void __init imx7ulp_set_revision(void)
{
struct regmap *sim;
u32 revision;
sim = syscon_regmap_lookup_by_compatible("fsl,imx7ulp-sim");
if (IS_ERR(sim)) {
pr_warn("failed to find fsl,imx7ulp-sim regmap!\n");
return;
}
if (regmap_read(sim, SIM_JTAG_ID_REG, &revision)) {
pr_warn("failed to read sim regmap!\n");
return;
}
/*
* bit[31:28] of JTAG_ID register defines revision as below from B0:
* 0001 B0
* 0010 B1
*/
switch (revision >> 28) {
case 1:
imx_set_soc_revision(IMX_CHIP_REVISION_2_0);
break;
case 2:
imx_set_soc_revision(IMX_CHIP_REVISION_2_1);
break;
default:
imx_set_soc_revision(IMX_CHIP_REVISION_1_0);
break;
}
}
static void __init imx7ulp_init_machine(void)
{
imx7ulp_pm_init();
mxc_set_cpu_type(MXC_CPU_IMX7ULP);
imx7ulp_set_revision();
of_platform_default_populate(NULL, NULL, imx_soc_device_init());
}
......@@ -25,7 +65,13 @@ static const char *const imx7ulp_dt_compat[] __initconst = {
NULL,
};
static void __init imx7ulp_init_late(void)
{
imx7ulp_cpuidle_init();
}
DT_MACHINE_START(IMX7ulp, "Freescale i.MX7ULP (Device Tree)")
.init_machine = imx7ulp_init_machine,
.dt_compat = imx7ulp_dt_compat,
.init_late = imx7ulp_init_late,
MACHINE_END
......@@ -9,21 +9,60 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include "common.h"
#define SMC_PMCTRL 0x10
#define BP_PMCTRL_PSTOPO 16
#define PSTOPO_PSTOP3 0x3
#define PSTOPO_PSTOP2 0x2
#define PSTOPO_PSTOP1 0x1
#define BP_PMCTRL_RUNM 8
#define RUNM_RUN 0
#define BP_PMCTRL_STOPM 0
#define STOPM_STOP 0
#define BM_PMCTRL_PSTOPO (3 << BP_PMCTRL_PSTOPO)
#define BM_PMCTRL_RUNM (3 << BP_PMCTRL_RUNM)
#define BM_PMCTRL_STOPM (7 << BP_PMCTRL_STOPM)
static void __iomem *smc1_base;
int imx7ulp_set_lpm(enum ulp_cpu_pwr_mode mode)
{
u32 val = readl_relaxed(smc1_base + SMC_PMCTRL);
/* clear all */
val &= ~(BM_PMCTRL_RUNM | BM_PMCTRL_STOPM | BM_PMCTRL_PSTOPO);
switch (mode) {
case ULP_PM_RUN:
/* system/bus clock enabled */
val |= PSTOPO_PSTOP3 << BP_PMCTRL_PSTOPO;
break;
case ULP_PM_WAIT:
/* system clock disabled, bus clock enabled */
val |= PSTOPO_PSTOP2 << BP_PMCTRL_PSTOPO;
break;
case ULP_PM_STOP:
/* system/bus clock disabled */
val |= PSTOPO_PSTOP1 << BP_PMCTRL_PSTOPO;
break;
default:
return -EINVAL;
}
writel_relaxed(val, smc1_base + SMC_PMCTRL);
return 0;
}
void __init imx7ulp_pm_init(void)
{
struct device_node *np;
void __iomem *smc1_base;
np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-smc1");
smc1_base = of_iomap(np, 0);
WARN_ON(!smc1_base);
/* Partial Stop mode 3 with system/bus clock enabled */
writel_relaxed(PSTOPO_PSTOP3 << BP_PMCTRL_PSTOPO,
smc1_base + SMC_PMCTRL);
iounmap(smc1_base);
imx7ulp_set_lpm(ULP_PM_RUN);
}
......@@ -45,73 +45,6 @@
#include <mach/board.h>
#include "common.h"
/*
* AMBA LCD controller
*/
static struct clcd_panel conn_lcd_panel = {
.mode = {
.name = "QVGA portrait",
.refresh = 60,
.xres = 240,
.yres = 320,
.pixclock = 191828,
.left_margin = 22,
.right_margin = 11,
.upper_margin = 2,
.lower_margin = 1,
.hsync_len = 5,
.vsync_len = 2,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
},
.width = -1,
.height = -1,
.tim2 = (TIM2_IVS | TIM2_IHS),
.cntl = (CNTL_BGR | CNTL_LCDTFT | CNTL_LCDVCOMP(1) |
CNTL_LCDBPP16_565),
.bpp = 16,
};
#define PANEL_SIZE (3 * SZ_64K)
static int lpc32xx_clcd_setup(struct clcd_fb *fb)
{
dma_addr_t dma;
fb->fb.screen_base = dma_alloc_wc(&fb->dev->dev, PANEL_SIZE, &dma,
GFP_KERNEL);
if (!fb->fb.screen_base) {
printk(KERN_ERR "CLCD: unable to map framebuffer\n");
return -ENOMEM;
}
fb->fb.fix.smem_start = dma;
fb->fb.fix.smem_len = PANEL_SIZE;
fb->panel = &conn_lcd_panel;
return 0;
}
static int lpc32xx_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
{
return dma_mmap_wc(&fb->dev->dev, vma, fb->fb.screen_base,
fb->fb.fix.smem_start, fb->fb.fix.smem_len);
}
static void lpc32xx_clcd_remove(struct clcd_fb *fb)
{
dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base,
fb->fb.fix.smem_start);
}
static struct clcd_board lpc32xx_clcd_data = {
.name = "Phytec LCD",
.check = clcdfb_check,
.decode = clcdfb_decode,
.setup = lpc32xx_clcd_setup,
.mmap = lpc32xx_clcd_mmap,
.remove = lpc32xx_clcd_remove,
};
static struct pl08x_channel_data pl08x_slave_channels[] = {
{
.bus_id = "nand-slc",
......@@ -148,11 +81,6 @@ static struct pl08x_platform_data pl08x_pd = {
.mem_buses = PL08X_AHB1,
};
static struct mmci_platform_data lpc32xx_mmci_data = {
.ocr_mask = MMC_VDD_30_31 | MMC_VDD_31_32 |
MMC_VDD_32_33 | MMC_VDD_33_34,
};
static struct lpc32xx_slc_platform_data lpc32xx_slc_data = {
.dma_filter = pl08x_filter_id,
};
......@@ -164,10 +92,7 @@ static struct lpc32xx_mlc_platform_data lpc32xx_mlc_data = {
static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", NULL),
OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", NULL),
OF_DEV_AUXDATA("arm,pl110", 0x31040000, "dev:clcd", &lpc32xx_clcd_data),
OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd),
OF_DEV_AUXDATA("arm,pl18x", 0x20098000, "20098000.sd",
&lpc32xx_mmci_data),
OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash",
&lpc32xx_slc_data),
OF_DEV_AUXDATA("nxp,lpc3220-mlc", 0x200a8000, "200a8000.flash",
......@@ -177,15 +102,6 @@ static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
static void __init lpc3250_machine_init(void)
{
u32 tmp;
/* Setup LCD muxing to RGB565 */
tmp = __raw_readl(LPC32XX_CLKPWR_LCDCLK_CTRL) &
~(LPC32XX_CLKPWR_LCDCTRL_LCDTYPE_MSK |
LPC32XX_CLKPWR_LCDCTRL_PSCALE_MSK);
tmp |= LPC32XX_CLKPWR_LCDCTRL_LCDTYPE_TFT16;
__raw_writel(tmp, LPC32XX_CLKPWR_LCDCLK_CTRL);
lpc32xx_serial_init();
/* Test clock needed for UDA1380 initial init */
......
......@@ -86,17 +86,10 @@ static int lpc32xx_pm_enter(suspend_state_t state)
void *iram_swap_area;
/* Allocate some space for temporary IRAM storage */
iram_swap_area = kmalloc(lpc32xx_sys_suspend_sz, GFP_KERNEL);
if (!iram_swap_area) {
printk(KERN_ERR
"PM Suspend: cannot allocate memory to save portion "
"of SRAM\n");
iram_swap_area = kmemdup((void *)TEMP_IRAM_AREA,
lpc32xx_sys_suspend_sz, GFP_KERNEL);
if (!iram_swap_area)
return -ENOMEM;
}
/* Backup a small area of IRAM used for the suspend code */
memcpy(iram_swap_area, (void *) TEMP_IRAM_AREA,
lpc32xx_sys_suspend_sz);
/*
* Copy code to suspend system into IRAM. The suspend code
......
......@@ -26,6 +26,10 @@ config MACH_MT7623
bool "MediaTek MT7623 SoCs support"
default ARCH_MEDIATEK
config MACH_MT7629
bool "MediaTek MT7629 SoCs support"
default ARCH_MEDIATEK
config MACH_MT8127
bool "MediaTek MT8127 SoCs support"
default ARCH_MEDIATEK
......
......@@ -30,7 +30,6 @@ static void __init mediatek_timer_init(void)
if (of_machine_is_compatible("mediatek,mt6589") ||
of_machine_is_compatible("mediatek,mt7623") ||
of_machine_is_compatible("mediatek,mt7623a") ||
of_machine_is_compatible("mediatek,mt8135") ||
of_machine_is_compatible("mediatek,mt8127")) {
/* turn on GPT6 which ungates arch timer clocks */
......@@ -50,7 +49,7 @@ static const char * const mediatek_board_dt_compat[] = {
"mediatek,mt6589",
"mediatek,mt6592",
"mediatek,mt7623",
"mediatek,mt7623a",
"mediatek,mt7629",
"mediatek,mt8127",
"mediatek,mt8135",
NULL,
......
......@@ -60,7 +60,7 @@ static const struct of_device_id mtk_tz_smp_boot_infos[] __initconst = {
static const struct of_device_id mtk_smp_boot_infos[] __initconst = {
{ .compatible = "mediatek,mt6589", .data = &mtk_mt6589_boot },
{ .compatible = "mediatek,mt7623", .data = &mtk_mt7623_boot },
{ .compatible = "mediatek,mt7623a", .data = &mtk_mt7623_boot },
{ .compatible = "mediatek,mt7629", .data = &mtk_mt7623_boot },
{},
};
......
......@@ -9,7 +9,6 @@ menuconfig ARCH_MESON
select PINCTRL
select PINCTRL_MESON
select COMMON_CLK
select COMMON_CLK_AMLOGIC
select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP
......
......@@ -454,24 +454,6 @@ config MACH_TREO680
Say Y here if you intend to run this kernel on Palm Treo 680
smartphone.
config MACH_RAUMFELD_RC
bool "Raumfeld Controller"
select CPU_PXA300
select POWER_SUPPLY
select PXA3xx
config MACH_RAUMFELD_CONNECTOR
bool "Raumfeld Connector"
select CPU_PXA300
select POWER_SUPPLY
select PXA3xx
config MACH_RAUMFELD_SPEAKER
bool "Raumfeld Speaker"
select CPU_PXA300
select POWER_SUPPLY
select PXA3xx
config PXA_SHARPSL
bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
select SHARP_PARAM
......
......@@ -86,9 +86,6 @@ obj-$(CONFIG_MACH_POODLE) += poodle.o
obj-$(CONFIG_MACH_TOSA) += tosa.o
obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o
obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
obj-$(CONFIG_MACH_RAUMFELD_RC) += raumfeld.o
obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o
obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o
obj-$(CONFIG_MACH_ZIPIT2) += z2.o
obj-$(CONFIG_PXA_SYSTEMS_CPLDS) += pxa_cplds_irqs.o
......
/*
* arch/arm/mach-pxa/raumfeld.c
*
* Support for the following Raumfeld devices:
*
* * Controller
* * Connector
* * Speaker S/M
*
* See http://www.raumfeld.com for details.
*
* Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
*
* 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.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/property.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/smsc911x.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/leds.h>
#include <linux/w1-gpio.h>
#include <linux/sched.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h>
#include <linux/i2c.h>
#include <linux/platform_data/i2c-pxa.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_gpio.h>
#include <linux/lis3lv02d.h>
#include <linux/pda_power.h>
#include <linux/power_supply.h>
#include <linux/regulator/max8660.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/consumer.h>
#include <linux/delay.h>
#include <asm/system_info.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include "pxa300.h"
#include <linux/platform_data/usb-ohci-pxa27x.h>
#include <linux/platform_data/video-pxafb.h>
#include <linux/platform_data/mmc-pxamci.h>
#include <linux/platform_data/mtd-nand-pxa3xx.h>
#include "generic.h"
#include "devices.h"
/* common GPIO definitions */
/* inputs */
#define GPIO_ON_OFF (14)
#define GPIO_VOLENC_A (19)
#define GPIO_VOLENC_B (20)
#define GPIO_CHARGE_DONE (23)
#define GPIO_CHARGE_IND (27)
#define GPIO_TOUCH_IRQ (32)
#define GPIO_ETH_IRQ (40)
#define GPIO_SPI_MISO (98)
#define GPIO_ACCEL_IRQ (104)
#define GPIO_RESCUE_BOOT (115)
#define GPIO_DOCK_DETECT (116)
#define GPIO_KEY1 (117)
#define GPIO_KEY2 (118)
#define GPIO_KEY3 (119)
#define GPIO_CHARGE_USB_OK (112)
#define GPIO_CHARGE_DC_OK (101)
#define GPIO_CHARGE_USB_SUSP (102)
/* outputs */
#define GPIO_SHUTDOWN_SUPPLY (16)
#define GPIO_SHUTDOWN_BATT (18)
#define GPIO_CHRG_PEN2 (31)
#define GPIO_TFT_VA_EN (33)
#define GPIO_SPDIF_CS (34)
#define GPIO_LED2 (35)
#define GPIO_LED1 (36)
#define GPIO_SPDIF_RESET (38)
#define GPIO_SPI_CLK (95)
#define GPIO_MCLK_DAC_CS (96)
#define GPIO_SPI_MOSI (97)
#define GPIO_W1_PULLUP_ENABLE (105)
#define GPIO_DISPLAY_ENABLE (106)
#define GPIO_MCLK_RESET (111)
#define GPIO_W2W_RESET (113)
#define GPIO_W2W_PDN (114)
#define GPIO_CODEC_RESET (120)
#define GPIO_AUDIO_VA_ENABLE (124)
#define GPIO_ACCEL_CS (125)
#define GPIO_ONE_WIRE (126)
/*
* GPIO configurations
*/
static mfp_cfg_t raumfeld_controller_pin_config[] __initdata = {
/* UART1 */
GPIO77_UART1_RXD,
GPIO78_UART1_TXD,
GPIO79_UART1_CTS,
GPIO81_UART1_DSR,
GPIO83_UART1_DTR,
GPIO84_UART1_RTS,
/* UART3 */
GPIO110_UART3_RXD,
/* USB Host */
GPIO0_2_USBH_PEN,
GPIO1_2_USBH_PWR,
/* I2C */
GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
/* SPI */
GPIO34_GPIO, /* SPDIF_CS */
GPIO96_GPIO, /* MCLK_CS */
GPIO125_GPIO, /* ACCEL_CS */
/* MMC */
GPIO3_MMC1_DAT0,
GPIO4_MMC1_DAT1,
GPIO5_MMC1_DAT2,
GPIO6_MMC1_DAT3,
GPIO7_MMC1_CLK,
GPIO8_MMC1_CMD,
/* One-wire */
GPIO126_GPIO | MFP_LPM_FLOAT,
GPIO105_GPIO | MFP_PULL_LOW | MFP_LPM_PULL_LOW,
/* CHRG_USB_OK */
GPIO101_GPIO | MFP_PULL_HIGH,
/* CHRG_USB_OK */
GPIO112_GPIO | MFP_PULL_HIGH,
/* CHRG_USB_SUSP */
GPIO102_GPIO,
/* DISPLAY_ENABLE */
GPIO106_GPIO,
/* DOCK_DETECT */
GPIO116_GPIO | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
/* LCD */
GPIO54_LCD_LDD_0,
GPIO55_LCD_LDD_1,
GPIO56_LCD_LDD_2,
GPIO57_LCD_LDD_3,
GPIO58_LCD_LDD_4,
GPIO59_LCD_LDD_5,
GPIO60_LCD_LDD_6,
GPIO61_LCD_LDD_7,
GPIO62_LCD_LDD_8,
GPIO63_LCD_LDD_9,
GPIO64_LCD_LDD_10,
GPIO65_LCD_LDD_11,
GPIO66_LCD_LDD_12,
GPIO67_LCD_LDD_13,
GPIO68_LCD_LDD_14,
GPIO69_LCD_LDD_15,
GPIO70_LCD_LDD_16,
GPIO71_LCD_LDD_17,
GPIO72_LCD_FCLK,
GPIO73_LCD_LCLK,
GPIO74_LCD_PCLK,
GPIO75_LCD_BIAS,
};
static mfp_cfg_t raumfeld_connector_pin_config[] __initdata = {
/* UART1 */
GPIO77_UART1_RXD,
GPIO78_UART1_TXD,
GPIO79_UART1_CTS,
GPIO81_UART1_DSR,
GPIO83_UART1_DTR,
GPIO84_UART1_RTS,
/* UART3 */
GPIO110_UART3_RXD,
/* USB Host */
GPIO0_2_USBH_PEN,
GPIO1_2_USBH_PWR,
/* I2C */
GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
/* SPI */
GPIO34_GPIO, /* SPDIF_CS */
GPIO96_GPIO, /* MCLK_CS */
GPIO125_GPIO, /* ACCEL_CS */
/* MMC */
GPIO3_MMC1_DAT0,
GPIO4_MMC1_DAT1,
GPIO5_MMC1_DAT2,
GPIO6_MMC1_DAT3,
GPIO7_MMC1_CLK,
GPIO8_MMC1_CMD,
/* Ethernet */
GPIO1_nCS2, /* CS */
GPIO40_GPIO | MFP_PULL_HIGH, /* IRQ */
/* SSP for I2S */
GPIO85_SSP1_SCLK,
GPIO89_SSP1_EXTCLK,
GPIO86_SSP1_FRM,
GPIO87_SSP1_TXD,
GPIO88_SSP1_RXD,
GPIO90_SSP1_SYSCLK,
/* SSP2 for S/PDIF */
GPIO25_SSP2_SCLK,
GPIO26_SSP2_FRM,
GPIO27_SSP2_TXD,
GPIO29_SSP2_EXTCLK,
/* LEDs */
GPIO35_GPIO | MFP_LPM_PULL_LOW,
GPIO36_GPIO | MFP_LPM_DRIVE_HIGH,
};
static mfp_cfg_t raumfeld_speaker_pin_config[] __initdata = {
/* UART1 */
GPIO77_UART1_RXD,
GPIO78_UART1_TXD,
GPIO79_UART1_CTS,
GPIO81_UART1_DSR,
GPIO83_UART1_DTR,
GPIO84_UART1_RTS,
/* UART3 */
GPIO110_UART3_RXD,
/* USB Host */
GPIO0_2_USBH_PEN,
GPIO1_2_USBH_PWR,
/* I2C */
GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
/* SPI */
GPIO34_GPIO, /* SPDIF_CS */
GPIO96_GPIO, /* MCLK_CS */
GPIO125_GPIO, /* ACCEL_CS */
/* MMC */
GPIO3_MMC1_DAT0,
GPIO4_MMC1_DAT1,
GPIO5_MMC1_DAT2,
GPIO6_MMC1_DAT3,
GPIO7_MMC1_CLK,
GPIO8_MMC1_CMD,
/* Ethernet */
GPIO1_nCS2, /* CS */
GPIO40_GPIO | MFP_PULL_HIGH, /* IRQ */
/* SSP for I2S */
GPIO85_SSP1_SCLK,
GPIO89_SSP1_EXTCLK,
GPIO86_SSP1_FRM,
GPIO87_SSP1_TXD,
GPIO88_SSP1_RXD,
GPIO90_SSP1_SYSCLK,
/* LEDs */
GPIO35_GPIO | MFP_LPM_PULL_LOW,
GPIO36_GPIO | MFP_LPM_DRIVE_HIGH,
};
/*
* SMSC LAN9220 Ethernet
*/
static struct resource smc91x_resources[] = {
{
.start = PXA3xx_CS2_PHYS,
.end = PXA3xx_CS2_PHYS + 0xfffff,
.flags = IORESOURCE_MEM,
},
{
.start = PXA_GPIO_TO_IRQ(GPIO_ETH_IRQ),
.end = PXA_GPIO_TO_IRQ(GPIO_ETH_IRQ),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
}
};
static struct smsc911x_platform_config raumfeld_smsc911x_config = {
.phy_interface = PHY_INTERFACE_MODE_MII,
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
.flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
};
static struct platform_device smc91x_device = {
.name = "smsc911x",
.id = -1,
.num_resources = ARRAY_SIZE(smc91x_resources),
.resource = smc91x_resources,
.dev = {
.platform_data = &raumfeld_smsc911x_config,
}
};
/**
* NAND
*/
static struct mtd_partition raumfeld_nand_partitions[] = {
{
.name = "Bootloader",
.offset = 0,
.size = 0xa0000,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "BootloaderEnvironment",
.offset = 0xa0000,
.size = 0x20000,
},
{
.name = "BootloaderSplashScreen",
.offset = 0xc0000,
.size = 0x60000,
},
{
.name = "UBI",
.offset = 0x120000,
.size = MTDPART_SIZ_FULL,
},
};
static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
.keep_config = 1,
.parts = raumfeld_nand_partitions,
.nr_parts = ARRAY_SIZE(raumfeld_nand_partitions),
};
/**
* USB (OHCI) support
*/
static struct pxaohci_platform_data raumfeld_ohci_info = {
.port_mode = PMM_GLOBAL_MODE,
.flags = ENABLE_PORT1,
};
/**
* Rotary encoder input device
*/
static struct gpiod_lookup_table raumfeld_rotary_gpios_table = {
.dev_id = "rotary-encoder.0",
.table = {
GPIO_LOOKUP_IDX("gpio-0",
GPIO_VOLENC_A, NULL, 0, GPIO_ACTIVE_LOW),
GPIO_LOOKUP_IDX("gpio-0",
GPIO_VOLENC_B, NULL, 1, GPIO_ACTIVE_HIGH),
{ },
},
};
static const struct property_entry raumfeld_rotary_properties[] __initconst = {
PROPERTY_ENTRY_U32("rotary-encoder,steps-per-period", 24),
PROPERTY_ENTRY_U32("linux,axis", REL_X),
PROPERTY_ENTRY_U32("rotary-encoder,relative_axis", 1),
{ },
};
static struct platform_device rotary_encoder_device = {
.name = "rotary-encoder",
.id = 0,
};
/**
* GPIO buttons
*/
static struct gpio_keys_button gpio_keys_button[] = {
{
.code = KEY_F1,
.type = EV_KEY,
.gpio = GPIO_KEY1,
.active_low = 1,
.wakeup = 0,
.debounce_interval = 5, /* ms */
.desc = "Button 1",
},
{
.code = KEY_F2,
.type = EV_KEY,
.gpio = GPIO_KEY2,
.active_low = 1,
.wakeup = 0,
.debounce_interval = 5, /* ms */
.desc = "Button 2",
},
{
.code = KEY_F3,
.type = EV_KEY,
.gpio = GPIO_KEY3,
.active_low = 1,
.wakeup = 0,
.debounce_interval = 5, /* ms */
.desc = "Button 3",
},
{
.code = KEY_F4,
.type = EV_KEY,
.gpio = GPIO_RESCUE_BOOT,
.active_low = 0,
.wakeup = 0,
.debounce_interval = 5, /* ms */
.desc = "rescue boot button",
},
{
.code = KEY_F5,
.type = EV_KEY,
.gpio = GPIO_DOCK_DETECT,
.active_low = 1,
.wakeup = 0,
.debounce_interval = 5, /* ms */
.desc = "dock detect",
},
{
.code = KEY_F6,
.type = EV_KEY,
.gpio = GPIO_ON_OFF,
.active_low = 0,
.wakeup = 0,
.debounce_interval = 5, /* ms */
.desc = "on_off button",
},
};
static struct gpio_keys_platform_data gpio_keys_platform_data = {
.buttons = gpio_keys_button,
.nbuttons = ARRAY_SIZE(gpio_keys_button),
.rep = 0,
};
static struct platform_device raumfeld_gpio_keys_device = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &gpio_keys_platform_data,
}
};
/**
* GPIO LEDs
*/
static struct gpio_led raumfeld_leds[] = {
{
.name = "raumfeld:1",
.gpio = GPIO_LED1,
.active_low = 1,
.default_state = LEDS_GPIO_DEFSTATE_ON,
},
{
.name = "raumfeld:2",
.gpio = GPIO_LED2,
.active_low = 0,
.default_state = LEDS_GPIO_DEFSTATE_OFF,
}
};
static struct gpio_led_platform_data raumfeld_led_platform_data = {
.leds = raumfeld_leds,
.num_leds = ARRAY_SIZE(raumfeld_leds),
};
static struct platform_device raumfeld_led_device = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &raumfeld_led_platform_data,
},
};
/**
* One-wire (W1 bus) support
*/
static void w1_enable_external_pullup(int enable)
{
gpio_set_value(GPIO_W1_PULLUP_ENABLE, enable);
msleep(100);
}
static struct gpiod_lookup_table raumfeld_w1_gpiod_table = {
.dev_id = "w1-gpio",
.table = {
GPIO_LOOKUP_IDX("gpio-pxa", GPIO_ONE_WIRE, NULL, 0,
GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
},
};
static struct w1_gpio_platform_data w1_gpio_platform_data = {
.enable_external_pullup = w1_enable_external_pullup,
};
static struct platform_device raumfeld_w1_gpio_device = {
.name = "w1-gpio",
.dev = {
.platform_data = &w1_gpio_platform_data
}
};
static void __init raumfeld_w1_init(void)
{
int ret = gpio_request(GPIO_W1_PULLUP_ENABLE,
"W1 external pullup enable");
if (ret < 0)
pr_warn("Unable to request GPIO_W1_PULLUP_ENABLE\n");
else
gpio_direction_output(GPIO_W1_PULLUP_ENABLE, 0);
gpiod_add_lookup_table(&raumfeld_w1_gpiod_table);
platform_device_register(&raumfeld_w1_gpio_device);
}
/**
* Framebuffer device
*/
static struct pwm_lookup raumfeld_pwm_lookup[] = {
PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight", NULL, 10000,
PWM_POLARITY_NORMAL),
};
/* PWM controlled backlight */
static struct platform_pwm_backlight_data raumfeld_pwm_backlight_data = {
.max_brightness = 100,
.dft_brightness = 100,
.enable_gpio = -1,
};
static struct platform_device raumfeld_pwm_backlight_device = {
.name = "pwm-backlight",
.dev = {
.parent = &pxa27x_device_pwm0.dev,
.platform_data = &raumfeld_pwm_backlight_data,
}
};
/* LT3593 controlled backlight */
static struct gpio_led raumfeld_lt3593_led = {
.name = "backlight",
.gpio = mfp_to_gpio(MFP_PIN_GPIO17),
.default_state = LEDS_GPIO_DEFSTATE_ON,
};
static struct gpio_led_platform_data raumfeld_lt3593_platform_data = {
.leds = &raumfeld_lt3593_led,
.num_leds = 1,
};
static struct platform_device raumfeld_lt3593_device = {
.name = "leds-lt3593",
.id = -1,
.dev = {
.platform_data = &raumfeld_lt3593_platform_data,
},
};
static struct pxafb_mode_info sharp_lq043t3dx02_mode = {
.pixclock = 111000,
.xres = 480,
.yres = 272,
.bpp = 16,
.hsync_len = 41,
.left_margin = 2,
.right_margin = 1,
.vsync_len = 10,
.upper_margin = 3,
.lower_margin = 1,
.sync = 0,
};
static struct pxafb_mach_info raumfeld_sharp_lcd_info = {
.modes = &sharp_lq043t3dx02_mode,
.num_modes = 1,
.video_mem_size = 0x400000,
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
#ifdef CONFIG_PXA3XX_GCU
.acceleration_enabled = 1,
#endif
};
static void __init raumfeld_lcd_init(void)
{
int ret;
ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable");
if (ret < 0)
pr_warn("Unable to request GPIO_TFT_VA_EN\n");
else
gpio_direction_output(GPIO_TFT_VA_EN, 1);
msleep(100);
ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable");
if (ret < 0)
pr_warn("Unable to request GPIO_DISPLAY_ENABLE\n");
else
gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
/* Hardware revision 2 has the backlight regulator controlled
* by an LT3593, earlier and later devices use PWM for that. */
if ((system_rev & 0xff) == 2) {
platform_device_register(&raumfeld_lt3593_device);
} else {
mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT;
pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1);
pwm_add_table(raumfeld_pwm_lookup,
ARRAY_SIZE(raumfeld_pwm_lookup));
platform_device_register(&raumfeld_pwm_backlight_device);
}
pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info);
platform_device_register(&pxa3xx_device_gcu);
}
/**
* SPI devices
*/
static struct spi_gpio_platform_data raumfeld_spi_platform_data = {
.num_chipselect = 3,
};
static struct platform_device raumfeld_spi_device = {
.name = "spi_gpio",
.id = 0,
.dev = {
.platform_data = &raumfeld_spi_platform_data,
}
};
static struct gpiod_lookup_table raumfeld_spi_gpiod_table = {
.dev_id = "spi_gpio",
.table = {
GPIO_LOOKUP("gpio-0", GPIO_SPI_CLK,
"sck", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("gpio-0", GPIO_SPI_MOSI,
"mosi", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("gpio-0", GPIO_SPI_MISO,
"miso", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("gpio-0", GPIO_SPDIF_CS,
"cs", 0, GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("gpio-0", GPIO_ACCEL_CS,
"cs", 1, GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("gpio-0", GPIO_MCLK_DAC_CS,
"cs", 2, GPIO_ACTIVE_HIGH),
{ },
},
};
static struct lis3lv02d_platform_data lis3_pdata = {
.click_flags = LIS3_CLICK_SINGLE_X |
LIS3_CLICK_SINGLE_Y |
LIS3_CLICK_SINGLE_Z,
.irq_cfg = LIS3_IRQ1_CLICK | LIS3_IRQ2_CLICK,
.wakeup_flags = LIS3_WAKEUP_X_LO | LIS3_WAKEUP_X_HI |
LIS3_WAKEUP_Y_LO | LIS3_WAKEUP_Y_HI |
LIS3_WAKEUP_Z_LO | LIS3_WAKEUP_Z_HI,
.wakeup_thresh = 10,
.click_thresh_x = 10,
.click_thresh_y = 10,
.click_thresh_z = 10,
};
#define SPI_AK4104 \
{ \
.modalias = "ak4104-codec", \
.max_speed_hz = 10000, \
.bus_num = 0, \
.chip_select = 0, \
}
#define SPI_LIS3 \
{ \
.modalias = "lis3lv02d_spi", \
.max_speed_hz = 1000000, \
.bus_num = 0, \
.chip_select = 1, \
.platform_data = &lis3_pdata, \
.irq = PXA_GPIO_TO_IRQ(GPIO_ACCEL_IRQ), \
}
#define SPI_DAC7512 \
{ \
.modalias = "dac7512", \
.max_speed_hz = 1000000, \
.bus_num = 0, \
.chip_select = 2, \
}
static struct spi_board_info connector_spi_devices[] __initdata = {
SPI_AK4104,
SPI_DAC7512,
};
static struct spi_board_info speaker_spi_devices[] __initdata = {
SPI_DAC7512,
};
static struct spi_board_info controller_spi_devices[] __initdata = {
SPI_LIS3,
};
/**
* MMC for Marvell Libertas 8688 via SDIO
*/
static int raumfeld_mci_init(struct device *dev, irq_handler_t isr, void *data)
{
gpio_set_value(GPIO_W2W_RESET, 1);
gpio_set_value(GPIO_W2W_PDN, 1);
return 0;
}
static void raumfeld_mci_exit(struct device *dev, void *data)
{
gpio_set_value(GPIO_W2W_RESET, 0);
gpio_set_value(GPIO_W2W_PDN, 0);
}
static struct pxamci_platform_data raumfeld_mci_platform_data = {
.init = raumfeld_mci_init,
.exit = raumfeld_mci_exit,
.detect_delay_ms = 200,
};
/*
* External power / charge logic
*/
static int power_supply_init(struct device *dev)
{
return 0;
}
static void power_supply_exit(struct device *dev)
{
}
static int raumfeld_is_ac_online(void)
{
return !gpio_get_value(GPIO_CHARGE_DC_OK);
}
static int raumfeld_is_usb_online(void)
{
return 0;
}
static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" };
static void raumfeld_power_signal_charged(void)
{
struct power_supply *psy =
power_supply_get_by_name(raumfeld_power_supplicants[0]);
if (psy) {
power_supply_set_battery_charged(psy);
power_supply_put(psy);
}
}
static int raumfeld_power_resume(void)
{
/* check if GPIO_CHARGE_DONE went low while we were sleeping */
if (!gpio_get_value(GPIO_CHARGE_DONE))
raumfeld_power_signal_charged();
return 0;
}
static struct pda_power_pdata power_supply_info = {
.init = power_supply_init,
.is_ac_online = raumfeld_is_ac_online,
.is_usb_online = raumfeld_is_usb_online,
.exit = power_supply_exit,
.supplied_to = raumfeld_power_supplicants,
.num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants),
.resume = raumfeld_power_resume,
};
static struct resource power_supply_resources[] = {
{
.name = "ac",
.flags = IORESOURCE_IRQ |
IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE,
.start = GPIO_CHARGE_DC_OK,
.end = GPIO_CHARGE_DC_OK,
},
};
static irqreturn_t charge_done_irq(int irq, void *dev_id)
{
raumfeld_power_signal_charged();
return IRQ_HANDLED;
}
static struct platform_device raumfeld_power_supply = {
.name = "pda-power",
.id = -1,
.dev = {
.platform_data = &power_supply_info,
},
.resource = power_supply_resources,
.num_resources = ARRAY_SIZE(power_supply_resources),
};
static void __init raumfeld_power_init(void)
{
int ret;
/* Set PEN2 high to enable maximum charge current */
ret = gpio_request(GPIO_CHRG_PEN2, "CHRG_PEN2");
if (ret < 0)
pr_warn("Unable to request GPIO_CHRG_PEN2\n");
else
gpio_direction_output(GPIO_CHRG_PEN2, 1);
ret = gpio_request(GPIO_CHARGE_DC_OK, "CABLE_DC_OK");
if (ret < 0)
pr_warn("Unable to request GPIO_CHARGE_DC_OK\n");
ret = gpio_request(GPIO_CHARGE_USB_SUSP, "CHARGE_USB_SUSP");
if (ret < 0)
pr_warn("Unable to request GPIO_CHARGE_USB_SUSP\n");
else
gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
power_supply_resources[0].start = gpio_to_irq(GPIO_CHARGE_DC_OK);
power_supply_resources[0].end = gpio_to_irq(GPIO_CHARGE_DC_OK);
ret = request_irq(gpio_to_irq(GPIO_CHARGE_DONE),
&charge_done_irq, IORESOURCE_IRQ_LOWEDGE,
"charge_done", NULL);
if (ret < 0)
printk(KERN_ERR "%s: unable to register irq %d\n", __func__,
GPIO_CHARGE_DONE);
else
platform_device_register(&raumfeld_power_supply);
}
/* Fixed regulator for AUDIO_VA, 0-0048 maps to the cs4270 codec device */
static struct regulator_consumer_supply audio_va_consumer_supply =
REGULATOR_SUPPLY("va", "0-0048");
static struct regulator_init_data audio_va_initdata = {
.consumer_supplies = &audio_va_consumer_supply,
.num_consumer_supplies = 1,
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
};
static struct fixed_voltage_config audio_va_config = {
.supply_name = "audio_va",
.microvolts = 5000000,
.enabled_at_boot = 0,
.init_data = &audio_va_initdata,
};
static struct platform_device audio_va_device = {
.name = "reg-fixed-voltage",
.id = 0,
.dev = {
.platform_data = &audio_va_config,
},
};
static struct gpiod_lookup_table audio_va_gpiod_table = {
.dev_id = "reg-fixed-voltage.0",
.table = {
GPIO_LOOKUP("gpio-pxa", GPIO_AUDIO_VA_ENABLE,
NULL, GPIO_ACTIVE_HIGH),
{ },
},
};
/* Dummy supplies for Codec's VD/VLC */
static struct regulator_consumer_supply audio_dummy_supplies[] = {
REGULATOR_SUPPLY("vd", "0-0048"),
REGULATOR_SUPPLY("vlc", "0-0048"),
};
static struct regulator_init_data audio_dummy_initdata = {
.consumer_supplies = audio_dummy_supplies,
.num_consumer_supplies = ARRAY_SIZE(audio_dummy_supplies),
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
};
static struct fixed_voltage_config audio_dummy_config = {
.supply_name = "audio_vd",
.microvolts = 3300000,
.init_data = &audio_dummy_initdata,
};
static struct platform_device audio_supply_dummy_device = {
.name = "reg-fixed-voltage",
.id = 1,
.dev = {
.platform_data = &audio_dummy_config,
},
};
static struct platform_device *audio_regulator_devices[] = {
&audio_va_device,
&audio_supply_dummy_device,
};
/**
* Regulator support via MAX8660
*/
static struct regulator_consumer_supply vcc_mmc_supply =
REGULATOR_SUPPLY("vmmc", "pxa2xx-mci.0");
static struct regulator_init_data vcc_mmc_init_data = {
.constraints = {
.min_uV = 3300000,
.max_uV = 3300000,
.valid_modes_mask = REGULATOR_MODE_NORMAL,
.valid_ops_mask = REGULATOR_CHANGE_STATUS |
REGULATOR_CHANGE_VOLTAGE |
REGULATOR_CHANGE_MODE,
},
.consumer_supplies = &vcc_mmc_supply,
.num_consumer_supplies = 1,
};
static struct max8660_subdev_data max8660_v6_subdev_data = {
.id = MAX8660_V6,
.name = "vmmc",
.platform_data = &vcc_mmc_init_data,
};
static struct max8660_platform_data max8660_pdata = {
.subdevs = &max8660_v6_subdev_data,
.num_subdevs = 1,
};
/**
* I2C devices
*/
static struct i2c_board_info raumfeld_pwri2c_board_info = {
.type = "max8660",
.addr = 0x34,
.platform_data = &max8660_pdata,
};
static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
.type = "cs4270",
.addr = 0x48,
};
static struct gpiod_lookup_table raumfeld_controller_gpios_table = {
.dev_id = "0-000a",
.table = {
GPIO_LOOKUP("gpio-pxa",
GPIO_TOUCH_IRQ, "attn", GPIO_ACTIVE_HIGH),
{ },
},
};
static const struct resource raumfeld_controller_resources[] __initconst = {
{
.start = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ),
.end = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
},
};
static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
.type = "eeti_ts",
.addr = 0x0a,
.resources = raumfeld_controller_resources,
.num_resources = ARRAY_SIZE(raumfeld_controller_resources),
};
static struct platform_device *raumfeld_common_devices[] = {
&raumfeld_gpio_keys_device,
&raumfeld_led_device,
&raumfeld_spi_device,
};
static void __init raumfeld_audio_init(void)
{
int ret;
ret = gpio_request(GPIO_CODEC_RESET, "cs4270 reset");
if (ret < 0)
pr_warn("unable to request GPIO_CODEC_RESET\n");
else
gpio_direction_output(GPIO_CODEC_RESET, 1);
ret = gpio_request(GPIO_SPDIF_RESET, "ak4104 s/pdif reset");
if (ret < 0)
pr_warn("unable to request GPIO_SPDIF_RESET\n");
else
gpio_direction_output(GPIO_SPDIF_RESET, 1);
ret = gpio_request(GPIO_MCLK_RESET, "MCLK reset");
if (ret < 0)
pr_warn("unable to request GPIO_MCLK_RESET\n");
else
gpio_direction_output(GPIO_MCLK_RESET, 1);
gpiod_add_lookup_table(&audio_va_gpiod_table);
platform_add_devices(ARRAY_AND_SIZE(audio_regulator_devices));
}
static void __init raumfeld_common_init(void)
{
int ret;
/* The on/off button polarity has changed after revision 1 */
if ((system_rev & 0xff) > 1) {
int i;
for (i = 0; i < ARRAY_SIZE(gpio_keys_button); i++)
if (!strcmp(gpio_keys_button[i].desc, "on_off button"))
gpio_keys_button[i].active_low = 1;
}
enable_irq_wake(IRQ_WAKEUP0);
pxa3xx_set_nand_info(&raumfeld_nand_info);
pxa3xx_set_i2c_power_info(NULL);
pxa_set_ohci_info(&raumfeld_ohci_info);
pxa_set_mci_info(&raumfeld_mci_platform_data);
pxa_set_i2c_info(NULL);
pxa_set_ffuart_info(NULL);
ret = gpio_request(GPIO_W2W_RESET, "Wi2Wi reset");
if (ret < 0)
pr_warn("Unable to request GPIO_W2W_RESET\n");
else
gpio_direction_output(GPIO_W2W_RESET, 0);
ret = gpio_request(GPIO_W2W_PDN, "Wi2Wi powerup");
if (ret < 0)
pr_warn("Unable to request GPIO_W2W_PDN\n");
else
gpio_direction_output(GPIO_W2W_PDN, 0);
/* this can be used to switch off the device */
ret = gpio_request(GPIO_SHUTDOWN_SUPPLY, "supply shutdown");
if (ret < 0)
pr_warn("Unable to request GPIO_SHUTDOWN_SUPPLY\n");
else
gpio_direction_output(GPIO_SHUTDOWN_SUPPLY, 0);
gpiod_add_lookup_table(&raumfeld_spi_gpiod_table);
platform_add_devices(ARRAY_AND_SIZE(raumfeld_common_devices));
i2c_register_board_info(1, &raumfeld_pwri2c_board_info, 1);
}
static void __init __maybe_unused raumfeld_controller_init(void)
{
int ret;
pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_controller_pin_config));
gpiod_add_lookup_table(&raumfeld_rotary_gpios_table);
device_add_properties(&rotary_encoder_device.dev,
raumfeld_rotary_properties);
platform_device_register(&rotary_encoder_device);
spi_register_board_info(ARRAY_AND_SIZE(controller_spi_devices));
gpiod_add_lookup_table(&raumfeld_controller_gpios_table);
i2c_register_board_info(0, &raumfeld_controller_i2c_board_info, 1);
ret = gpio_request(GPIO_SHUTDOWN_BATT, "battery shutdown");
if (ret < 0)
pr_warn("Unable to request GPIO_SHUTDOWN_BATT\n");
else
gpio_direction_output(GPIO_SHUTDOWN_BATT, 0);
raumfeld_common_init();
raumfeld_power_init();
raumfeld_lcd_init();
raumfeld_w1_init();
}
static void __init __maybe_unused raumfeld_connector_init(void)
{
pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_connector_pin_config));
spi_register_board_info(ARRAY_AND_SIZE(connector_spi_devices));
i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
platform_device_register(&smc91x_device);
raumfeld_audio_init();
raumfeld_common_init();
}
static void __init __maybe_unused raumfeld_speaker_init(void)
{
pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_speaker_pin_config));
spi_register_board_info(ARRAY_AND_SIZE(speaker_spi_devices));
i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
platform_device_register(&smc91x_device);
gpiod_add_lookup_table(&raumfeld_rotary_gpios_table);
device_add_properties(&rotary_encoder_device.dev,
raumfeld_rotary_properties);
platform_device_register(&rotary_encoder_device);
raumfeld_audio_init();
raumfeld_common_init();
}
/* physical memory regions */
#define RAUMFELD_SDRAM_BASE 0xa0000000 /* SDRAM region */
#ifdef CONFIG_MACH_RAUMFELD_RC
MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
.atag_offset = 0x100,
.init_machine = raumfeld_controller_init,
.map_io = pxa3xx_map_io,
.nr_irqs = PXA_NR_IRQS,
.init_irq = pxa3xx_init_irq,
.handle_irq = pxa3xx_handle_irq,
.init_time = pxa_timer_init,
.restart = pxa_restart,
MACHINE_END
#endif
#ifdef CONFIG_MACH_RAUMFELD_CONNECTOR
MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
.atag_offset = 0x100,
.init_machine = raumfeld_connector_init,
.map_io = pxa3xx_map_io,
.nr_irqs = PXA_NR_IRQS,
.init_irq = pxa3xx_init_irq,
.handle_irq = pxa3xx_handle_irq,
.init_time = pxa_timer_init,
.restart = pxa_restart,
MACHINE_END
#endif
#ifdef CONFIG_MACH_RAUMFELD_SPEAKER
MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
.atag_offset = 0x100,
.init_machine = raumfeld_speaker_init,
.map_io = pxa3xx_map_io,
.nr_irqs = PXA_NR_IRQS,
.init_irq = pxa3xx_init_irq,
.handle_irq = pxa3xx_handle_irq,
.init_time = pxa_timer_init,
.restart = pxa_restart,
MACHINE_END
#endif
......@@ -65,16 +65,16 @@ static int osiris_dvs_notify(struct notifier_block *nb,
switch (val) {
case CPUFREQ_PRECHANGE:
if (old_dvs & !new_dvs ||
cur_dvs & !new_dvs) {
if ((old_dvs && !new_dvs) ||
(cur_dvs && !new_dvs)) {
pr_debug("%s: exiting dvs\n", __func__);
cur_dvs = false;
gpio_set_value(OSIRIS_GPIO_DVS, 1);
}
break;
case CPUFREQ_POSTCHANGE:
if (!old_dvs & new_dvs ||
!cur_dvs & new_dvs) {
if ((!old_dvs && new_dvs) ||
(!cur_dvs && new_dvs)) {
pr_debug("entering dvs\n");
cur_dvs = true;
gpio_set_value(OSIRIS_GPIO_DVS, 0);
......
......@@ -40,6 +40,7 @@
struct regulator_quirk {
struct list_head list;
const struct of_device_id *id;
struct device_node *np;
struct of_phandle_args irq_args;
struct i2c_msg i2c_msg;
bool shared; /* IRQ line is shared */
......@@ -101,6 +102,9 @@ static int regulator_quirk_notify(struct notifier_block *nb,
if (!pos->shared)
continue;
if (pos->np->parent != client->dev.parent->of_node)
continue;
dev_info(&client->dev, "clearing %s@0x%02x interrupts\n",
pos->id->compatible, pos->i2c_msg.addr);
......@@ -165,6 +169,7 @@ static int __init rcar_gen2_regulator_quirk(void)
memcpy(&quirk->i2c_msg, id->data, sizeof(quirk->i2c_msg));
quirk->id = id;
quirk->np = np;
quirk->i2c_msg.addr = addr;
ret = of_irq_parse_one(np, 0, argsa);
......
......@@ -79,15 +79,24 @@
#define TEGRA_PMC_BASE 0x7000E400
#define TEGRA_PMC_SIZE SZ_256
#define TEGRA_MC_BASE 0x7000F000
#define TEGRA_MC_SIZE SZ_1K
#define TEGRA_EMC_BASE 0x7000F400
#define TEGRA_EMC_SIZE SZ_1K
#define TEGRA114_MC_BASE 0x70019000
#define TEGRA114_MC_SIZE SZ_4K
#define TEGRA_EMC0_BASE 0x7001A000
#define TEGRA_EMC0_SIZE SZ_2K
#define TEGRA_EMC1_BASE 0x7001A800
#define TEGRA_EMC1_SIZE SZ_2K
#define TEGRA124_MC_BASE 0x70019000
#define TEGRA124_MC_SIZE SZ_4K
#define TEGRA124_EMC_BASE 0x7001B000
#define TEGRA124_EMC_SIZE SZ_2K
......
......@@ -32,7 +32,6 @@
#define EMC_CFG 0xc
#define EMC_ADR_CFG 0x10
#define EMC_REFRESH 0x70
#define EMC_NOP 0xdc
#define EMC_SELF_REF 0xe0
#define EMC_REQ_CTRL 0x2b0
......@@ -397,7 +396,6 @@ padload_done:
mov r1, #1
str r1, [r0, #EMC_NOP]
str r1, [r0, #EMC_NOP]
str r1, [r0, #EMC_REFRESH]
emc_device_mask r1, r0
......
......@@ -29,7 +29,6 @@
#define EMC_CFG 0xc
#define EMC_ADR_CFG 0x10
#define EMC_TIMING_CONTROL 0x28
#define EMC_REFRESH 0x70
#define EMC_NOP 0xdc
#define EMC_SELF_REF 0xe0
#define EMC_MRW 0xe8
......@@ -45,6 +44,8 @@
#define EMC_XM2VTTGENPADCTRL 0x310
#define EMC_XM2VTTGENPADCTRL2 0x314
#define MC_EMEM_ARB_CFG 0x90
#define PMC_CTRL 0x0
#define PMC_CTRL_SIDE_EFFECT_LP0 (1 << 14) /* enter LP0 when CPU pwr gated */
......@@ -419,6 +420,22 @@ _pll_m_c_x_done:
movweq r0, #:lower16:TEGRA124_EMC_BASE
movteq r0, #:upper16:TEGRA124_EMC_BASE
cmp r10, #TEGRA30
moveq r2, #0x20
movweq r4, #:lower16:TEGRA_MC_BASE
movteq r4, #:upper16:TEGRA_MC_BASE
cmp r10, #TEGRA114
moveq r2, #0x34
movweq r4, #:lower16:TEGRA114_MC_BASE
movteq r4, #:upper16:TEGRA114_MC_BASE
cmp r10, #TEGRA124
moveq r2, #0x20
movweq r4, #:lower16:TEGRA124_MC_BASE
movteq r4, #:upper16:TEGRA124_MC_BASE
ldr r1, [r5, r2] @ restore MC_EMEM_ARB_CFG
str r1, [r4, #MC_EMEM_ARB_CFG]
exit_self_refresh:
ldr r1, [r5, #0xC] @ restore EMC_XM2VTTGENPADCTRL
str r1, [r0, #EMC_XM2VTTGENPADCTRL]
......@@ -459,7 +476,6 @@ emc_wait_auto_cal_onetime:
cmp r10, #TEGRA30
streq r1, [r0, #EMC_NOP]
streq r1, [r0, #EMC_NOP]
streq r1, [r0, #EMC_REFRESH]
emc_device_mask r1, r0
......@@ -521,6 +537,8 @@ zcal_done:
ldr r1, [r5, #0x0] @ restore EMC_CFG
str r1, [r0, #EMC_CFG]
emc_timing_update r1, r0
/* Tegra114 had dual EMC channel, now config the other one */
cmp r10, #TEGRA114
bne __no_dual_emc_chanl
......@@ -546,6 +564,7 @@ tegra30_sdram_pad_address:
.word TEGRA_PMC_BASE + PMC_IO_DPD_STATUS @0x14
.word TEGRA_CLK_RESET_BASE + CLK_RESET_CLK_SOURCE_MSELECT @0x18
.word TEGRA_CLK_RESET_BASE + CLK_RESET_SCLK_BURST @0x1c
.word TEGRA_MC_BASE + MC_EMEM_ARB_CFG @0x20
tegra30_sdram_pad_address_end:
tegra114_sdram_pad_address:
......@@ -562,6 +581,7 @@ tegra114_sdram_pad_address:
.word TEGRA_EMC1_BASE + EMC_AUTO_CAL_INTERVAL @0x28
.word TEGRA_EMC1_BASE + EMC_XM2VTTGENPADCTRL @0x2c
.word TEGRA_EMC1_BASE + EMC_XM2VTTGENPADCTRL2 @0x30
.word TEGRA114_MC_BASE + MC_EMEM_ARB_CFG @0x34
tegra114_sdram_pad_adress_end:
tegra124_sdram_pad_address:
......@@ -573,6 +593,7 @@ tegra124_sdram_pad_address:
.word TEGRA_PMC_BASE + PMC_IO_DPD_STATUS @0x14
.word TEGRA_CLK_RESET_BASE + CLK_RESET_CLK_SOURCE_MSELECT @0x18
.word TEGRA_CLK_RESET_BASE + CLK_RESET_SCLK_BURST @0x1c
.word TEGRA124_MC_BASE + MC_EMEM_ARB_CFG @0x20
tegra124_sdram_pad_address_end:
tegra30_sdram_pad_size:
......
......@@ -112,12 +112,13 @@ config ARCH_MESON
bool "Amlogic Platforms"
select PINCTRL
select PINCTRL_MESON
select COMMON_CLK_AMLOGIC
select COMMON_CLK_GXBB
select COMMON_CLK_AXG
select COMMON_CLK_G12A
select MESON_IRQ_GPIO
help
This enables support for the Amlogic S905 SoCs.
This enables support for the arm64 based Amlogic SoCs
such as the s905, S905X/D, S912, A113X/D or S905X/D2
config ARCH_MVEBU
bool "Marvell EBU SoC Family"
......@@ -146,6 +147,10 @@ config ARCH_MXC
bool "ARMv8 based NXP i.MX SoC family"
select ARM64_ERRATUM_843419
select ARM64_ERRATUM_845719
select IMX_GPCV2
select IMX_GPCV2_PM_DOMAINS
select PM
select PM_GENERIC_DOMAINS
help
This enables support for the ARMv8 based SoCs in the
NXP i.MX family.
......
......@@ -9,6 +9,7 @@
*/
#include <linux/clk.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
......@@ -40,6 +41,8 @@ struct da8xx_ohci_hcd {
struct regulator *vbus_reg;
struct notifier_block nb;
unsigned int reg_enabled;
struct gpio_desc *vbus_gpio;
struct gpio_desc *oc_gpio;
};
#define to_da8xx_ohci(hcd) (struct da8xx_ohci_hcd *)(hcd_to_ohci(hcd)->priv)
......@@ -87,11 +90,12 @@ static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on)
{
struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
struct device *dev = hcd->self.controller;
struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
int ret;
if (hub && hub->set_power)
return hub->set_power(1, on);
if (da8xx_ohci->vbus_gpio) {
gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, on);
return 0;
}
if (!da8xx_ohci->vbus_reg)
return 0;
......@@ -119,11 +123,9 @@ static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on)
static int ohci_da8xx_get_power(struct usb_hcd *hcd)
{
struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
struct device *dev = hcd->self.controller;
struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
if (hub && hub->get_power)
return hub->get_power(1);
if (da8xx_ohci->vbus_gpio)
return gpiod_get_value_cansleep(da8xx_ohci->vbus_gpio);
if (da8xx_ohci->vbus_reg)
return regulator_is_enabled(da8xx_ohci->vbus_reg);
......@@ -134,13 +136,11 @@ static int ohci_da8xx_get_power(struct usb_hcd *hcd)
static int ohci_da8xx_get_oci(struct usb_hcd *hcd)
{
struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
struct device *dev = hcd->self.controller;
struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
unsigned int flags;
int ret;
if (hub && hub->get_oci)
return hub->get_oci(1);
if (da8xx_ohci->oc_gpio)
return gpiod_get_value_cansleep(da8xx_ohci->oc_gpio);
if (!da8xx_ohci->vbus_reg)
return 0;
......@@ -158,10 +158,8 @@ static int ohci_da8xx_get_oci(struct usb_hcd *hcd)
static int ohci_da8xx_has_set_power(struct usb_hcd *hcd)
{
struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
struct device *dev = hcd->self.controller;
struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
if (hub && hub->set_power)
if (da8xx_ohci->vbus_gpio)
return 1;
if (da8xx_ohci->vbus_reg)
......@@ -173,10 +171,8 @@ static int ohci_da8xx_has_set_power(struct usb_hcd *hcd)
static int ohci_da8xx_has_oci(struct usb_hcd *hcd)
{
struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
struct device *dev = hcd->self.controller;
struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
if (hub && hub->get_oci)
if (da8xx_ohci->oc_gpio)
return 1;
if (da8xx_ohci->vbus_reg)
......@@ -196,19 +192,6 @@ static int ohci_da8xx_has_potpgt(struct usb_hcd *hcd)
return 0;
}
/*
* Handle the port over-current indicator change.
*/
static void ohci_da8xx_ocic_handler(struct da8xx_ohci_root_hub *hub,
unsigned port)
{
ocic_mask |= 1 << port;
/* Once over-current is detected, the port needs to be powered down */
if (hub->get_oci(port) > 0)
hub->set_power(port, 0);
}
static int ohci_da8xx_regulator_event(struct notifier_block *nb,
unsigned long event, void *data)
{
......@@ -223,16 +206,23 @@ static int ohci_da8xx_regulator_event(struct notifier_block *nb,
return 0;
}
static irqreturn_t ohci_da8xx_oc_handler(int irq, void *data)
{
struct da8xx_ohci_hcd *da8xx_ohci = data;
if (gpiod_get_value(da8xx_ohci->oc_gpio))
gpiod_set_value(da8xx_ohci->vbus_gpio, 0);
return IRQ_HANDLED;
}
static int ohci_da8xx_register_notify(struct usb_hcd *hcd)
{
struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
struct device *dev = hcd->self.controller;
struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
int ret = 0;
if (hub && hub->ocic_notify) {
ret = hub->ocic_notify(ohci_da8xx_ocic_handler);
} else if (da8xx_ohci->vbus_reg) {
if (!da8xx_ohci->oc_gpio && da8xx_ohci->vbus_reg) {
da8xx_ohci->nb.notifier_call = ohci_da8xx_regulator_event;
ret = devm_regulator_register_notifier(da8xx_ohci->vbus_reg,
&da8xx_ohci->nb);
......@@ -244,15 +234,6 @@ static int ohci_da8xx_register_notify(struct usb_hcd *hcd)
return ret;
}
static void ohci_da8xx_unregister_notify(struct usb_hcd *hcd)
{
struct device *dev = hcd->self.controller;
struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
if (hub && hub->ocic_notify)
hub->ocic_notify(NULL);
}
static int ohci_da8xx_reset(struct usb_hcd *hcd)
{
struct device *dev = hcd->self.controller;
......@@ -402,34 +383,35 @@ MODULE_DEVICE_TABLE(of, da8xx_ohci_ids);
static int ohci_da8xx_probe(struct platform_device *pdev)
{
struct da8xx_ohci_hcd *da8xx_ohci;
struct device *dev = &pdev->dev;
int error, hcd_irq, oc_irq;
struct usb_hcd *hcd;
struct resource *mem;
int error, irq;
hcd = usb_create_hcd(&ohci_da8xx_hc_driver, &pdev->dev,
dev_name(&pdev->dev));
hcd = usb_create_hcd(&ohci_da8xx_hc_driver, dev, dev_name(dev));
if (!hcd)
return -ENOMEM;
da8xx_ohci = to_da8xx_ohci(hcd);
da8xx_ohci->hcd = hcd;
da8xx_ohci->usb11_clk = devm_clk_get(&pdev->dev, NULL);
da8xx_ohci->usb11_clk = devm_clk_get(dev, NULL);
if (IS_ERR(da8xx_ohci->usb11_clk)) {
error = PTR_ERR(da8xx_ohci->usb11_clk);
if (error != -EPROBE_DEFER)
dev_err(&pdev->dev, "Failed to get clock.\n");
dev_err(dev, "Failed to get clock.\n");
goto err;
}
da8xx_ohci->usb11_phy = devm_phy_get(&pdev->dev, "usb-phy");
da8xx_ohci->usb11_phy = devm_phy_get(dev, "usb-phy");
if (IS_ERR(da8xx_ohci->usb11_phy)) {
error = PTR_ERR(da8xx_ohci->usb11_phy);
if (error != -EPROBE_DEFER)
dev_err(&pdev->dev, "Failed to get phy.\n");
dev_err(dev, "Failed to get phy.\n");
goto err;
}
da8xx_ohci->vbus_reg = devm_regulator_get_optional(&pdev->dev, "vbus");
da8xx_ohci->vbus_reg = devm_regulator_get_optional(dev, "vbus");
if (IS_ERR(da8xx_ohci->vbus_reg)) {
error = PTR_ERR(da8xx_ohci->vbus_reg);
if (error == -ENODEV) {
......@@ -437,13 +419,34 @@ static int ohci_da8xx_probe(struct platform_device *pdev)
} else if (error == -EPROBE_DEFER) {
goto err;
} else {
dev_err(&pdev->dev, "Failed to get regulator\n");
dev_err(dev, "Failed to get regulator\n");
goto err;
}
}
da8xx_ohci->vbus_gpio = devm_gpiod_get_optional(dev, "vbus",
GPIOD_OUT_HIGH);
if (IS_ERR(da8xx_ohci->vbus_gpio))
goto err;
da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN);
if (IS_ERR(da8xx_ohci->oc_gpio))
goto err;
if (da8xx_ohci->oc_gpio) {
oc_irq = gpiod_to_irq(da8xx_ohci->oc_gpio);
if (oc_irq < 0)
goto err;
error = devm_request_irq(dev, oc_irq, ohci_da8xx_oc_handler,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
"OHCI over-current indicator", da8xx_ohci);
if (error)
goto err;
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hcd->regs = devm_ioremap_resource(&pdev->dev, mem);
hcd->regs = devm_ioremap_resource(dev, mem);
if (IS_ERR(hcd->regs)) {
error = PTR_ERR(hcd->regs);
goto err;
......@@ -451,13 +454,13 @@ static int ohci_da8xx_probe(struct platform_device *pdev)
hcd->rsrc_start = mem->start;
hcd->rsrc_len = resource_size(mem);
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
hcd_irq = platform_get_irq(pdev, 0);
if (hcd_irq < 0) {
error = -ENODEV;
goto err;
}
error = usb_add_hcd(hcd, irq, 0);
error = usb_add_hcd(hcd, hcd_irq, 0);
if (error)
goto err;
......@@ -480,7 +483,6 @@ static int ohci_da8xx_remove(struct platform_device *pdev)
{
struct usb_hcd *hcd = platform_get_drvdata(pdev);
ohci_da8xx_unregister_notify(hcd);
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
......
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _DT_BINDINGS_POWER_MT8183_POWER_H
#define _DT_BINDINGS_POWER_MT8183_POWER_H
#ifndef _DT_BINDINGS_POWER_MT8173_POWER_H
#define _DT_BINDINGS_POWER_MT8173_POWER_H
#define MT8173_POWER_DOMAIN_VDEC 0
#define MT8173_POWER_DOMAIN_VENC 1
......@@ -13,4 +13,4 @@
#define MT8173_POWER_DOMAIN_MFG_2D 8
#define MT8173_POWER_DOMAIN_MFG 9
#endif /* _DT_BINDINGS_POWER_MT8183_POWER_H */
#endif /* _DT_BINDINGS_POWER_MT8173_POWER_H */
......@@ -46,5 +46,4 @@ enum {
EMAC_VERSION_2, /* DM646x */
};
void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context);
#endif
......@@ -11,22 +11,8 @@
#ifndef __ASM_ARCH_USB_H
#define __ASM_ARCH_USB_H
struct da8xx_ohci_root_hub;
typedef void (*da8xx_ocic_handler_t)(struct da8xx_ohci_root_hub *hub,
unsigned port);
/* Passed as the platform data to the OHCI driver */
struct da8xx_ohci_root_hub {
/* Switch the port power on/off */
int (*set_power)(unsigned port, int on);
/* Read the port power status */
int (*get_power)(unsigned port);
/* Read the port over-current indicator */
int (*get_oci)(unsigned port);
/* Over-current indicator change notification (pass NULL to disable) */
int (*ocic_notify)(da8xx_ocic_handler_t handler);
/* Time from power on to power good (in 2 ms units) */
u8 potpgt;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment