Skip to content

Commit

Permalink
Merge branch 'mxc-master' of git://git.pengutronix.de/git/imx/linux-2…
Browse files Browse the repository at this point in the history
….6 into devel
  • Loading branch information
Russell King authored and Russell King committed Jun 8, 2009
2 parents c068303 + a089516 commit 2d8d249
Show file tree
Hide file tree
Showing 20 changed files with 1,123 additions and 29 deletions.
8 changes: 8 additions & 0 deletions arch/arm/mach-mx2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,12 @@ config MACH_MX27_3DS
help
Include support for MX27PDK platform. This includes specific
configurations for the board and its peripherals.

config MACH_MX27LITE
bool "LogicPD MX27 LITEKIT platform"
depends on MACH_MX27
help
Include support for MX27 LITEKIT platform. This includes specific
configurations for the board and its peripherals.

endif
2 changes: 2 additions & 0 deletions arch/arm/mach-mx2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o
obj-$(CONFIG_MACH_PCM038) += pcm038.o
obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o
obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o

77 changes: 51 additions & 26 deletions arch/arm/mach-mx2/clock_imx21.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ static void _clk_disable(struct clk *clk)
__raw_writel(reg, clk->enable_reg);
}

static unsigned long _clk_generic_round_rate(struct clk *clk,
unsigned long rate,
u32 max_divisor)
{
u32 div;
unsigned long parent_rate;

parent_rate = clk_get_rate(clk->parent);

div = parent_rate / rate;
if (parent_rate % rate)
div++;

if (div > max_divisor)
div = max_divisor;

return parent_rate / div;
}

static int _clk_spll_enable(struct clk *clk)
{
u32 reg;
Expand Down Expand Up @@ -78,19 +97,7 @@ static void _clk_spll_disable(struct clk *clk)
static unsigned long _clk_perclkx_round_rate(struct clk *clk,
unsigned long rate)
{
u32 div;
unsigned long parent_rate;

parent_rate = clk_get_rate(clk->parent);

div = parent_rate / rate;
if (parent_rate % rate)
div++;

if (div > 64)
div = 64;

return parent_rate / div;
return _clk_generic_round_rate(clk, rate, 64);
}

static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate)
Expand Down Expand Up @@ -130,6 +137,32 @@ static unsigned long _clk_usb_recalc(struct clk *clk)
return parent_rate / (usb_pdf + 1U);
}

static unsigned long _clk_usb_round_rate(struct clk *clk,
unsigned long rate)
{
return _clk_generic_round_rate(clk, rate, 8);
}

static int _clk_usb_set_rate(struct clk *clk, unsigned long rate)
{
u32 reg;
u32 div;
unsigned long parent_rate;

parent_rate = clk_get_rate(clk->parent);

div = parent_rate / rate;
if (div > 8 || div < 1 || ((parent_rate / div) != rate))
return -EINVAL;
div--;

reg = CSCR() & ~CCM_CSCR_USB_MASK;
reg |= div << CCM_CSCR_USB_OFFSET;
__raw_writel(reg, CCM_CSCR);

return 0;
}

