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

Commit 51a1ec01 authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge branch 'nomadik-for-arm-soc' of...

Merge branch 'nomadik-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into next/soc

* 'nomadik-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik:
  ARM: nomadik: bump all IRQ numbers by one
  ARM: nomadik: register the MMC/SD device
  ARM: nomadik: register the I2C devices
  ARM: nomadik: register all three I2C busses
  ARM: nomadik: convert to generic clock
  ARM: nomadik: register PL031 RTC
  ARM: nomadik: register AMBA devices dynamically
  ARM: nomadik: register GPIOs dynamically
parents 485802a6 a15687c4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -911,7 +911,7 @@ config ARCH_NOMADIK
	select ARM_AMBA
	select ARM_VIC
	select CPU_ARM926T
	select CLKDEV_LOOKUP
	select COMMON_CLK
	select GENERIC_CLOCKEVENTS
	select PINCTRL
	select MIGHT_HAVE_CACHE_L2X0
+0 −2
Original line number Diff line number Diff line
@@ -7,8 +7,6 @@

# Object file lists.

obj-y			+= clock.o

# Cpu revision
obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o

+55 −12
Original line number Diff line number Diff line
@@ -14,12 +14,14 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/amba/bus.h>
#include <linux/amba/mmci.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/partitions.h>
#include <linux/i2c.h>
#include <linux/io.h>
#include <asm/hardware/vic.h>
#include <asm/sizes.h>
@@ -185,16 +187,28 @@ static void __init nhk8815_onenand_init(void)
#endif
}

static AMBA_APB_DEVICE(uart0, "uart0", 0, NOMADIK_UART0_BASE,
	{ IRQ_UART0 }, NULL);
static struct mmci_platform_data mmcsd_plat_data = {
	.ocr_mask = MMC_VDD_29_30,
	.f_max = 48000000,
	.gpio_wp = -1,
	.gpio_cd = 111,
	.cd_invert = true,
	.capabilities = MMC_CAP_MMC_HIGHSPEED |
	MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA,
};

static AMBA_APB_DEVICE(uart1, "uart1", 0, NOMADIK_UART1_BASE,
	{ IRQ_UART1 }, NULL);
static int __init nhk8815_mmcsd_init(void)
{
	int ret;

static struct amba_device *amba_devs[] __initdata = {
	&uart0_device,
	&uart1_device,
};
	ret = gpio_request(112, "card detect bias");
	if (ret)
		return ret;
	gpio_direction_output(112, 0);
	amba_apb_device_add(NULL, "mmci", NOMADIK_SDI_BASE, SZ_4K, IRQ_SDMMC, 0, &mmcsd_plat_data, 0x10180180);
	return 0;
}
module_init(nhk8815_mmcsd_init);

static struct resource nhk8815_eth_resources[] = {
	{
@@ -253,17 +267,46 @@ static struct sys_timer nomadik_timer = {
	.init	= nomadik_timer_init,
};

static void __init nhk8815_platform_init(void)
static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = {
	{
	int i;
		I2C_BOARD_INFO("stw4811", 0x2d),
	},
};

static struct i2c_board_info __initdata nhk8815_i2c1_devices[] = {
	{
		I2C_BOARD_INFO("camera", 0x10),
	},
	{
		I2C_BOARD_INFO("stw5095", 0x1a),
	},
	{
		I2C_BOARD_INFO("lis3lv02dl", 0x1d),
	},
};

static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = {
	{
		I2C_BOARD_INFO("stw4811-usb", 0x2d),
	},
};

static void __init nhk8815_platform_init(void)
{
	cpu8815_platform_init();
	nhk8815_onenand_init();
	platform_add_devices(nhk8815_platform_devices,
			     ARRAY_SIZE(nhk8815_platform_devices));

	for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
		amba_device_register(amba_devs[i], &iomem_resource);
	amba_apb_device_add(NULL, "uart0", NOMADIK_UART0_BASE, SZ_4K, IRQ_UART0, 0, NULL, 0);
	amba_apb_device_add(NULL, "uart1", NOMADIK_UART1_BASE, SZ_4K, IRQ_UART1, 0, NULL, 0);

	i2c_register_board_info(0, nhk8815_i2c0_devices,
				ARRAY_SIZE(nhk8815_i2c0_devices));
	i2c_register_board_info(1, nhk8815_i2c1_devices,
				ARRAY_SIZE(nhk8815_i2c1_devices));
	i2c_register_board_info(2, nhk8815_i2c2_devices,
				ARRAY_SIZE(nhk8815_i2c2_devices));
}

MACHINE_START(NOMADIK, "NHK8815")

arch/arm/mach-nomadik/clock.c

deleted100644 → 0
+0 −75
Original line number Diff line number Diff line
/*
 *  linux/arch/arm/mach-nomadik/clock.c
 *
 *  Copyright (C) 2009 Alessandro Rubini
 */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include "clock.h"

/*
 * The nomadik board uses generic clocks, but the serial pl011 file
 * calls clk_enable(), clk_disable(), clk_get_rate(), so we provide them
 */
unsigned long clk_get_rate(struct clk *clk)
{
	return clk->rate;
}
EXPORT_SYMBOL(clk_get_rate);

/* enable and disable do nothing */
int clk_enable(struct clk *clk)
{
	return 0;
}
EXPORT_SYMBOL(clk_enable);

void clk_disable(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_disable);

static struct clk clk_24 = {
	.rate = 2400000,
};

static struct clk clk_48 = {
	.rate = 48 * 1000 * 1000,
};

/*
 * Catch-all default clock to satisfy drivers using the clk API.  We don't
 * model the actual hardware clocks yet.
 */
static struct clk clk_default;

#define CLK(_clk, dev)				\
	{					\
		.clk		= _clk,		\
		.dev_id		= dev,		\
	}

static struct clk_lookup lookups[] = {
	{
		.con_id		= "apb_pclk",
		.clk		= &clk_default,
	},
	CLK(&clk_24, "mtu0"),
	CLK(&clk_24, "mtu1"),
	CLK(&clk_48, "uart0"),
	CLK(&clk_48, "uart1"),
	CLK(&clk_default, "gpio.0"),
	CLK(&clk_default, "gpio.1"),
	CLK(&clk_default, "gpio.2"),
	CLK(&clk_default, "gpio.3"),
	CLK(&clk_default, "rng"),
};

int __init clk_init(void)
{
	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
	return 0;
}

arch/arm/mach-nomadik/clock.h

deleted100644 → 0
+0 −15
Original line number Diff line number Diff line

/*
 *  linux/arch/arm/mach-nomadik/clock.h
 *
 *  Copyright (C) 2009 Alessandro Rubini
 *
 * 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.
 */
struct clk {
	unsigned long		rate;
};

int __init clk_init(void);
Loading