From bab53ce38e8735519aa3cfdcc5bfa438c0891086 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 27 Aug 2012 14:22:48 -0700 Subject: ARM: tegra: remove dead code Now that all boards are converted to device tree, devices.[ch] and board-pinmux.[ch] are no longer used. So, remove them. The only exception is the EHCI platform data in devices.h. Move that data to board-dt-tegra20.c - the only places it's used. Signed-off-by: Stephen Warren diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index ed41905..ef0aa96 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -1,6 +1,4 @@ -obj-y += board-pinmux.o obj-y += common.o -obj-y += devices.o obj-y += io.o obj-y += irq.o obj-y += clock.o diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c index 5957ffb..c339444 100644 --- a/arch/arm/mach-tegra/board-dt-tegra20.c +++ b/arch/arm/mach-tegra/board-dt-tegra20.c @@ -28,9 +28,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -43,7 +45,30 @@ #include "board.h" #include "clock.h" -#include "devices.h" + +struct tegra_ehci_platform_data tegra_ehci1_pdata = { + .operating_mode = TEGRA_USB_OTG, + .power_down_on_bus_suspend = 1, + .vbus_gpio = -1, +}; + +struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = { + .reset_gpio = -1, + .clk = "cdev2", +}; + +struct tegra_ehci_platform_data tegra_ehci2_pdata = { + .phy_config = &tegra_ehci2_ulpi_phy_config, + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 1, + .vbus_gpio = -1, +}; + +struct tegra_ehci_platform_data tegra_ehci3_pdata = { + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 1, + .vbus_gpio = -1, +}; struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL), diff --git a/arch/arm/mach-tegra/board-pinmux.c b/arch/arm/mach-tegra/board-pinmux.c deleted file mode 100644 index a5574c7..0000000 --- a/arch/arm/mach-tegra/board-pinmux.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include -#include -#include -#include - -#include "board-pinmux.h" -#include "devices.h" - -unsigned long tegra_pincfg_pullnone_driven[2] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_NONE), - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN), -}; - -unsigned long tegra_pincfg_pullnone_tristate[2] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_NONE), - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE), -}; - -unsigned long tegra_pincfg_pullnone_na[1] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_NONE), -}; - -unsigned long tegra_pincfg_pullup_driven[2] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_UP), - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN), -}; - -unsigned long tegra_pincfg_pullup_tristate[2] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_UP), - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE), -}; - -unsigned long tegra_pincfg_pullup_na[1] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_UP), -}; - -unsigned long tegra_pincfg_pulldown_driven[2] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_DOWN), - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN), -}; - -unsigned long tegra_pincfg_pulldown_tristate[2] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_DOWN), - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE), -}; - -unsigned long tegra_pincfg_pulldown_na[1] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_DOWN), -}; - -unsigned long tegra_pincfg_pullna_driven[1] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN), -}; - -unsigned long tegra_pincfg_pullna_tristate[1] = { - TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE), -}; - -static struct platform_device *devices[] = { - &tegra_gpio_device, - &tegra_pinmux_device, -}; - -void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a, - struct tegra_board_pinmux_conf *conf_b) -{ - if (conf_a) - pinctrl_register_mappings(conf_a->maps, conf_a->map_count); - if (conf_b) - pinctrl_register_mappings(conf_b->maps, conf_b->map_count); - - platform_add_devices(devices, ARRAY_SIZE(devices)); -} diff --git a/arch/arm/mach-tegra/board-pinmux.h b/arch/arm/mach-tegra/board-pinmux.h deleted file mode 100644 index c5f3f33..0000000 --- a/arch/arm/mach-tegra/board-pinmux.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __MACH_TEGRA_BOARD_PINMUX_H -#define __MACH_TEGRA_BOARD_PINMUX_H - -#include - -#include - -#define PINMUX_DEV "tegra20-pinctrl" - -#define TEGRA_MAP_MUX(_group_, _function_) \ - PIN_MAP_MUX_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, _function_) - -#define TEGRA_MAP_CONF(_group_, _pull_, _drive_) \ - PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, tegra_pincfg_pull##_pull_##_##_drive_) - -#define TEGRA_MAP_MUXCONF(_group_, _function_, _pull_, _drive_) \ - TEGRA_MAP_MUX(_group_, _function_), \ - TEGRA_MAP_CONF(_group_, _pull_, _drive_) - -extern unsigned long tegra_pincfg_pullnone_driven[2]; -extern unsigned long tegra_pincfg_pullnone_tristate[2]; -extern unsigned long tegra_pincfg_pullnone_na[1]; -extern unsigned long tegra_pincfg_pullup_driven[2]; -extern unsigned long tegra_pincfg_pullup_tristate[2]; -extern unsigned long tegra_pincfg_pullup_na[1]; -extern unsigned long tegra_pincfg_pulldown_driven[2]; -extern unsigned long tegra_pincfg_pulldown_tristate[2]; -extern unsigned long tegra_pincfg_pulldown_na[1]; -extern unsigned long tegra_pincfg_pullna_driven[1]; -extern unsigned long tegra_pincfg_pullna_tristate[1]; - -struct tegra_board_pinmux_conf { - struct pinctrl_map *maps; - int map_count; -}; - -void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a, - struct tegra_board_pinmux_conf *conf_b); - -#endif diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c deleted file mode 100644 index d8ab762..0000000 --- a/arch/arm/mach-tegra/devices.c +++ /dev/null @@ -1,702 +0,0 @@ -/* - * Copyright (C) 2010,2011 Google, Inc. - * - * Author: - * Colin Cross - * Erik Gilling - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gpio-names.h" -#include "devices.h" - -static struct resource gpio_resource[] = { - [0] = { - .start = TEGRA_GPIO_BASE, - .end = TEGRA_GPIO_BASE + TEGRA_GPIO_SIZE-1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_GPIO1, - .end = INT_GPIO1, - .flags = IORESOURCE_IRQ, - }, - [2] = { - .start = INT_GPIO2, - .end = INT_GPIO2, - .flags = IORESOURCE_IRQ, - }, - [3] = { - .start = INT_GPIO3, - .end = INT_GPIO3, - .flags = IORESOURCE_IRQ, - }, - [4] = { - .start = INT_GPIO4, - .end = INT_GPIO4, - .flags = IORESOURCE_IRQ, - }, - [5] = { - .start = INT_GPIO5, - .end = INT_GPIO5, - .flags = IORESOURCE_IRQ, - }, - [6] = { - .start = INT_GPIO6, - .end = INT_GPIO6, - .flags = IORESOURCE_IRQ, - }, - [7] = { - .start = INT_GPIO7, - .end = INT_GPIO7, - .flags = IORESOURCE_IRQ, - }, -}; - -struct platform_device tegra_gpio_device = { - .name = "tegra-gpio", - .id = -1, - .resource = gpio_resource, - .num_resources = ARRAY_SIZE(gpio_resource), -}; - -static struct resource pinmux_resource[] = { - [0] = { - /* Tri-state registers */ - .start = TEGRA_APB_MISC_BASE + 0x14, - .end = TEGRA_APB_MISC_BASE + 0x20 + 3, - .flags = IORESOURCE_MEM, - }, - [1] = { - /* Mux registers */ - .start = TEGRA_APB_MISC_BASE + 0x80, - .end = TEGRA_APB_MISC_BASE + 0x9c + 3, - .flags = IORESOURCE_MEM, - }, - [2] = { - /* Pull-up/down registers */ - .start = TEGRA_APB_MISC_BASE + 0xa0, - .end = TEGRA_APB_MISC_BASE + 0xb0 + 3, - .flags = IORESOURCE_MEM, - }, - [3] = { - /* Pad control registers */ - .start = TEGRA_APB_MISC_BASE + 0x868, - .end = TEGRA_APB_MISC_BASE + 0x90c + 3, - .flags = IORESOURCE_MEM, - }, -}; - -struct platform_device tegra_pinmux_device = { - .name = "tegra20-pinctrl", - .id = -1, - .resource = pinmux_resource, - .num_resources = ARRAY_SIZE(pinmux_resource), -}; - -static struct resource i2c_resource1[] = { - [0] = { - .start = INT_I2C, - .end = INT_I2C, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_I2C_BASE, - .end = TEGRA_I2C_BASE + TEGRA_I2C_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource i2c_resource2[] = { - [0] = { - .start = INT_I2C2, - .end = INT_I2C2, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_I2C2_BASE, - .end = TEGRA_I2C2_BASE + TEGRA_I2C2_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource i2c_resource3[] = { - [0] = { - .start = INT_I2C3, - .end = INT_I2C3, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_I2C3_BASE, - .end = TEGRA_I2C3_BASE + TEGRA_I2C3_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource i2c_resource4[] = { - [0] = { - .start = INT_DVC, - .end = INT_DVC, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_DVC_BASE, - .end = TEGRA_DVC_BASE + TEGRA_DVC_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct tegra_i2c_platform_data tegra_i2c1_platform_data = { - .bus_clk_rate = 400000, -}; - -static struct tegra_i2c_platform_data tegra_i2c2_platform_data = { - .bus_clk_rate = 400000, -}; - -static struct tegra_i2c_platform_data tegra_i2c3_platform_data = { - .bus_clk_rate = 400000, -}; - -static struct tegra_i2c_platform_data tegra_dvc_platform_data = { - .bus_clk_rate = 400000, -}; - -struct platform_device tegra_i2c_device1 = { - .name = "tegra-i2c", - .id = 0, - .resource = i2c_resource1, - .num_resources = ARRAY_SIZE(i2c_resource1), - .dev = { - .platform_data = &tegra_i2c1_platform_data, - }, -}; - -struct platform_device tegra_i2c_device2 = { - .name = "tegra-i2c", - .id = 1, - .resource = i2c_resource2, - .num_resources = ARRAY_SIZE(i2c_resource2), - .dev = { - .platform_data = &tegra_i2c2_platform_data, - }, -}; - -struct platform_device tegra_i2c_device3 = { - .name = "tegra-i2c", - .id = 2, - .resource = i2c_resource3, - .num_resources = ARRAY_SIZE(i2c_resource3), - .dev = { - .platform_data = &tegra_i2c3_platform_data, - }, -}; - -struct platform_device tegra_i2c_device4 = { - .name = "tegra-i2c", - .id = 3, - .resource = i2c_resource4, - .num_resources = ARRAY_SIZE(i2c_resource4), - .dev = { - .platform_data = &tegra_dvc_platform_data, - }, -}; - -static struct resource spi_resource1[] = { - [0] = { - .start = INT_S_LINK1, - .end = INT_S_LINK1, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SPI1_BASE, - .end = TEGRA_SPI1_BASE + TEGRA_SPI1_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource spi_resource2[] = { - [0] = { - .start = INT_SPI_2, - .end = INT_SPI_2, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SPI2_BASE, - .end = TEGRA_SPI2_BASE + TEGRA_SPI2_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource spi_resource3[] = { - [0] = { - .start = INT_SPI_3, - .end = INT_SPI_3, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SPI3_BASE, - .end = TEGRA_SPI3_BASE + TEGRA_SPI3_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource spi_resource4[] = { - [0] = { - .start = INT_SPI_4, - .end = INT_SPI_4, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SPI4_BASE, - .end = TEGRA_SPI4_BASE + TEGRA_SPI4_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -struct platform_device tegra_spi_device1 = { - .name = "spi_tegra", - .id = 0, - .resource = spi_resource1, - .num_resources = ARRAY_SIZE(spi_resource1), - .dev = { - .coherent_dma_mask = 0xffffffff, - }, -}; - -struct platform_device tegra_spi_device2 = { - .name = "spi_tegra", - .id = 1, - .resource = spi_resource2, - .num_resources = ARRAY_SIZE(spi_resource2), - .dev = { - .coherent_dma_mask = 0xffffffff, - }, -}; - -struct platform_device tegra_spi_device3 = { - .name = "spi_tegra", - .id = 2, - .resource = spi_resource3, - .num_resources = ARRAY_SIZE(spi_resource3), - .dev = { - .coherent_dma_mask = 0xffffffff, - }, -}; - -struct platform_device tegra_spi_device4 = { - .name = "spi_tegra", - .id = 3, - .resource = spi_resource4, - .num_resources = ARRAY_SIZE(spi_resource4), - .dev = { - .coherent_dma_mask = 0xffffffff, - }, -}; - - -static struct resource sdhci_resource1[] = { - [0] = { - .start = INT_SDMMC1, - .end = INT_SDMMC1, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SDMMC1_BASE, - .end = TEGRA_SDMMC1_BASE + TEGRA_SDMMC1_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource sdhci_resource2[] = { - [0] = { - .start = INT_SDMMC2, - .end = INT_SDMMC2, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SDMMC2_BASE, - .end = TEGRA_SDMMC2_BASE + TEGRA_SDMMC2_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource sdhci_resource3[] = { - [0] = { - .start = INT_SDMMC3, - .end = INT_SDMMC3, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SDMMC3_BASE, - .end = TEGRA_SDMMC3_BASE + TEGRA_SDMMC3_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct resource sdhci_resource4[] = { - [0] = { - .start = INT_SDMMC4, - .end = INT_SDMMC4, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = TEGRA_SDMMC4_BASE, - .end = TEGRA_SDMMC4_BASE + TEGRA_SDMMC4_SIZE-1, - .flags = IORESOURCE_MEM, - }, -}; - -/* board files should fill in platform_data register the devices themselvs. - * See board-harmony.c for an example - */ -struct platform_device tegra_sdhci_device1 = { - .name = "sdhci-tegra", - .id = 0, - .resource = sdhci_resource1, - .num_resources = ARRAY_SIZE(sdhci_resource1), -}; - -struct platform_device tegra_sdhci_device2 = { - .name = "sdhci-tegra", - .id = 1, - .resource = sdhci_resource2, - .num_resources = ARRAY_SIZE(sdhci_resource2), -}; - -struct platform_device tegra_sdhci_device3 = { - .name = "sdhci-tegra", - .id = 2, - .resource = sdhci_resource3, - .num_resources = ARRAY_SIZE(sdhci_resource3), -}; - -struct platform_device tegra_sdhci_device4 = { - .name = "sdhci-tegra", - .id = 3, - .resource = sdhci_resource4, - .num_resources = ARRAY_SIZE(sdhci_resource4), -}; - -static struct resource tegra_usb1_resources[] = { - [0] = { - .start = TEGRA_USB_BASE, - .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_USB, - .end = INT_USB, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct resource tegra_usb2_resources[] = { - [0] = { - .start = TEGRA_USB2_BASE, - .end = TEGRA_USB2_BASE + TEGRA_USB2_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_USB2, - .end = INT_USB2, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct resource tegra_usb3_resources[] = { - [0] = { - .start = TEGRA_USB3_BASE, - .end = TEGRA_USB3_BASE + TEGRA_USB3_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_USB3, - .end = INT_USB3, - .flags = IORESOURCE_IRQ, - }, -}; - -struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = { - .reset_gpio = -1, - .clk = "cdev2", -}; - -struct tegra_ehci_platform_data tegra_ehci1_pdata = { - .operating_mode = TEGRA_USB_OTG, - .power_down_on_bus_suspend = 1, - .vbus_gpio = -1, -}; - -struct tegra_ehci_platform_data tegra_ehci2_pdata = { - .phy_config = &tegra_ehci2_ulpi_phy_config, - .operating_mode = TEGRA_USB_HOST, - .power_down_on_bus_suspend = 1, - .vbus_gpio = -1, -}; - -struct tegra_ehci_platform_data tegra_ehci3_pdata = { - .operating_mode = TEGRA_USB_HOST, - .power_down_on_bus_suspend = 1, - .vbus_gpio = -1, -}; - -static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32); - -struct platform_device tegra_ehci1_device = { - .name = "tegra-ehci", - .id = 0, - .dev = { - .dma_mask = &tegra_ehci_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(32), - .platform_data = &tegra_ehci1_pdata, - }, - .resource = tegra_usb1_resources, - .num_resources = ARRAY_SIZE(tegra_usb1_resources), -}; - -struct platform_device tegra_ehci2_device = { - .name = "tegra-ehci", - .id = 1, - .dev = { - .dma_mask = &tegra_ehci_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(32), - .platform_data = &tegra_ehci2_pdata, - }, - .resource = tegra_usb2_resources, - .num_resources = ARRAY_SIZE(tegra_usb2_resources), -}; - -struct platform_device tegra_ehci3_device = { - .name = "tegra-ehci", - .id = 2, - .dev = { - .dma_mask = &tegra_ehci_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(32), - .platform_data = &tegra_ehci3_pdata, - }, - .resource = tegra_usb3_resources, - .num_resources = ARRAY_SIZE(tegra_usb3_resources), -}; - -static struct resource tegra_pmu_resources[] = { - [0] = { - .start = INT_CPU0_PMU_INTR, - .end = INT_CPU0_PMU_INTR, - .flags = IORESOURCE_IRQ, - }, - [1] = { - .start = INT_CPU1_PMU_INTR, - .end = INT_CPU1_PMU_INTR, - .flags = IORESOURCE_IRQ, - }, -}; - -struct platform_device tegra_pmu_device = { - .name = "arm-pmu", - .id = ARM_PMU_DEVICE_CPU, - .num_resources = ARRAY_SIZE(tegra_pmu_resources), - .resource = tegra_pmu_resources, -}; - -static struct resource tegra_uarta_resources[] = { - [0] = { - .start = TEGRA_UARTA_BASE, - .end = TEGRA_UARTA_BASE + TEGRA_UARTA_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_UARTA, - .end = INT_UARTA, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct resource tegra_uartb_resources[] = { - [0] = { - .start = TEGRA_UARTB_BASE, - .end = TEGRA_UARTB_BASE + TEGRA_UARTB_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_UARTB, - .end = INT_UARTB, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct resource tegra_uartc_resources[] = { - [0] = { - .start = TEGRA_UARTC_BASE, - .end = TEGRA_UARTC_BASE + TEGRA_UARTC_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_UARTC, - .end = INT_UARTC, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct resource tegra_uartd_resources[] = { - [0] = { - .start = TEGRA_UARTD_BASE, - .end = TEGRA_UARTD_BASE + TEGRA_UARTD_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_UARTD, - .end = INT_UARTD, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct resource tegra_uarte_resources[] = { - [0] = { - .start = TEGRA_UARTE_BASE, - .end = TEGRA_UARTE_BASE + TEGRA_UARTE_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = INT_UARTE, - .end = INT_UARTE, - .flags = IORESOURCE_IRQ, - }, -}; - -struct platform_device tegra_uarta_device = { - .name = "tegra_uart", - .id = 0, - .num_resources = ARRAY_SIZE(tegra_uarta_resources), - .resource = tegra_uarta_resources, - .dev = { - .coherent_dma_mask = DMA_BIT_MASK(32), - }, -}; - -struct platform_device tegra_uartb_device = { - .name = "tegra_uart", - .id = 1, - .num_resources = ARRAY_SIZE(tegra_uartb_resources), - .resource = tegra_uartb_resources, - .dev = { - .coherent_dma_mask = DMA_BIT_MASK(32), - }, -}; - -struct platform_device tegra_uartc_device = { - .name = "tegra_uart", - .id = 2, - .num_resources = ARRAY_SIZE(tegra_uartc_resources), - .resource = tegra_uartc_resources, - .dev = { - .coherent_dma_mask = DMA_BIT_MASK(32), - }, -}; - -struct platform_device tegra_uartd_device = { - .name = "tegra_uart", - .id = 3, - .num_resources = ARRAY_SIZE(tegra_uartd_resources), - .resource = tegra_uartd_resources, - .dev = { - .coherent_dma_mask = DMA_BIT_MASK(32), - }, -}; - -struct platform_device tegra_uarte_device = { - .name = "tegra_uart", - .id = 4, - .num_resources = ARRAY_SIZE(tegra_uarte_resources), - .resource = tegra_uarte_resources, - .dev = { - .coherent_dma_mask = DMA_BIT_MASK(32), - }, -}; - -static struct resource i2s_resource1[] = { - [0] = { - .start = INT_I2S1, - .end = INT_I2S1, - .flags = IORESOURCE_IRQ - }, - [1] = { - .start = TEGRA_DMA_REQ_SEL_I2S_1, - .end = TEGRA_DMA_REQ_SEL_I2S_1, - .flags = IORESOURCE_DMA - }, - [2] = { - .start = TEGRA_I2S1_BASE, - .end = TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1, - .flags = IORESOURCE_MEM - } -}; - -static struct resource i2s_resource2[] = { - [0] = { - .start = INT_I2S2, - .end = INT_I2S2, - .flags = IORESOURCE_IRQ - }, - [1] = { - .start = TEGRA_DMA_REQ_SEL_I2S2_1, - .end = TEGRA_DMA_REQ_SEL_I2S2_1, - .flags = IORESOURCE_DMA - }, - [2] = { - .start = TEGRA_I2S2_BASE, - .end = TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1, - .flags = IORESOURCE_MEM - } -}; - -struct platform_device tegra_i2s_device1 = { - .name = "tegra20-i2s", - .id = 0, - .resource = i2s_resource1, - .num_resources = ARRAY_SIZE(i2s_resource1), -}; - -struct platform_device tegra_i2s_device2 = { - .name = "tegra20-i2s", - .id = 1, - .resource = i2s_resource2, - .num_resources = ARRAY_SIZE(i2s_resource2), -}; - -static struct resource tegra_das_resources[] = { - [0] = { - .start = TEGRA_APB_MISC_DAS_BASE, - .end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1, - .flags = IORESOURCE_MEM, - }, -}; - -struct platform_device tegra_das_device = { - .name = "tegra20-das", - .id = -1, - .num_resources = ARRAY_SIZE(tegra_das_resources), - .resource = tegra_das_resources, -}; diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h deleted file mode 100644 index 906a61f..0000000 --- a/arch/arm/mach-tegra/devices.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2010,2011 Google, Inc. - * - * Author: - * Colin Cross - * Erik Gilling - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __MACH_TEGRA_DEVICES_H -#define __MACH_TEGRA_DEVICES_H - -#include -#include - -#include - -extern struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config; - -extern struct tegra_ehci_platform_data tegra_ehci1_pdata; -extern struct tegra_ehci_platform_data tegra_ehci2_pdata; -extern struct tegra_ehci_platform_data tegra_ehci3_pdata; - -extern struct platform_device tegra_gpio_device; -extern struct platform_device tegra_pinmux_device; -extern struct platform_device tegra_sdhci_device1; -extern struct platform_device tegra_sdhci_device2; -extern struct platform_device tegra_sdhci_device3; -extern struct platform_device tegra_sdhci_device4; -extern struct platform_device tegra_i2c_device1; -extern struct platform_device tegra_i2c_device2; -extern struct platform_device tegra_i2c_device3; -extern struct platform_device tegra_i2c_device4; -extern struct platform_device tegra_spi_device1; -extern struct platform_device tegra_spi_device2; -extern struct platform_device tegra_spi_device3; -extern struct platform_device tegra_spi_device4; -extern struct platform_device tegra_ehci1_device; -extern struct platform_device tegra_ehci2_device; -extern struct platform_device tegra_ehci3_device; -extern struct platform_device tegra_uarta_device; -extern struct platform_device tegra_uartb_device; -extern struct platform_device tegra_uartc_device; -extern struct platform_device tegra_uartd_device; -extern struct platform_device tegra_uarte_device; -extern struct platform_device tegra_pmu_device; -extern struct platform_device tegra_i2s_device1; -extern struct platform_device tegra_i2s_device2; -extern struct platform_device tegra_das_device; - -#endif -- cgit v0.10.2 From 7ff95aeb017b2cee511c10cf6a50e312ab3b1720 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 27 Aug 2012 14:50:17 -0700 Subject: ARM: tegra: remove useless includes of Nothing from these files is needed, so remove the includes. This helps single zImage work by reducing use of the mach-tegra/include/mach/ directory. Signed-off-by: Stephen Warren diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c index 29c5114..7f27320 100644 --- a/arch/arm/mach-tegra/dma.c +++ b/arch/arm/mach-tegra/dma.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "apbio.h" diff --git a/arch/arm/mach-tegra/tegra20_clocks.c b/arch/arm/mach-tegra/tegra20_clocks.c index 840ab26..5dbc32d 100644 --- a/arch/arm/mach-tegra/tegra20_clocks.c +++ b/arch/arm/mach-tegra/tegra20_clocks.c @@ -28,7 +28,6 @@ #include #include -#include #include "clock.h" #include "fuse.h" diff --git a/arch/arm/mach-tegra/tegra20_clocks_data.c b/arch/arm/mach-tegra/tegra20_clocks_data.c index 1a35c00..c9e31c9 100644 --- a/arch/arm/mach-tegra/tegra20_clocks_data.c +++ b/arch/arm/mach-tegra/tegra20_clocks_data.c @@ -28,7 +28,6 @@ #include #include -#include #include "clock.h" #include "fuse.h" diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c index 57b5bdc..eccdce9 100644 --- a/arch/arm/mach-tegra/timer.c +++ b/arch/arm/mach-tegra/timer.c @@ -33,7 +33,6 @@ #include #include -#include #include "board.h" #include "clock.h" diff --git a/drivers/usb/phy/tegra_usb_phy.c b/drivers/usb/phy/tegra_usb_phy.c index 4739903..987116f9 100644 --- a/drivers/usb/phy/tegra_usb_phy.c +++ b/drivers/usb/phy/tegra_usb_phy.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include -- cgit v0.10.2 From f75b236d66f0113db99ed52447d6bc9376a8c2df Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 28 Aug 2012 13:11:47 -0700 Subject: ARM: tegra: delete unused headers Nothing includes these headers any more; remove them. Signed-off-by: Stephen Warren diff --git a/arch/arm/mach-tegra/include/mach/gpio-tegra.h b/arch/arm/mach-tegra/include/mach/gpio-tegra.h deleted file mode 100644 index a978b3c..0000000 --- a/arch/arm/mach-tegra/include/mach/gpio-tegra.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * arch/arm/mach-tegra/include/mach/gpio.h - * - * Copyright (C) 2010 Google, Inc. - * - * Author: - * Erik Gilling - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __MACH_TEGRA_GPIO_TEGRA_H -#define __MACH_TEGRA_GPIO_TEGRA_H - -#include -#include - -#define TEGRA_NR_GPIOS INT_GPIO_NR - -#endif diff --git a/arch/arm/mach-tegra/include/mach/suspend.h b/arch/arm/mach-tegra/include/mach/suspend.h deleted file mode 100644 index 5af8715..0000000 --- a/arch/arm/mach-tegra/include/mach/suspend.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * arch/arm/mach-tegra/include/mach/suspend.h - * - * Copyright (C) 2010 Google, Inc. - * - * Author: - * Colin Cross - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - - -#ifndef _MACH_TEGRA_SUSPEND_H_ -#define _MACH_TEGRA_SUSPEND_H_ - -void tegra_pinmux_suspend(void); -void tegra_irq_suspend(void); -void tegra_gpio_suspend(void); -void tegra_clk_suspend(void); -void tegra_dma_suspend(void); -void tegra_timer_suspend(void); - -void tegra_pinmux_resume(void); -void tegra_irq_resume(void); -void tegra_gpio_resume(void); -void tegra_clk_resume(void); -void tegra_dma_resume(void); -void tegra_timer_resume(void); - -#endif /* _MACH_TEGRA_SUSPEND_H_ */ -- cgit v0.10.2 From 3b2f9412962d2baaa8bf8297103c2ae46b6f929d Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Tue, 28 Aug 2012 14:38:18 -0700 Subject: pinctrl: tegra: move pinconf-tegra.h content into drivers/pinctrl Now that Tegra's pinmux is configured solely from device tree, there's no need for the pinconf types to be defined in arch/arm/mach-tegra/. Move it into the pinctrl directory to clean up mach-tegra, as a pre- requisite for single-zImage. Signed-off-by: Stephen Warren Acked-by: Linus Walleij diff --git a/arch/arm/mach-tegra/include/mach/pinconf-tegra.h b/arch/arm/mach-tegra/include/mach/pinconf-tegra.h deleted file mode 100644 index 1f24d30..0000000 --- a/arch/arm/mach-tegra/include/mach/pinconf-tegra.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * pinctrl configuration definitions for the NVIDIA Tegra pinmux - * - * Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __PINCONF_TEGRA_H__ -#define __PINCONF_TEGRA_H__ - -enum tegra_pinconf_param { - /* argument: tegra_pinconf_pull */ - TEGRA_PINCONF_PARAM_PULL, - /* argument: tegra_pinconf_tristate */ - TEGRA_PINCONF_PARAM_TRISTATE, - /* argument: Boolean */ - TEGRA_PINCONF_PARAM_ENABLE_INPUT, - /* argument: Boolean */ - TEGRA_PINCONF_PARAM_OPEN_DRAIN, - /* argument: Boolean */ - TEGRA_PINCONF_PARAM_LOCK, - /* argument: Boolean */ - TEGRA_PINCONF_PARAM_IORESET, - /* argument: Boolean */ - TEGRA_PINCONF_PARAM_HIGH_SPEED_MODE, - /* argument: Boolean */ - TEGRA_PINCONF_PARAM_SCHMITT, - /* argument: Boolean */ - TEGRA_PINCONF_PARAM_LOW_POWER_MODE, - /* argument: Integer, range is HW-dependant */ - TEGRA_PINCONF_PARAM_DRIVE_DOWN_STRENGTH, - /* argument: Integer, range is HW-dependant */ - TEGRA_PINCONF_PARAM_DRIVE_UP_STRENGTH, - /* argument: Integer, range is HW-dependant */ - TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING, - /* argument: Integer, range is HW-dependant */ - TEGRA_PINCONF_PARAM_SLEW_RATE_RISING, -}; - -enum tegra_pinconf_pull { - TEGRA_PINCONFIG_PULL_NONE, - TEGRA_PINCONFIG_PULL_DOWN, - TEGRA_PINCONFIG_PULL_UP, -}; - -enum tegra_pinconf_tristate { - TEGRA_PINCONFIG_DRIVEN, - TEGRA_PINCONFIG_TRISTATE, -}; - -#define TEGRA_PINCONF_PACK(_param_, _arg_) ((_param_) << 16 | (_arg_)) -#define TEGRA_PINCONF_UNPACK_PARAM(_conf_) ((_conf_) >> 16) -#define TEGRA_PINCONF_UNPACK_ARG(_conf_) ((_conf_) & 0xffff) - -#endif diff --git a/drivers/pinctrl/pinctrl-tegra.c b/drivers/pinctrl/pinctrl-tegra.c index ae52e4e..729b686 100644 --- a/drivers/pinctrl/pinctrl-tegra.c +++ b/drivers/pinctrl/pinctrl-tegra.c @@ -30,8 +30,6 @@ #include #include -#include - #include "core.h" #include "pinctrl-tegra.h" diff --git a/drivers/pinctrl/pinctrl-tegra.h b/drivers/pinctrl/pinctrl-tegra.h index 705c007..62e3809 100644 --- a/drivers/pinctrl/pinctrl-tegra.h +++ b/drivers/pinctrl/pinctrl-tegra.h @@ -16,6 +16,50 @@ #ifndef __PINMUX_TEGRA_H__ #define __PINMUX_TEGRA_H__ +enum tegra_pinconf_param { + /* argument: tegra_pinconf_pull */ + TEGRA_PINCONF_PARAM_PULL, + /* argument: tegra_pinconf_tristate */ + TEGRA_PINCONF_PARAM_TRISTATE, + /* argument: Boolean */ + TEGRA_PINCONF_PARAM_ENABLE_INPUT, + /* argument: Boolean */ + TEGRA_PINCONF_PARAM_OPEN_DRAIN, + /* argument: Boolean */ + TEGRA_PINCONF_PARAM_LOCK, + /* argument: Boolean */ + TEGRA_PINCONF_PARAM_IORESET, + /* argument: Boolean */ + TEGRA_PINCONF_PARAM_HIGH_SPEED_MODE, + /* argument: Boolean */ + TEGRA_PINCONF_PARAM_SCHMITT, + /* argument: Boolean */ + TEGRA_PINCONF_PARAM_LOW_POWER_MODE, + /* argument: Integer, range is HW-dependant */ + TEGRA_PINCONF_PARAM_DRIVE_DOWN_STRENGTH, + /* argument: Integer, range is HW-dependant */ + TEGRA_PINCONF_PARAM_DRIVE_UP_STRENGTH, + /* argument: Integer, range is HW-dependant */ + TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING, + /* argument: Integer, range is HW-dependant */ + TEGRA_PINCONF_PARAM_SLEW_RATE_RISING, +}; + +enum tegra_pinconf_pull { + TEGRA_PINCONFIG_PULL_NONE, + TEGRA_PINCONFIG_PULL_DOWN, + TEGRA_PINCONFIG_PULL_UP, +}; + +enum tegra_pinconf_tristate { + TEGRA_PINCONFIG_DRIVEN, + TEGRA_PINCONFIG_TRISTATE, +}; + +#define TEGRA_PINCONF_PACK(_param_, _arg_) ((_param_) << 16 | (_arg_)) +#define TEGRA_PINCONF_UNPACK_PARAM(_conf_) ((_conf_) >> 16) +#define TEGRA_PINCONF_UNPACK_ARG(_conf_) ((_conf_) & 0xffff) + /** * struct tegra_function - Tegra pinctrl mux function * @name: The name of the function, exported to pinctrl core. -- cgit v0.10.2 From 61ae48c3cb6bcffd1c7e18164c3d103eb62f06aa Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Tue, 21 Aug 2012 20:59:35 +0400 Subject: ARM: clps711x: Added simple clock framework Modern CPUs from CLPS711X-line can operate at frequencies other than 73 MHz. This patch adds simple clock framework for handling all possible CPU rates. Signed-off-by: Alexander Shiyan diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2f88d8d..0e76721 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -384,6 +384,8 @@ config ARCH_CLPS711X bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" select CPU_ARM720T select ARCH_USES_GETTIMEOFFSET + select COMMON_CLK + select CLKDEV_LOOKUP select NEED_MACH_MEMORY_H help Support for Cirrus Logic 711x/721x/731x based boards. diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c index f15293b..509243d 100644 --- a/arch/arm/mach-clps711x/common.c +++ b/arch/arm/mach-clps711x/common.c @@ -19,24 +19,25 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include #include #include -#include #include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include #include #include #include +#include + +static struct clk *clk_pll, *clk_bus, *clk_uart, *clk_timerl, *clk_timerh, + *clk_tint, *clk_spi; +static unsigned long latch; + /* * This maps the generic CLPS711x registers */ @@ -166,8 +167,8 @@ void __init clps711x_init_irq(void) static unsigned long clps711x_gettimeoffset(void) { unsigned long hwticks; - hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */ - return (hwticks * (tick_nsec / 1000)) / LATCH; + hwticks = latch - (clps_readl(TC2D) & 0xffff); + return (hwticks * (tick_nsec / 1000)) / latch; } /* @@ -185,15 +186,71 @@ static struct irqaction clps711x_timer_irq = { .handler = p720t_timer_interrupt, }; +static void add_fixed_clk(struct clk *clk, const char *name, int rate) +{ + clk = clk_register_fixed_rate(NULL, name, NULL, CLK_IS_ROOT, rate); + clk_register_clkdev(clk, name, NULL); +} + static void __init clps711x_timer_init(void) { - unsigned int syscon; + int osc, ext, pll, cpu, bus, timl, timh, uart, spi; + u32 tmp; + + osc = 3686400; + ext = 13000000; + + tmp = clps_readl(PLLR) >> 24; + if (tmp) + pll = (osc * tmp) / 2; + else + pll = 73728000; /* Default value */ + + tmp = clps_readl(SYSFLG2); + if (tmp & SYSFLG2_CKMODE) { + cpu = ext; + bus = cpu; + spi = 135400; + } else { + cpu = pll; + if (cpu >= 36864000) + bus = cpu / 2; + else + bus = 36864000 / 2; + spi = cpu / 576; + } + + uart = bus / 10; + + if (tmp & SYSFLG2_CKMODE) { + tmp = clps_readl(SYSCON2); + if (tmp & SYSCON2_OSTB) + timh = ext / 26; + else + timh = 541440; + } else + timh = cpu / 144; + + timl = timh / 256; + + /* All clocks are fixed */ + add_fixed_clk(clk_pll, "pll", pll); + add_fixed_clk(clk_bus, "bus", bus); + add_fixed_clk(clk_uart, "uart", uart); + add_fixed_clk(clk_timerl, "timer_lf", timl); + add_fixed_clk(clk_timerh, "timer_hf", timh); + add_fixed_clk(clk_tint, "tint", 64); + add_fixed_clk(clk_spi, "spi", spi); + + pr_info("CPU frequency set at %i Hz.\n", cpu); + + latch = (timh + HZ / 2) / HZ; - syscon = clps_readl(SYSCON1); - syscon |= SYSCON1_TC2S | SYSCON1_TC2M; - clps_writel(syscon, SYSCON1); + tmp = clps_readl(SYSCON1); + tmp |= SYSCON1_TC2S | SYSCON1_TC2M; + clps_writel(tmp, SYSCON1); - clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */ + clps_writel(latch - 1, TC2D); setup_irq(IRQ_TC2OI, &clps711x_timer_irq); } diff --git a/arch/arm/mach-clps711x/include/mach/timex.h b/arch/arm/mach-clps711x/include/mach/timex.h index ac8823c..de6fd19 100644 --- a/arch/arm/mach-clps711x/include/mach/timex.h +++ b/arch/arm/mach-clps711x/include/mach/timex.h @@ -1,23 +1,2 @@ -/* - * arch/arm/mach-clps711x/include/mach/timex.h - * - * Prospector 720T architecture timex specifications - * - * Copyright (C) 2000 Deep Blue Solutions Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - +/* Bogus value */ #define CLOCK_TICK_RATE 512000 -- cgit v0.10.2 From 7255f87a7169689be2d4722375744a1f932d4b28 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Tue, 21 Aug 2012 20:59:34 +0400 Subject: ARM: clps711x: Fix lowlevel debug-macro CTS signal can not be used for the port and tied to any logic state. In this case we have an infinite loop waiting for the signal. For fix this problem, checking CTS removed, waiting for the signal "busy" was postponed after the byte write to the port. Signed-off-by: Alexander Shiyan diff --git a/arch/arm/mach-clps711x/include/mach/debug-macro.S b/arch/arm/mach-clps711x/include/mach/debug-macro.S index 118b3d9..cb3684f 100644 --- a/arch/arm/mach-clps711x/include/mach/debug-macro.S +++ b/arch/arm/mach-clps711x/include/mach/debug-macro.S @@ -28,17 +28,11 @@ .endm .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx - tst \rd, #1 << 11 @ UBUSYx - bne 1001b .endm .macro busyuart,rd,rx - tst \rx, #0x1000 @ UART2 does not have CTS here - bne 1002f 1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx - tst \rd, #1 << 8 @ CTS + tst \rd, #1 << 11 @ UBUSYx bne 1001b -1002: .endm -- cgit v0.10.2 From afc49177b412dfe547c60740ac1f1db7f805da43 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Tue, 21 Aug 2012 20:59:33 +0400 Subject: ARM: clps711x: Fix register definitions This patch contain some fixes: - Fixes the address of register PORTE. - Corrects name for DAIDR0 register. - Removes unused definition for SYNCIO_CFGLEN. - Fixes definition SYNCIO_FRMLEN. Signed-off-by: Alexander Shiyan diff --git a/arch/arm/mach-clps711x/include/mach/clps711x.h b/arch/arm/mach-clps711x/include/mach/clps711x.h index 1dd806f..c82e21c 100644 --- a/arch/arm/mach-clps711x/include/mach/clps711x.h +++ b/arch/arm/mach-clps711x/include/mach/clps711x.h @@ -31,8 +31,8 @@ #define PBDDR (0x0041) #define PCDDR (0x0042) #define PDDDR (0x0043) -#define PEDR (0x0080) -#define PEDDR (0x00c0) +#define PEDR (0x0083) +#define PEDDR (0x00c3) #define SYSCON1 (0x0100) #define SYSFLG1 (0x0140) #define MEMCFG1 (0x0180) @@ -77,7 +77,7 @@ #define KBDEOI (0x1700) #define DAIR (0x2000) -#define DAIR0 (0x2040) +#define DAIDR0 (0x2040) #define DAIDR1 (0x2080) #define DAIDR2 (0x20c0) #define DAISR (0x2100) @@ -191,8 +191,7 @@ #define UBRLCR_WRDLEN8 (3 << 17) #define UBRLCR_WRDLEN_MASK (3 << 17) -#define SYNCIO_FRMLEN(x) (((x) & 0x3f) << 7) -#define SYNCIO_CFGLEN(x) ((x) & 0x7f) +#define SYNCIO_FRMLEN(x) (((x) & 0x1f) << 8) #define SYNCIO_SMCKEN (1 << 13) #define SYNCIO_TXFRMEN (1 << 14) -- cgit v0.10.2 From 1c3a918f78b72fb60fcc9ca9a4cebc90de570e58 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Tue, 21 Aug 2012 20:59:32 +0400 Subject: ARM: clps711x: Remove board support for CEIVA The current kernel does not fit in the CEIVA ROM. Also, some functional has already been removed due migrate from 2.6 to 3.0, and it seems that no one uses this platform. So, remove support for this board and modules specific only to this board. Signed-off-by: Alexander Shiyan diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig index ea036d6..e613536 100644 --- a/arch/arm/mach-clps711x/Kconfig +++ b/arch/arm/mach-clps711x/Kconfig @@ -16,12 +16,6 @@ config ARCH_CDB89712 The board includes 2 serial ports, Ethernet, IRDA, and expansion headers. It comes with 16 MB SDRAM and 8 MB flash ROM. -config ARCH_CEIVA - bool "CEIVA" - help - Say Y here if you intend to run this kernel on the Ceiva/Polaroid - PhotoMax Digital Picture Frame. - config ARCH_CLEP7312 bool "CLEP7312" help diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile index f2f0256..aed9eb6 100644 --- a/arch/arm/mach-clps711x/Makefile +++ b/arch/arm/mach-clps711x/Makefile @@ -9,7 +9,6 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_ARCH_CEIVA) += ceiva.o obj-$(CONFIG_ARCH_AUTCPU12) += autcpu12.o obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c deleted file mode 100644 index a70147e..0000000 --- a/arch/arm/mach-clps711x/ceiva.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * linux/arch/arm/mach-clps711x/arch-ceiva.c - * - * Copyright (C) 2002, Rob Scott - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -#include "common.h" - -static struct map_desc ceiva_io_desc[] __initdata = { - /* SED1355 controlled video RAM & registers */ - { - .virtual = CEIVA_VIRT_SED1355, - .pfn = __phys_to_pfn(CEIVA_PHYS_SED1355), - .length = SZ_2M, - .type = MT_DEVICE - } -}; - - -static void __init ceiva_map_io(void) -{ - clps711x_map_io(); - iotable_init(ceiva_io_desc, ARRAY_SIZE(ceiva_io_desc)); -} - - -MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame") - /* Maintainer: Rob Scott */ - .atag_offset = 0x100, - .map_io = ceiva_map_io, - .init_irq = clps711x_init_irq, - .timer = &clps711x_timer, - .restart = clps711x_restart, -MACHINE_END diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h index 13a64fc..8497775 100644 --- a/arch/arm/mach-clps711x/include/mach/hardware.h +++ b/arch/arm/mach-clps711x/include/mach/hardware.h @@ -116,7 +116,6 @@ #endif /* CONFIG_ARCH_EDB7211 */ - /* * Relevant bits in port D, which controls power to the various parts of * the LCD on the EDB7211. @@ -125,51 +124,4 @@ #define EDB_PD2_LCDEN (1<<2) #define EDB_PD3_LCDBL (1<<3) - -#if defined (CONFIG_ARCH_CEIVA) - -/* - * The two flash banks are wired to chip selects 0 and 1. This is the mapping - * for them. - * - * nCS0 and nCS1 are at 0x70000000 and 0x60000000, respectively, when running - * in jumpered boot mode. - */ -#define CEIVA_PHYS_FLASH1 CS0_PHYS_BASE /* physical */ -#define CEIVA_PHYS_FLASH2 CS1_PHYS_BASE /* physical */ - -#define CEIVA_VIRT_FLASH1 (0xfa000000) /* virtual */ -#define CEIVA_VIRT_FLASH2 (0xfb000000) /* virtual */ - -#define CEIVA_FLASH_SIZE 0x100000 -#define CEIVA_FLASH_WIDTH 2 - -/* - * SED1355 LCD controller - */ -#define CEIVA_PHYS_SED1355 CS2_PHYS_BASE -#define CEIVA_VIRT_SED1355 (0xfc000000) - -/* - * Relevant bits in port D, which controls power to the various parts of - * the LCD on the Ceiva Photo Max, and reset to the LCD controller. - */ - -// Reset line to SED1355 (must be high to operate) -#define CEIVA_PD1_LCDRST (1<<1) -// LCD panel enable (set to one, to enable LCD) -#define CEIVA_PD4_LCDEN (1<<4) -// Backlight (set to one, to turn on backlight -#define CEIVA_PD5_LCDBL (1<<5) - -/* - * Relevant bits in port B, which report the status of the buttons. - */ - -// White button -#define CEIVA_PB4_WHT_BTN (1<<4) -// Black button -#define CEIVA_PB0_BLK_BTN (1<<0) -#endif // #if defined (CONFIG_ARCH_CEIVA) - #endif diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 2997e56..ae87c5e 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types @@ -66,7 +66,6 @@ iq80321 ARCH_IQ80321 IQ80321 169 ks8695 ARCH_KS8695 KS8695 180 karo ARCH_KARO KARO 190 smdk2410 ARCH_SMDK2410 SMDK2410 193 -ceiva ARCH_CEIVA CEIVA 200 voiceblue MACH_VOICEBLUE VOICEBLUE 218 h5400 ARCH_H5400 H5400 220 omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234 diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 0217f74..8c17adb 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -979,18 +979,6 @@ config FB_PVR2 (). Please see the file . -config FB_EPSON1355 - bool "Epson 1355 framebuffer support" - depends on (FB = y) && ARCH_CEIVA - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - Build in support for the SED1355 Epson Research Embedded RAMDAC - LCD/CRT Controller (since redesignated as the S1D13505) as a - framebuffer. Product specs at - . - config FB_S1D13XXX tristate "Epson S1D13XXX framebuffer support" depends on FB diff --git a/drivers/video/Makefile b/drivers/video/Makefile index ee8dafb..1940359 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -94,7 +94,6 @@ obj-$(CONFIG_FB_G364) += g364fb.o obj-$(CONFIG_FB_EP93XX) += ep93xx-fb.o obj-$(CONFIG_FB_SA1100) += sa1100fb.o obj-$(CONFIG_FB_HIT) += hitfb.o -obj-$(CONFIG_FB_EPSON1355) += epson1355fb.o obj-$(CONFIG_FB_ATMEL) += atmel_lcdfb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o obj-$(CONFIG_FB_VOODOO1) += sstfb.o diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c deleted file mode 100644 index 68b9b51..0000000 --- a/drivers/video/epson1355fb.c +++ /dev/null @@ -1,749 +0,0 @@ -/* - * linux/drivers/video/epson1355fb.c -- Epson S1D13505 frame buffer for 2.5. - * - * Epson Research S1D13505 Embedded RAMDAC LCD/CRT Controller - * (previously known as SED1355) - * - * Cf. http://vdc.epson.com/ - * - * - * Copyright (C) Hewlett-Packard Company. All rights reserved. - * - * Written by Christopher Hoover - * - * Adapted from: - * - * linux/drivers/video/skeletonfb.c - * Modified to new api Jan 2001 by James Simmons (jsimmons@infradead.org) - * Created 28 Dec 1997 by Geert Uytterhoeven - * - * linux/drivers/video/epson1355fb.c (2.4 driver) - * Copyright (C) 2000 Philipp Rumpf - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * - * Noteworthy Issues - * ----------------- - * - * This driver is complicated by the fact that this is a 16-bit chip - * and, on at least one platform (ceiva), we can only do 16-bit reads - * and writes to the framebuffer. We hide this from user space - * except in the case of mmap(). - * - * - * To Do - * ----- - * - * - Test 8-bit pseudocolor mode - * - Allow setting bpp, virtual resolution - * - Implement horizontal panning - * - (maybe) Implement hardware cursor - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include