Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9a91de7 authored by Tony Prisk's avatar Tony Prisk
Browse files

arm: vt8500: Update arch-vt8500 to devicetree support.



Merged existing board files to a single dt-capable file.
Converted irq and timer code to devicetree.
Removed existing device files that are no longer required with
devicetree support.
All existing platform devices are converted to devicetree nodes
except PWM.

Removed restart.c and moved code into vt8500.c to remove
duplicate PMC code.

Signed-off-by: default avatarTony Prisk <linux@prisktech.co.nz>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 4e48b1c5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1005,6 +1005,10 @@ config ARCH_VT8500
	select ARCH_HAS_CPUFREQ
	select GENERIC_CLOCKEVENTS
	select ARCH_REQUIRE_GPIOLIB
	select USE_OF
	select COMMON_CLK
	select HAVE_CLK
	select CLKDEV_LOOKUP
	help
	  Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.

@@ -1129,8 +1133,6 @@ source "arch/arm/mach-versatile/Kconfig"
source "arch/arm/mach-vexpress/Kconfig"
source "arch/arm/plat-versatile/Kconfig"

source "arch/arm/mach-vt8500/Kconfig"

source "arch/arm/mach-w90x900/Kconfig"

# Definitions to make life easier
@@ -1623,6 +1625,7 @@ config ARCH_NR_GPIO
	default 355 if ARCH_U8500
	default 264 if MACH_H4700
	default 512 if SOC_OMAP5
	default 288 if ARCH_VT8500
	default 0
	help
	  Maximum number of GPIOs in the system.

arch/arm/mach-vt8500/Kconfig

deleted100644 → 0
+0 −73
Original line number Diff line number Diff line
if ARCH_VT8500

config VTWM_VERSION_VT8500
	bool

config VTWM_VERSION_WM8505
	bool

config MACH_BV07
	bool "Benign BV07-8500 Mini Netbook"
	depends on ARCH_VT8500
	select VTWM_VERSION_VT8500
	help
	  Add support for the inexpensive 7-inch netbooks sold by many
	  Chinese distributors under various names. Note that there are
	  many hardware implementations in identical exterior, make sure
	  that yours is indeed based on a VIA VT8500 chip.

config MACH_WM8505_7IN_NETBOOK
	bool "WM8505 7-inch generic netbook"
	depends on ARCH_VT8500
	select VTWM_VERSION_WM8505
	help
	  Add support for the inexpensive 7-inch netbooks sold by many
	  Chinese distributors under various names. Note that there are
	  many hardware implementations in identical exterior, make sure
	  that yours is indeed based on a WonderMedia WM8505 chip.

comment "LCD panel size"

config WMT_PANEL_800X480
	bool "7-inch with 800x480 resolution"
	depends on (FB_VT8500 || FB_WM8505)
	default y
	help
	  These are found in most of the netbooks in generic cases, as
	  well as in Eken M001 tablets and possibly elsewhere.

	  To select this panel at runtime, say y here and append
	  'panel=800x480' to your kernel command line. Otherwise, the
	  largest one available will be used.

config WMT_PANEL_800X600
	bool "8-inch with 800x600 resolution"
	depends on (FB_VT8500 || FB_WM8505)
	help
	  These are found in Eken M003 tablets and possibly elsewhere.

	  To select this panel at runtime, say y here and append
	  'panel=800x600' to your kernel command line. Otherwise, the
	  largest one available will be used.

config WMT_PANEL_1024X576
	bool "10-inch with 1024x576 resolution"
	depends on (FB_VT8500 || FB_WM8505)
	help
	  These are found in CherryPal netbooks and possibly elsewhere.

	  To select this panel at runtime, say y here and append
	  'panel=1024x576' to your kernel command line. Otherwise, the
	  largest one available will be used.

config WMT_PANEL_1024X600
	bool "10-inch with 1024x600 resolution"
	depends on (FB_VT8500 || FB_WM8505)
	help
	  These are found in Eken M006 tablets and possibly elsewhere.

	  To select this panel at runtime, say y here and append
	  'panel=1024x600' to your kernel command line. Otherwise, the
	  largest one available will be used.

endif
+1 −7
Original line number Diff line number Diff line
obj-y += devices.o gpio.o irq.o timer.o restart.o