static unsigned long _clk_ssix_recalc(struct clk *clk, unsigned long pdf)
{
unsigned long parent_rate;
Expand Down Expand Up @@ -595,11 +628,14 @@ static struct clk csi_clk[] = {
static struct clk usb_clk[] = {
{
.parent = &spll_clk,
.secondary = &usb_clk[1],
.get_rate = _clk_usb_recalc,
.enable = _clk_enable,
.enable_reg = CCM_PCCR_USBOTG_REG,
.enable_shift = CCM_PCCR_USBOTG_OFFSET,
.disable = _clk_disable,
.round_rate = _clk_usb_round_rate,
.set_rate = _clk_usb_set_rate,
}, {
.parent = &hclk_clk,
.enable = _clk_enable,
Expand Down Expand Up @@ -768,18 +804,7 @@ static struct clk rtc_clk = {

static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate)
{
u32 div;
unsigned long parent_rate;

parent_rate = clk_get_rate(clk->parent);
div = parent_rate / rate;
if (parent_rate % rate)
div++;

if (div > 8)
div = 8;

return parent_rate / div;
return _clk_generic_round_rate(clk, rate, 8);
}

static int _clk_clko_set_rate(struct clk *clk, unsigned long rate)
Expand Down Expand Up @@ -921,7 +946,7 @@ static struct clk_lookup lookups[] __initdata = {
_REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2])
_REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0])
_REGISTER_CLOCK(NULL, "csi", csi_clk[0])
_REGISTER_CLOCK(NULL, "usb", usb_clk[0])
_REGISTER_CLOCK("imx21-hcd.0", NULL, usb_clk[0])
_REGISTER_CLOCK(NULL, "ssi1", ssi_clk[0])
_REGISTER_CLOCK(NULL, "ssi2", ssi_clk[1])
_REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
Expand Down
95 changes: 95 additions & 0 deletions arch/arm/mach-mx2/mx27lite.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright 2007 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
* Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
* Copyright 2009 Daniel Schaeffer (daniel.schaeffer@timesys.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/platform_device.h>
#include <linux/gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <mach/hardware.h>
#include <mach/common.h>
#include <mach/imx-uart.h>
#include <mach/iomux.h>
#include <mach/board-mx27lite.h>

#include "devices.h"

static unsigned int mx27lite_pins[] = {
/* UART1 */
PE12_PF_UART1_TXD,
PE13_PF_UART1_RXD,
PE14_PF_UART1_CTS,
PE15_PF_UART1_RTS,
/* FEC */
PD0_AIN_FEC_TXD0,
PD1_AIN_FEC_TXD1,
PD2_AIN_FEC_TXD2,
PD3_AIN_FEC_TXD3,
PD4_AOUT_FEC_RX_ER,
PD5_AOUT_FEC_RXD1,
PD6_AOUT_FEC_RXD2,
PD7_AOUT_FEC_RXD3,
PD8_AF_FEC_MDIO,
PD9_AIN_FEC_MDC,
PD10_AOUT_FEC_CRS,
PD11_AOUT_FEC_TX_CLK,
PD12_AOUT_FEC_RXD0,
PD13_AOUT_FEC_RX_DV,
PD14_AOUT_FEC_RX_CLK,
PD15_AOUT_FEC_COL,
PD16_AIN_FEC_TX_ER,
PF23_AIN_FEC_TX_EN,
};

static struct imxuart_platform_data uart_pdata = {
.flags = IMXUART_HAVE_RTSCTS,
};

static struct platform_device *platform_devices[] __initdata = {
&mxc_fec_device,
};

static void __init mx27lite_init(void)
{
mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins),
"imx27lite");
mxc_register_device(&mxc_uart_device0, &uart_pdata);
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
}

static void __init mx27lite_timer_init(void)
{
mx27_clocks_init(26000000);
}

static struct sys_timer mx27lite_timer = {
.init = mx27lite_timer_init,
};

MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
.phys_io = AIPI_BASE_ADDR,
.io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
.boot_params = PHYS_OFFSET + 0x100,
.map_io = mx27_map_io,
.init_irq = mxc_init_irq,
.init_machine = mx27lite_init,
.timer = &mx27lite_timer,
MACHINE_END
2 changes: 1 addition & 1 deletion arch/arm/mach-mx2/mx27pdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
.phys_io = AIPI_BASE_ADDR,
.io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
.boot_params = PHYS_OFFSET + 0x100,
.map_io = mxc_map_io,
.map_io = mx27_map_io,
.init_irq = mxc_init_irq,
.init_machine = mx27pdk_init,
.timer = &mx27pdk_timer,
Expand Down
21 changes: 21 additions & 0 deletions arch/arm/mach-mx3/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ config MACH_MX31MOBOARD
Include support for mx31moboard platform. This includes specific
configurations for the board and its peripherals.

config MACH_MX31LILLY
bool "Support MX31 LILLY-1131 platforms (INCO startec)"
select ARCH_MX31
help
Include support for mx31 based LILLY1131 modules. This includes
specific configurations for the board and its peripherals.

config MACH_QONG
bool "Support Dave/DENX QongEVB-LITE platform"
select ARCH_MX31
Expand All @@ -71,4 +78,18 @@ config MACH_PCM043
Include support for Phytec pcm043 platform. This includes
specific configurations for the board and its peripherals.

config MACH_ARMADILLO5X0
bool "Support Atmark Armadillo-500 Development Base Board"
select ARCH_MX31
help
Include support for Atmark Armadillo-500 platform. This includes
specific configurations for the board and its peripherals.

config MACH_MX35_3DS
bool "Support MX35PDK platform"
select ARCH_MX35
default n
help
Include support for MX35PDK platform. This includes specific
configurations for the board and its peripherals.
endif
3 changes: 3 additions & 0 deletions arch/arm/mach-mx3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ obj-y := mm.o devices.o
obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o
obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
obj-$(CONFIG_MACH_PCM037) += pcm037.o
obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
mx31moboard-marxbot.o
obj-$(CONFIG_MACH_QONG) += qong.o
obj-$(CONFIG_MACH_PCM043) += pcm043.o
obj-$(CONFIG_MACH_ARMADILLO5X0) += armadillo5x0.o
obj-$(CONFIG_MACH_MX35_3DS) += mx35pdk.o
Loading

0 comments on commit 2d8d249

Please sign in to comment.