obj-$(CONFIG_VTWM_VERSION_VT8500) += devices-vt8500.o
obj-$(CONFIG_VTWM_VERSION_WM8505) += devices-wm8505.o

obj-$(CONFIG_MACH_BV07) += bv07.o
obj-$(CONFIG_MACH_WM8505_7IN_NETBOOK) += wm8505_7in.o
obj-$(CONFIG_ARCH_VT8500) += irq.o timer.o vt8500.o

arch/arm/mach-vt8500/bv07.c

deleted100644 → 0
+0 −80
Original line number Diff line number Diff line
/*
 *  arch/arm/mach-vt8500/bv07.c
 *
 *  Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
 *
 * 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 <linux/io.h>
#include <linux/pm.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/restart.h>

#include "devices.h"

static void __iomem *pmc_hiber;

static struct platform_device *devices[] __initdata = {
	&vt8500_device_uart0,
	&vt8500_device_lcdc,
	&vt8500_device_ehci,
	&vt8500_device_ge_rops,
	&vt8500_device_pwm,
	&vt8500_device_pwmbl,
	&vt8500_device_rtc,
};

static void vt8500_power_off(void)
{
	local_irq_disable();
	writew(5, pmc_hiber);
	asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
}

void __init bv07_init(void)
{
#ifdef CONFIG_FB_VT8500
	void __iomem *gpio_mux_reg = ioremap(wmt_gpio_base + 0x200, 4);
	if (gpio_mux_reg) {
		writel(readl(gpio_mux_reg) | 1, gpio_mux_reg);
		iounmap(gpio_mux_reg);
	} else {
		printk(KERN_ERR "Could not remap the GPIO mux register, display may not work properly!\n");
	}
#endif
	pmc_hiber = ioremap(wmt_pmc_base + 0x12, 2);
	if (pmc_hiber)
		pm_power_off = &vt8500_power_off;
	else
		printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n");

	wmt_setup_restart();
	vt8500_set_resources();
	platform_add_devices(devices, ARRAY_SIZE(devices));
	vt8500_gpio_init();
}

MACHINE_START(BV07, "Benign BV07 Mini Netbook")
	.atag_offset	= 0x100,
	.restart	= wmt_restart,
	.reserve	= vt8500_reserve_mem,
	.map_io		= vt8500_map_io,
	.init_irq	= vt8500_init_irq,
	.timer		= &vt8500_timer,
	.init_machine	= bv07_init,
MACHINE_END
+28 −0
Original line number Diff line number Diff line
/* linux/arch/arm/mach-vt8500/restart.c
/* linux/arch/arm/mach-vt8500/dt_common.h
 *
 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
 *
@@ -12,43 +12,17 @@
 * GNU General Public License for more details.
 *
 */
#include <asm/io.h>
#include <linux/of.h>
#include <linux/of_address.h>

#define LEGACY_PMC_BASE		0xD8130000
#define WMT_PRIZM_PMSR_REG	0x60

static void __iomem *pmc_base;

void wmt_setup_restart(void)
{
	struct device_node *np;
#ifndef __ARCH_ARM_MACH_VT8500_DT_COMMON_H
#define __ARCH_ARM_MACH_VT8500_DT_COMMON_H

	/*
	 * Check if Power Mgmt Controller node is present in device tree. If no
	 * device tree node, use the legacy PMSR value (valid for all current
	 * SoCs).
	 */
	np = of_find_compatible_node(NULL, NULL, "wmt,prizm-pmc");
	if (np) {
		pmc_base = of_iomap(np, 0);
#include <linux/of.h>

		if (!pmc_base)
			pr_err("%s:of_iomap(pmc) failed\n", __func__);
void __init vt8500_timer_init(void);
int __init vt8500_irq_init(struct device_node *node,
				struct device_node *parent);

		of_node_put(np);
	} else {
		pmc_base = ioremap(LEGACY_PMC_BASE, 0x1000);
		if (!pmc_base) {
			pr_err("%s:ioremap(rstc) failed\n", __func__);
			return;
		}
	}
}
/* defined in drivers/clk/clk-vt8500.c */
void __init vtwm_clk_init(void __iomem *pmc_base);

void wmt_restart(char mode, const char *cmd)
{
	if (pmc_base)
		writel(1, pmc_base + WMT_PRIZM_PMSR_REG);
}
#endif
Loading