LPC32XX architecture files (updated v4)
Subsystems (5)
Thanks again for the review comments. This patchset is the 4rth release with many review comments incorporated.
Changes from previous release to v4 (02/19/2010)
Review comment changes...
Removed the include/mach/board.h file until it is actually needed Changed IRQ macros for SIC1 and SIC2 and handling in SIC1/SIC2
chained handlers
Size macros in platform.h changed to numeric values Changed uncompress macros to use __raw_readl/writel instead of
direct register access using volatile unsigned long *
Removed unused LPC32XX_CLKPWR_SET_PLL_USBPDIV macro printascii debug macro assembly optimized
Fixed an issue with macros using _REG being doubled casted. After
looking at this, _REG isn't really needed at all. The macros that rely on it can use io_p2v() directly._REG macro removed in platform.h. Other macros that use it now
use io_p2v directly
Grammar and typo fixesDEFINE_MUTEX used instead of init_mutex()
PLL397 and main osc clock rates hardcoded (0 rate not needed for a
disabled clock)
clock structure usecount type changes to u32
Added WARN_ON for clock disable when usecount <= 0 Clock functions pointers no longer have the address of(&) prefix
for function names, not needed
IRAM size computation algorithm changed
arch specific name changes on global platform structs specific to
the lpc32xx
LPC32xx gpiolib macro change for GPIO3 to hide pin gap details Made pll_postdivs static in clock.c. Moved support function
(clk_get_pllrate_from_reg) from common.c that used that function into clock.c. Prototype for support function left in common.h (used in timer.c).
Used ffs() instead of a case block for a support function in the
clock driver
Changed clock enable/disable logic to fix an issue with clock
usecount accumulators and disable logic on failure. Clocks are now enabled from the bottom up. This is ok on the 32xx and makes the logic much simpler.generic_handle_irq() used instead of handle_level_irq() for
chained handlers
SUBIRQs initially left masked, chained handler init enables them
nowsuspend_valid_only_mem used instead of local variant Small tweaks to suspend.S
icache invalidation added after SRAM copy and cache flush placed
in the correct place
Removed the ARCH specific register swap in include/amba/clcd.h
(compiles fine, but requires RK PL111 patch to work)
Montavista copyright and original GPLv2 licensing terms to pm.c
and suspend.S. INAL either, but if they get involved, it would be easier to completely rewrite them than try to sort out the aftermath.
Additional changes...
Added missing LPC32XX_CLKPWR_USBPDIV_PLL_MASK mask macros to USB
PCLK div computation (clock.c)
Unchanged from review comments...IO_ADDRESS macro name unchanged. Macro is used in an existing
driver (WDT) and provides support for assembly code that can't use the typecasts for sparse
I liked the idea of using functions for adding platform drivers
specific to different device variants, but didn't want to do this...yet. (It makes good sense though.)
PATCH 1/13 ARM: LPC32XX: Initial architecture header files
From: Kevin Wells <[email protected]>
Initial header files for the LPC32XX architecture
--- arch/arm/mach-lpc32xx/include/mach/clkdev.h | 25 + arch/arm/mach-lpc32xx/include/mach/gpio.h | 74 +++ arch/arm/mach-lpc32xx/include/mach/hardware.h | 34 ++ arch/arm/mach-lpc32xx/include/mach/i2c.h | 63 ++ arch/arm/mach-lpc32xx/include/mach/io.h | 27 + arch/arm/mach-lpc32xx/include/mach/irqs.h | 117 ++++ arch/arm/mach-lpc32xx/include/mach/memory.h | 27 + arch/arm/mach-lpc32xx/include/mach/platform.h | 694 +++++++++++++++++++++++ arch/arm/mach-lpc32xx/include/mach/system.h | 52 ++ arch/arm/mach-lpc32xx/include/mach/timex.h | 28 + arch/arm/mach-lpc32xx/include/mach/uncompress.h | 60 ++ arch/arm/mach-lpc32xx/include/mach/vmalloc.h | 24 + 12 files changed, 1225 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/include/mach/clkdev.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* arch/arm/mach-lpc32xx/include/mach/clkdev.h +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#ifndef __ASM_ARCH_CLKDEV_H +#define __ASM_ARCH_CLKDEV_H + +#define __clk_get (clk) ({ 1; }) +#define __clk_put (clk) do { } while (0) + +#endif
arch/arm/mach-lpc32xx/include/mach/gpio.h new file +74 -0
74 lines not on this page · raw message
arch/arm/mach-lpc32xx/include/mach/hardware.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* arch/arm/mach-lpc32xx/include/mach/hardware.h +* +* Copyright (c) 2005 MontaVista Software, Inc. <[email protected]> +* +* 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. +*/ + +#ifndef __ASM_ARCH_HARDWARE_H +#define __ASM_ARCH_HARDWARE_H + +/* +* Start of virtual addresses for IO devices +*/ +#define IO_BASE 0xF0000000 + +/* +* This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 +*/ +#define IO_ADDRESS (x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\ + IO_BASE) + +#define io_p2v (x) ((void __iomem *) (unsigned long) IO_ADDRESS(x)) +#define io_v2p (x) ((((x) & 0x0ff00000) << 4) | ((x) & 0x000fffff)) + +#endif
arch/arm/mach-lpc32xx/include/mach/i2c.h new file +63 -0
63 lines not on this page · raw message
arch/arm/mach-lpc32xx/include/mach/io.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* arch/arm/mach-lpc32xx/include/mach/io.h +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#define IO_SPACE_LIMIT 0xffffffff + +#define __io (a) __typesafe_io(a) +#define __mem_pci (a) (a) + +#endif
arch/arm/mach-lpc32xx/include/mach/irqs.h new file +117 -0
117 lines not on this page · raw message
arch/arm/mach-lpc32xx/include/mach/memory.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* arch/arm/mach-lpc32xx/include/mach/memory.h +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H + +/* +* Physical DRAM offset of bank 0 +*/ +#define PHYS_OFFSET UL(0x80000000) + +#endif
arch/arm/mach-lpc32xx/include/mach/platform.h new file +694 -0
694 lines not on this page · raw message
arch/arm/mach-lpc32xx/include/mach/system.h new file +52 -0
52 lines not on this page · raw message
arch/arm/mach-lpc32xx/include/mach/timex.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* arch/arm/mach-lpc32xx/include/mach/timex.h +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#ifndef __ASM_ARCH_TIMEX_H +#define __ASM_ARCH_TIMEX_H + +/* +* Rate in Hz of the main system oscillator. This value should match +* the value 'MAIN_OSC_FREQ' in platform.h +*/ +#define CLOCK_TICK_RATE 13000000 + +#endif
arch/arm/mach-lpc32xx/include/mach/uncompress.h new file +60 -0
60 lines not on this page · raw message
arch/arm/mach-lpc32xx/include/mach/vmalloc.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* arch/arm/mach-lpc32xx/include/mach/vmalloc.h +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#ifndef __ASM_ARCH_VMALLOC_H +#define __ASM_ARCH_VMALLOC_H + +#define VMALLOC_END 0xF0000000 + +#endif
Signature · 1 line
1.6.6
PATCH 1/13 ARM: LPC32XX: Initial architecture header files
Hey Kevin,
Quoted 4 lines
+/*
+ * Note!
+ * Muxed GP pins need to be setup to the GP state in the board level
+ * code prior to using this driver.
This is done by the imx machines, too, and I wonder if it's worth to try to get rid of that or at least let the gpio_direction_... functions fail if the pin isn't muxed as gpio. Thoughts?
I didn't check the alternative functionalities for the gpios on lpc32xx, but what happens if any gpio is requested and the direction configured? Does it interfer with system functions? (E.g. if a pin is used in a dedicated say i2c function, does it make the i2c driver non-functional if I do gpio_direction_output(i2cpin, 1)?)
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/13 ARM: LPC32XX: Initial architecture header files
2010/2/20 Uwe Kleine-K?nig <[email protected]>
Hey Kevin,
Quoted 10 lines
Quoted 5 lines
+/*
+ * Note!
+ * Muxed GP pins need to be setup to the GP state in the board level
+ * code prior to using this driver.This is done by the imx machines, too, and I wonder if it's worth to try to get rid of that or at least let the
gpio_direction_... functions fail if the pin isn't muxed as gpio. Thoughts?HI Uwe,
In the current function of the driver, the assumption is that if an out pin is used, it has already been muxed correctly, so requesting an output for a pin not muxed as a GPI/O will work fine and even setting it's pin level will work, but the level won't appear on the external pin. If something decides to switch the mux after that state is programmed, then the currently programmed output level will show up on that pin.
For state muxing, I would prefer to not have the GPIO driver change an existing mux state to make a GPIO work. I don't return an error now when a output state is used and is not muxed for an output state. But its painless to add this.
GPI pins and GPIO pins configured as inputs always work regardless of the muxed pin state and would never need to have a fail check, its basically a raw pin state read.
I didn't check the alternative functionalities for the gpios on lpc32xx,
Quoted 6 lines
but what happens if any gpio is requested and the direction configured? Does it interfer with system functions? (E.g. if a pin is used in a dedicated say i2c function, does it make the i2c driver non-functional if I do
gpio_direction_output(i2cpin, 1)?)
Setting a GPIO direction or output state will not effect a peripheral pin (on this part) when muxed for the peripheral. (ie, setting a GPIO to output and switching it to low when its shared with a UART pin and the mux is setup for UART).
thanks,
Kevin
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100220/24c3bd02/attachment-0001.htm>
PATCH 1/13 ARM: LPC32XX: Initial architecture header files
In reply to a message not in the archive2010/2/20 Uwe Kleine-K?nig <[email protected]>
Quoted 11 lines
Hey Kevin,
Quoted 4 lines
+/*
+ * Note!
+ * Muxed GP pins need to be setup to the GP state in the board level
+ * code prior to using this driver.This is done by the imx machines, too, and I wonder if it's worth to try to get rid of that or at least let the
gpio_direction_... functions fail if the pin isn't muxed as gpio. ?Thoughts?
HI Uwe,
In the current function of the driver, the assumption is that if an out pin is used, it has already been muxed correctly, so requesting an output for a pin not muxed as a GPI/O will work fine and even setting it's pin level will work, but the level won't appear on the external pin. If something decides to switch the mux after that state is programmed, then the currently programmed output level will show up on that pin.
For state muxing, I would prefer to not have the GPIO driver change an existing mux state to make a GPIO work. I don't return an error now when a output state is used and is not muxed for an output state. But its painless to add this.
GPI pins and GPIO pins configured as inputs always work regardless of the muxed pin state and would never need to have a fail check, its basically a raw pin state read.
Quoted 6 lines
I didn't check the alternative functionalities for the gpios on lpc32xx, but what happens if any gpio is requested and the direction configured? Does it interfer with system functions? ?(E.g. if a pin is used in a dedicated say i2c function, does it make the i2c driver non-functional if I do
gpio_direction_output(i2cpin, 1)?)
Setting a GPIO direction or output state will not effect a peripheral pin (on this part) when muxed for the peripheral. (ie, setting a GPIO to output and switching it to low when its shared with a UART pin and the mux is setup for UART).
thanks,
Kevin
Quoted 6 lines
Best regards
Uwe--
Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | Uwe Kleine-K?nig ? ? ? ? ? ?| Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
PATCH 1/13 ARM: LPC32XX: Initial architecture header files
Hi Uwe,
I'm going to add the pin mux check to a future patch release. It's a nice feature and may save some GPIO pin issues down the road, but respectfully, I want to focus on getting the release out without adding more changes & features at the moment. I'll add this capbility in with a new pinmux driver in the future.
thanks,
Kevin
Quoted 60 lines
2010/2/20 Uwe Kleine-K?nig <[email protected]>
Quoted 11 lines
Hey Kevin,
Quoted 4 lines
+/*
+ * Note!
+ * Muxed GP pins need to be setup to the GP state in the board level
+ * code prior to using this driver.This is done by the imx machines, too, and I wonder if it's worth to try to get rid of that or at least let the
gpio_direction_... functions fail if the pin isn't muxed as gpio. ?Thoughts?HI Uwe,
In the current function of the driver, the assumption is that if an out pin
is used, it has already been muxed correctly, so requesting an output for a pin not muxed as a GPI/O will work fine and even setting it's pin level will work, but the level won't appear on the external pin. If something decides to switch the mux after that state is programmed, then the currently programmed output level will show up on that pin.For state muxing, I would prefer to not have the GPIO driver change an existing mux state to make a GPIO work. I don't return an error now when a output state is used and is not muxed for an output state. But its painless to add this.
GPI pins and GPIO pins configured as inputs always work regardless of the muxed pin state and would never need to have a fail check, its basically a raw pin state read.
Quoted 6 lines
I didn't check the alternative functionalities for the gpios on lpc32xx, but what happens if any gpio is requested and the direction configured? Does it interfer with system functions? ?(E.g. if a pin is used in a dedicated say i2c function, does it make the i2c driver non-functional if I do
gpio_direction_output(i2cpin, 1)?)Setting a GPIO direction or output state will not effect a peripheral pin (on this part) when muxed for the peripheral. (ie, setting a GPIO to output
and switching it to low when its shared with a UART pin and the mux is setup for UART).thanks,
KevinQuoted 5 lines
Best regards
Uwe--
Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | Uwe Kleine-K?nig?|
Quoted 1 line
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/
?|
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/13 ARM: LPC32XX: Initial architecture header files
Hi Kevin,
Quoted 6 lines · Kevin Wells
I'm going to add the pin mux check to a future patch release. It's a nice feature and may save some GPIO pin issues down the road, but respectfully, I want to focus on getting the release out without adding more changes & features at the moment. I'll add this capbility in with a new pinmux driver in the future.
OK for me.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 2/13 ARM: LPC32XX: Debug and IRQ macros
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Debug (printascii) and IRQ handler macros for the LPC32XX architecture
--- arch/arm/mach-lpc32xx/include/mach/debug-macro.S | 54 ++++++++++++++++++++++ arch/arm/mach-lpc32xx/include/mach/entry-macro.S | 47 +++++++++++++++++++ 2 files changed, 101 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/include/mach/debug-macro.S new file +54 -0
@@ -0,0 +1,54 @@ +/* + * arch/arm/mach-lpc32xx/include/mach/debug-macro.S + * + * Author: Kevin Wells <[email protected]> + * + * Copyright (C) 2010 NXP Semiconductors + * + * 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. + */ + +#include <mach/hardware.h> +#include <mach/platform.h> + +#define LPC32XX_UART_DLL_FIFO_OFS 0x00 +#define LPC32XX_UART_LSR_OFS 0x14 + +#define LPC32XX_UART_DEBUG_BASE LPC32XX_UART5_BASE + +/* + * Debug output is hardcoded to standard UART 5 +*/ + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + ldreq \rx, =LPC32XX_UART_DEBUG_BASE @ physical + ldrne \rx, =IO_ADDRESS(LPCLPC32XX_UART_DEBUG_BASE) @ virtual + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #LPC32XX_UART_DLL_FIFO_OFS] + .endm + + .macro busyuart,rd,rx +1002: + ldr \rd, [\rx, #LPC32XX_UART_LSR_OFS] + tst \rd, #(1 << 6) + beq 1002b + .endm + + .macro waituart,rd,rx +1001: + ldr \rd, [\rx, #LPC32XX_UART_LSR_OFS] + tst \rd, #(1 << 5) + beq 1001b + .endm
arch/arm/mach-lpc32xx/include/mach/entry-macro.S new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
1.6.6
PATCH 3/13 ARM: LPC32XX: Clock driver
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Clock driver for the LPC32XX architecture
--- arch/arm/mach-lpc32xx/clock.c | 1086 +++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-lpc32xx/clock.h | 37 ++ 2 files changed, 1123 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/clock.c new file +1086 -0
@@ -0,0 +1,1086 @@ +/* +* arch/arm/mach-lpc32xx/clock.c +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +/* +* LPC32xx clock management driver overview +* +* The LPC32XX contains a number of high level system clocks that can be +* generated from different sources. These system clocks are used to +* generate the CPU and bus rates and the individual peripheral clocks in +* the system. When Linux is started by the boot loader, the system +* clocks are already running. Stopping a system clock during normal +* Linux operation should never be attempted, as peripherals that require +* those clocks will quit working (ie, DRAM). +* +* The LPC32xx high level clock tree looks as follows. Clocks marked with +* an asterisk are always on and cannot be disabled. Clocks marked with +* an ampersand can only be disabled in CPU suspend mode. Clocks marked +* with a caret are always on if it is the selected clock for the SYSCLK +* source. The clock that isn't used for SYSCLK can be enabled and +* disabled normally. +* 32KHz oscillator* +* / | \ +* RTC* PLL397^ TOUCH +* / +* Main oscillator^ / +* | \ / +* | SYSCLK& +* | \ +* | \ +* USB_PLL HCLK_PLL& +* | | | +* USB host/device PCLK& | +* | | +* Peripherals +* +* The CPU and chip bus rates are derived from the HCLK PLL, which can +* generate various clock rates up to 266MHz and beyond. The internal bus +* rates (PCLK and HCLK) are generated from dividers based on the HCLK +* PLL rate. HCLK can be a ratio of 1:1, 1:2, or 1:4 or HCLK PLL rate, +* while PCLK can be 1:1 to 1:32 of HCLK PLL rate. Most peripherals high +* level clocks are based on either HCLK or PCLK, but have their own +* dividers as part of the IP itself. Because of this, the system clock +* rates should not be changed. +* +* The HCLK PLL is clocked from SYSCLK, which can be derived from the +* main oscillator or PLL397. PLL397 generates a rate that is 397 times +* the 32KHz oscillator rate. The main oscillator runs at the selected +* oscillator/crystal rate on the mosc_in pin of the LPC32xx. This rate +* is normally 13MHz, but depends on the selection of external crystals +* or oscillators. If USB operation is required, the main oscillator must +* be used in the system. +* +* Switching SYSCLK between sources during normal Linux operation is not +* supported. SYSCLK is preset in the bootloader. Because of the +* complexities of clock management during clock frequency changes, +* there are some limitations to the clock driver explained below: +* - The PLL397 and main oscillator can be enabled and disabled by the +* clk_enable() and clk_disable() functions unless SYSCLK is based +* on that clock. This allows the other oscillator that isn't driving +* the HCLK PLL to be used as another system clock that can be routed +* to an external pin. +* - The muxed SYSCLK input and HCLK_PLL rate cannot be changed with +* this driver. +* - HCLK and PCLK rates cannot be changed as part of this driver. +* - Most peripherals have their own dividers are part of the peripheral +* block. Changing SYSCLK, HCLK PLL, HCLK, or PCLK sources or rates +* will also impact the individual peripheral rates. +*/ + +#include <linux/kernel.h> +#include <linux/list.h> +#include <linux/errno.h> +#include <linux/device.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/amba/bus.h> +#include <linux/amba/clcd.h> + +#include <mach/hardware.h> +#include <asm/clkdev.h> +#include <mach/clkdev.h> +#include <mach/platform.h> +#include "clock.h" +#include "common.h" + +static struct clk clk_armpll; +static struct clk clk_usbpll; +static DEFINE_MUTEX (clkm_lock); + +/* +* Post divider values for PLLs based on selected register value +*/ +static const u32 pll_postdivs[4 ] = {1 ,2 ,4 ,8 }; + +static u32 local_return_parent_rate (struct clk *clk) +{ +/* +* If a clock has a rate of 0, then it inherits it's parent +* clock rate +*/ +if (clk->rate ==0 ) +return local_return_parent_rate (clk->parent); + +return clk->rate; +} + +/* 32KHz clock has a fixed rate and is not stoppable */ +static struct clk osc_32KHz = { + .rate =LPC32XX_CLOCK_OSC_FREQ , + .get_rate = local_return_parent_rate, +}; + +static int local_pll397_enable (struct clk *clk,int enable) +{ +u32 reg; +unsigned long timeout =1 +msecs_to_jiffies (10 ); + + reg =__raw_readl (LPC32XX_CLKPWR_PLL397_CTRL ); + +if (enable ==0 ) { + reg |=LPC32XX_CLKPWR_SYSCTRL_PLL397_DIS ; +__raw_writel (reg,LPC32XX_CLKPWR_PLL397_CTRL ); + }else { +/* Enable PLL397 */ + reg &= ~LPC32XX_CLKPWR_SYSCTRL_PLL397_DIS ; +__raw_writel (reg,LPC32XX_CLKPWR_PLL397_CTRL ); + +/* Wait for PLL397 lock */ +while (((__raw_readl (LPC32XX_CLKPWR_PLL397_CTRL ) & +LPC32XX_CLKPWR_SYSCTRL_PLL397_STS ) ==0 ) && + (timeout > jiffies)) +cpu_relax (); + +if ((__raw_readl (LPC32XX_CLKPWR_PLL397_CTRL ) & +LPC32XX_CLKPWR_SYSCTRL_PLL397_STS ) ==0 ) +return -ENODEV ; + } + +return 0 ; +} + +static int local_oscmain_enable (struct clk *clk,int enable) +{ +u32 reg; +unsigned long timeout =1 +msecs_to_jiffies (10 ); + + reg =__raw_readl (LPC32XX_CLKPWR_MAIN_OSC_CTRL ); + +if (enable ==0 ) { + reg |=LPC32XX_CLKPWR_MOSC_DISABLE ; +__raw_writel (reg,LPC32XX_CLKPWR_MAIN_OSC_CTRL ); + }else { +/* Enable main oscillator */ + reg &= ~LPC32XX_CLKPWR_MOSC_DISABLE ; +__raw_writel (reg,LPC32XX_CLKPWR_MAIN_OSC_CTRL ); + +/* Wait for main oscillator to start */ +while (((__raw_readl (LPC32XX_CLKPWR_MAIN_OSC_CTRL ) & +LPC32XX_CLKPWR_MOSC_DISABLE ) !=0 ) && + (timeout > jiffies)) +cpu_relax (); + +if ((__raw_readl (LPC32XX_CLKPWR_MAIN_OSC_CTRL ) & +LPC32XX_CLKPWR_MOSC_DISABLE ) !=0 ) +return -ENODEV ; + } + +return 0 ; +} + +static struct clk osc_pll397 = { + .parent = &osc_32KHz, + .enable = local_pll397_enable, + .rate =LPC32XX_CLOCK_OSC_FREQ *397 , + .get_rate = local_return_parent_rate, +}; + +static struct clk osc_main = { + .enable = local_oscmain_enable, + .rate =LPC32XX_MAIN_OSC_FREQ , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_sys; + +/* +* Convert a PLL register value to a PLL output frequency +*/ +u32 clk_get_pllrate_from_reg (u32 inputclk,u32 regval) +{ +struct clk_pll_setup pllcfg; + + pllcfg.cco_bypass_b15 =0 ; + pllcfg.direct_output_b14 =0 ; + pllcfg.fdbk_div_ctrl_b13 =0 ; +if ((regval &LPC32XX_CLKPWR_HCLKPLL_CCO_BYPASS ) !=0 ) + pllcfg.cco_bypass_b15 =1 ; +if ((regval &LPC32XX_CLKPWR_HCLKPLL_POSTDIV_BYPASS ) !=0 ) + pllcfg.direct_output_b14 =1 ; +if ((regval &LPC32XX_CLKPWR_HCLKPLL_FDBK_SEL_FCLK ) !=0 ) + pllcfg.fdbk_div_ctrl_b13 =1 ; + pllcfg.pll_m =1 + ((regval >>1 ) &0xFF ); + pllcfg.pll_n =1 + ((regval >>9 ) &0x3 ); + pllcfg.pll_p = pll_postdivs[((regval >>11 ) &0x3 )]; + +return clk_check_pll_setup (inputclk, &pllcfg); +} + +/* +* Setup the HCLK PLL with a PLL structure +*/ +static u32 local_clk_pll_setup (struct clk_pll_setup *PllSetup) +{ +u32 tv, tmp =0 ; + +if (PllSetup->analog_on !=0 ) + tmp |=LPC32XX_CLKPWR_HCLKPLL_POWER_UP ; +if (PllSetup->cco_bypass_b15 !=0 ) + tmp |=LPC32XX_CLKPWR_HCLKPLL_CCO_BYPASS ; +if (PllSetup->direct_output_b14 !=0 ) + tmp |=LPC32XX_CLKPWR_HCLKPLL_POSTDIV_BYPASS ; +if (PllSetup->fdbk_div_ctrl_b13 !=0 ) + tmp |=LPC32XX_CLKPWR_HCLKPLL_FDBK_SEL_FCLK ; + + tv =ffs (PllSetup->pll_p) -1 ; +if ((!is_power_of_2 (PllSetup->pll_p)) || (tv >3 )) +return 0 ; + + tmp |=LPC32XX_CLKPWR_HCLKPLL_POSTDIV_2POW (tv); + tmp |=LPC32XX_CLKPWR_HCLKPLL_PREDIV_PLUS1 (PllSetup->pll_n -1 ); + tmp |=LPC32XX_CLKPWR_HCLKPLL_PLLM (PllSetup->pll_m -1 ); + +return tmp; +} + +/* +* Update the ARM core PLL frequency rate variable from the actual PLL setting +*/ +static void local_update_armpll_rate (void ) +{ +u32 clkin, pllreg; + + clkin = clk_armpll.parent->rate; + pllreg =__raw_readl (LPC32XX_CLKPWR_HCLKPLL_CTRL ) &0x1FFFF ; + + clk_armpll.rate =clk_get_pllrate_from_reg (clkin, pllreg); +} + +/* +* Find a PLL configuration for the selected input frequency +*/ +static u32 local_clk_find_pll_cfg (u32 pllin_freq,u32 target_freq, +struct clk_pll_setup *pllsetup) +{ +u32 ifreq, freqtol, m, n, p, fclkout; + +/* Determine frequency tolerance limits */ + freqtol = target_freq /250 ; + ifreq = pllin_freq; + +/* Is direct bypass mode possible? */ +if (abs (pllin_freq - target_freq) <= freqtol) { + pllsetup->analog_on =0 ; + pllsetup->cco_bypass_b15 =1 ; + pllsetup->direct_output_b14 =1 ; + pllsetup->fdbk_div_ctrl_b13 =1 ; + pllsetup->pll_p = pll_postdivs[0 ]; + pllsetup->pll_n =1 ; + pllsetup->pll_m =1 ; +return clk_check_pll_setup (ifreq, pllsetup); + }else if (target_freq <= ifreq) { + pllsetup->analog_on =0 ; + pllsetup->cco_bypass_b15 =1 ; + pllsetup->direct_output_b14 =0 ; + pllsetup->fdbk_div_ctrl_b13 =1 ; + pllsetup->pll_n =1 ; + pllsetup->pll_m =1 ; +for (p =0 ; p <=3 ; p++) { + pllsetup->pll_p = pll_postdivs[p]; + fclkout =clk_check_pll_setup (ifreq, pllsetup); +if (abs (target_freq - fclkout) <= freqtol) +return fclkout; + } + } + +/* Is direct mode possible? */ + pllsetup->analog_on =1 ; + pllsetup->cco_bypass_b15 =0 ; + pllsetup->direct_output_b14 =1 ; + pllsetup->fdbk_div_ctrl_b13 =0 ; + pllsetup->pll_p = pll_postdivs[0 ]; +for (m =1 ; m <=256 ; m++) { +for (n =1 ; n <=4 ; n++) { +/* Compute output frequency for this value */ + pllsetup->pll_n = n; + pllsetup->pll_m = m; + fclkout =clk_check_pll_setup (ifreq, + pllsetup); +if (abs (target_freq - fclkout) <= + freqtol) +return fclkout; + } + } + +/* Is integer mode possible? */ + pllsetup->analog_on =1 ; + pllsetup->cco_bypass_b15 =0 ; + pllsetup->direct_output_b14 =0 ; + pllsetup->fdbk_div_ctrl_b13 =1 ; +for (m =1 ; m <=256 ; m++) { +for (n =1 ; n <=4 ; n++) { +for (p =0 ; p <4 ; p++) { +/* Compute output frequency */ + pllsetup->pll_p = pll_postdivs[p]; + pllsetup->pll_n = n; + pllsetup->pll_m = m; + fclkout =clk_check_pll_setup ( + ifreq, pllsetup); +if (abs (target_freq - fclkout) <= freqtol) +return fclkout; + } + } + } + +/* Try non-integer mode */ + pllsetup->analog_on =1 ; + pllsetup->cco_bypass_b15 =0 ; + pllsetup->direct_output_b14 =0 ; + pllsetup->fdbk_div_ctrl_b13 =0 ; +for (m =1 ; m <=256 ; m++) { +for (n =1 ; n <=4 ; n++) { +for (p =0 ; p <4 ; p++) { +/* Compute output frequency */ + pllsetup->pll_p = pll_postdivs[p]; + pllsetup->pll_n = n; + pllsetup->pll_m = m; + fclkout =clk_check_pll_setup ( + ifreq, pllsetup); +if (abs (target_freq - fclkout) <= freqtol) +return fclkout; + } + } + } + +return 0 ; +} + +static struct clk clk_armpll = { + .parent = &clk_sys, + .get_rate = local_return_parent_rate, +}; + +/* +* Update the USB PLL frequency rate variable from the actual PLL setting +*/ +static void local_update_usbpll_rate (void ) +{ +u32 clkin, pllreg; + + clkin = clk_usbpll.get_rate (&clk_usbpll); + pllreg =__raw_readl (LPC32XX_CLKPWR_USB_CTRL ) &0x1FFFF ; + +if ((pllreg &LPC32XX_CLKPWR_USBCTRL_PLL_PWRUP ) ==0 ) + clk_usbpll.rate =0 ; +else + clk_usbpll.rate =clk_get_pllrate_from_reg (clkin, + pllreg); +} + +/* +* Setup the USB PLL with a PLL structure +*/ +static u32 local_clk_usbpll_setup (struct clk_pll_setup *pHCLKPllSetup) +{ +u32 reg, tmp =local_clk_pll_setup (pHCLKPllSetup); + + reg =__raw_readl (LPC32XX_CLKPWR_USB_CTRL ) & ~0x1FFFF ; + reg |= tmp; +__raw_writel (reg,LPC32XX_CLKPWR_USB_CTRL ); + +return clk_check_pll_setup (clk_usbpll.parent->rate, + pHCLKPllSetup); +} + +static int local_usbpll_enable (struct clk *clk,int enable) +{ +u32 reg; +int ret = -ENODEV ; +unsigned long timeout =1 +msecs_to_jiffies (10 ); + + reg =__raw_readl (LPC32XX_CLKPWR_USB_CTRL ); + +if (enable ==0 ) { + reg &= ~(LPC32XX_CLKPWR_USBCTRL_CLK_EN1 | +LPC32XX_CLKPWR_USBCTRL_CLK_EN2 ); +__raw_writel (reg,LPC32XX_CLKPWR_USB_CTRL ); + }else if (reg &LPC32XX_CLKPWR_USBCTRL_PLL_PWRUP ) { + reg |=LPC32XX_CLKPWR_USBCTRL_CLK_EN1 ; +__raw_writel (reg,LPC32XX_CLKPWR_USB_CTRL ); + +/* Wait for PLL lock */ +while ((timeout > jiffies) & (ret == -ENODEV )) { + reg =__raw_readl (LPC32XX_CLKPWR_USB_CTRL ); +if (reg &LPC32XX_CLKPWR_USBCTRL_PLL_STS ) + ret =0 ; + } + +if (ret ==0 ) { + reg |=LPC32XX_CLKPWR_USBCTRL_CLK_EN2 ; +__raw_writel (reg,LPC32XX_CLKPWR_USB_CTRL ); + } + } + +return ret; +} + +static int local_usbpll_set_rate (struct clk *clk,u32 rate) +{ +u32 clkin, reg, usbdiv; +struct clk_pll_setup pllsetup; + +/* +* Unlike other clocks, this clock has a KHz input rate, so bump +* it up to work with the PLL function +*/ + rate = rate *1000 ; + +local_usbpll_enable (clk,0 ); + +if (rate ==0 ) +return 0 ; + + clkin = clk->parent->rate; + usbdiv = (__raw_readl (LPC32XX_CLKPWR_USBCLK_PDIV ) & +LPC32XX_CLKPWR_USBPDIV_PLL_MASK ) +1 ; + clkin = clkin / usbdiv; + +/* Try to find a good rate setup */ +if (local_clk_find_pll_cfg (clkin, rate, &pllsetup) ==0 ) +return -EINVAL ; + + reg =__raw_readl (LPC32XX_CLKPWR_USB_CTRL ); + reg |=LPC32XX_CLKPWR_USBCTRL_CLK_EN1 ; +__raw_writel (reg,LPC32XX_CLKPWR_USB_CTRL ); + + pllsetup.analog_on =1 ; +local_clk_usbpll_setup (&pllsetup); + + clk->rate =clk_check_pll_setup (clkin, &pllsetup); + + reg =__raw_readl (LPC32XX_CLKPWR_USB_CTRL ); + reg |=LPC32XX_CLKPWR_USBCTRL_CLK_EN2 ; +__raw_writel (reg,LPC32XX_CLKPWR_USB_CTRL ); + +return 0 ; +} + +static struct clk clk_usbpll = { + .parent = &osc_main, + .set_rate = local_usbpll_set_rate, + .enable = local_usbpll_enable, + .get_rate = local_return_parent_rate, +}; + +static u32 clk_get_hclk_div (void ) +{ +static const u32 hclkdivs[4 ] = {1 ,2 ,4 ,4 }; +return hclkdivs[LPC32XX_CLKPWR_HCLKDIV_DIV_2POW ( +__raw_readl (LPC32XX_CLKPWR_HCLK_DIV ))]; +} + +static struct clk clk_hclk = { + .parent = &clk_armpll, + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_pclk = { + .parent = &clk_armpll, + .get_rate = local_return_parent_rate, +}; + +static int local_onoff_enable (struct clk *clk,int enable) +{ +u32 tmp; + + tmp =__raw_readl (clk->enable_reg); + +if (enable ==0 ) + tmp &= ~clk->enable_mask; +else + tmp |= clk->enable_mask; + +__raw_writel (tmp, clk->enable_reg); + +return 0 ; +} + +/* Peripheral clock sources */ +static struct clk clk_timer0 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_TIMERS_PWMS_CLK_CTRL_1 , + .enable_mask =LPC32XX_CLKPWR_TMRPWMCLK_TIMER0_EN , + .get_rate = local_return_parent_rate, +}; +static struct clk clk_timer1 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_TIMERS_PWMS_CLK_CTRL_1 , + .enable_mask =LPC32XX_CLKPWR_TMRPWMCLK_TIMER1_EN , + .get_rate = local_return_parent_rate, +}; +static struct clk clk_timer2 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_TIMERS_PWMS_CLK_CTRL_1 , + .enable_mask =LPC32XX_CLKPWR_TMRPWMCLK_TIMER2_EN , + .get_rate = local_return_parent_rate, +}; +static struct clk clk_timer3 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_TIMERS_PWMS_CLK_CTRL_1 , + .enable_mask =LPC32XX_CLKPWR_TMRPWMCLK_TIMER3_EN , + .get_rate = local_return_parent_rate, +}; +static struct clk clk_wdt = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_TIMER_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_PWMCLK_WDOG_EN , + .get_rate = local_return_parent_rate, +}; +static struct clk clk_vfp9 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_DEBUG_CTRL , + .enable_mask =LPC32XX_CLKPWR_VFP_CLOCK_ENABLE_BIT , + .get_rate = local_return_parent_rate, +}; +static struct clk clk_dma = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_DMA_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_DMACLKCTRL_CLK_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_uart3 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_UART_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_UARTCLKCTRL_UART3_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_uart4 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_UART_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_UARTCLKCTRL_UART4_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_uart5 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_UART_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_UARTCLKCTRL_UART5_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_uart6 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_UART_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_UARTCLKCTRL_UART6_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_i2c0 = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_I2C_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_I2CCLK_I2C1CLK_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_i2c1 = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_I2C_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_I2CCLK_I2C2CLK_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_i2c2 = { + .parent = &clk_pclk, + .enable = local_onoff_enable, + .enable_reg =io_p2v (LPC32XX_USB_BASE +0xFF4 ), + .enable_mask =0x4 , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_ssp0 = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_SSP_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_SSPCTRL_SSPCLK0_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_ssp1 = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_SSP_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_SSPCTRL_SSPCLK1_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_kscan = { + .parent = &osc_32KHz, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_KEY_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_KEYCLKCTRL_CLK_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_nand = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_NAND_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_NANDCLK_SLCCLK_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_i2s0 = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_I2S_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_I2SCTRL_I2SCLK0_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_i2s1 = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_I2S_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_I2SCTRL_I2SCLK1_EN , + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_net = { + .parent = &clk_hclk, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_MACCLK_CTRL , + .enable_mask = (LPC32XX_CLKPWR_MACCTRL_DMACLK_EN | +LPC32XX_CLKPWR_MACCTRL_MMIOCLK_EN | +LPC32XX_CLKPWR_MACCTRL_HRCCLK_EN ), + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_rtc = { + .parent = &osc_32KHz, + .rate =1 ,/* 1 Hz */ + .get_rate = local_return_parent_rate, +}; + +static struct clk clk_usbd = { + .parent = &clk_usbpll, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_USB_CTRL , + .enable_mask =LPC32XX_CLKPWR_USBCTRL_HCLK_EN , + .get_rate = local_return_parent_rate, +}; + +static int tsc_onoff_enable (struct clk *clk,int enable) +{ +u32 tmp; + +/* Make sure 32KHz clock is the selected clock */ + tmp =__raw_readl (LPC32XX_CLKPWR_ADC_CLK_CTRL_1 ); + tmp &= ~LPC32XX_CLKPWR_ADCCTRL1_PCLK_SEL ; +__raw_writel (tmp,LPC32XX_CLKPWR_ADC_CLK_CTRL_1 ); + +if (enable ==0 ) +__raw_writel (0 , clk->enable_reg); +else +__raw_writel (clk->enable_mask, clk->enable_reg); + +return 0 ; +} + +static struct clk clk_tsc = { + .parent = &osc_32KHz, + .enable = tsc_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_ADC_CLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_ADC32CLKCTRL_CLK_EN , + .get_rate = local_return_parent_rate, +}; + +static int mmc_onoff_enable (struct clk *clk,int enable) +{ +u32 tmp; + + tmp =__raw_readl (LPC32XX_CLKPWR_MS_CTRL ) & + ~(LPC32XX_CLKPWR_MSCARD_SDCARD_EN | +LPC32XX_CLKPWR_MSCARD_SDCARD_DIV (15 )); + +/* If rate is 0, disable clock */ +if (enable !=0 ) + tmp |=LPC32XX_CLKPWR_MSCARD_SDCARD_EN | +LPC32XX_CLKPWR_MSCARD_SDCARD_DIV (1 ); + +__raw_writel (tmp,LPC32XX_CLKPWR_MS_CTRL ); + +return 0 ; +} + +static u32 mmc_get_rate (struct clk *clk) +{ +u32 div, tmp, rate; + + div =__raw_readl (LPC32XX_CLKPWR_MS_CTRL ); + tmp = div &LPC32XX_CLKPWR_MSCARD_SDCARD_EN ; + +if (!tmp) +return 0 ; + +/* Get the parent clock rate */ + rate = clk->parent->get_rate (clk->parent); + +/* Get the LCD controller clock divider value */ + div = div &0xF ; + +if (!div) +return 0 ; + + tmp = rate / div; + +return tmp; +} + +static int mmc_set_rate (struct clk *clk,u32 rate) +{ +if (rate ==0 ) +mmc_onoff_enable (clk,0 ); +else +mmc_onoff_enable (clk,1 ); + +return 0 ; +} + +static struct clk clk_mmc = { + .parent = &clk_armpll, + .set_rate = mmc_set_rate, + .get_rate = mmc_get_rate, + .enable = mmc_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_MS_CTRL , + .enable_mask =LPC32XX_CLKPWR_MSCARD_SDCARD_EN , +}; + +static u32 clcd_get_rate (struct clk *clk) +{ +u32 tmp, div, rate; + + tmp =__raw_readl (LPC32XX_CLKPWR_LCDCLK_CTRL ) & +LPC32XX_CLKPWR_LCDCTRL_CLK_EN ; + +if (!tmp) +return 0 ; + + rate = clk->parent->get_rate (clk->parent); + tmp =__raw_readl (io_p2v (LPC32XX_LCD_BASE +CLCD_TIM2 )); + +/* Only supports internal clocking */ +if (tmp &TIM2_BCD ) +return rate; + + div = (tmp &0x1F ) | ((tmp &0xF8 ) >>22 ); + tmp = rate / (2 + div); + +return tmp; +} + +static int clcd_set_rate (struct clk *clk,u32 rate) +{ +u32 tmp, prate, div; + + tmp =__raw_readl (io_p2v (LPC32XX_LCD_BASE +CLCD_TIM2 )); + prate = clk->parent->get_rate (clk->parent); + +if (rate == prate) { + tmp |=TIM2_BCD ; +local_onoff_enable (clk,1 ); + }else { +/* Find closest divider */ + div = prate / rate; +if (div ==1 ) + div =0 ; +else + div -=2 ; + + tmp &= ~(0xF800001F ); + tmp &= ~TIM2_BCD ; + tmp |= (div &0x1F ); + tmp |= (((div >>5 ) &0x1F ) <<27 ); +__raw_writel (tmp,io_p2v (LPC32XX_LCD_BASE +CLCD_TIM2 )); +local_onoff_enable (clk,1 ); + } + +return 0 ; +} + +static struct clk clk_lcd = { + .parent = &clk_hclk, + .set_rate = clcd_set_rate, + .get_rate = clcd_get_rate, + .enable = local_onoff_enable, + .enable_reg =LPC32XX_CLKPWR_LCDCLK_CTRL , + .enable_mask =LPC32XX_CLKPWR_LCDCTRL_CLK_EN , +}; + +static inline void clk_lock (void ) +{ +mutex_lock (&clkm_lock); +} + +static inline void clk_unlock (void ) +{ +mutex_unlock (&clkm_lock); +} + +static void local_clk_disable (struct clk *clk) +{ +WARN_ON (clk->usecount ==0 ); + +/* Don't attempt to disable clock if it has no users */ +if (clk->usecount >0 ) { + clk->usecount--; + +/* Only disable clock when it has no more users */ +if ((clk->usecount ==0 ) && (clk->enable)) + clk->enable (clk,0 ); + +/* Check parent clocks, they may need to be disabled too */ +if (clk->parent) +local_clk_disable (clk->parent); + } +} + +static int local_clk_enable (struct clk *clk) +{ +int ret =0 ; + +/* Only enable clock if it's currently disabled */ +if (clk->usecount ==0 ) { +if (clk->enable) + ret = clk->enable (clk,1 ); + } + +/* Enable parent clock and update counts */ +if (!ret) { + clk->usecount++; + +if (clk->parent) { + ret =local_clk_enable (clk->parent); + +if (ret) { + clk->usecount--; +if ((!clk->usecount) && (clk->enable)) + clk->enable (clk,0 ); + } + } + } + +return ret; +} + +/* +* clk_enable - inform the system when the clock source should be running. +*/ +int clk_enable (struct clk *clk) +{ +int ret; + +clk_lock (); + ret =local_clk_enable (clk); +clk_unlock (); + +return ret; +} +EXPORT_SYMBOL (clk_enable); + +/* +* clk_disable - inform the system when the clock source is no longer required +*/ +void clk_disable (struct clk *clk) +{ +clk_lock (); +local_clk_disable (clk); +clk_unlock (); +} +EXPORT_SYMBOL (clk_disable); + +/* +* clk_get_rate - obtain the current clock rate (in Hz) for a clock source +*/ +unsigned long clk_get_rate (struct clk *clk) +{ +unsigned long rate; + +clk_lock (); + rate = (clk->get_rate)(clk); +clk_unlock (); + +return rate; +} +EXPORT_SYMBOL (clk_get_rate); + +/* +* clk_set_rate - set the clock rate for a clock source +*/ +int clk_set_rate (struct clk *clk,unsigned long rate) +{ +int ret = -EINVAL ; + +/* +* Most system clocks can only be enabled or disabled, with +* the actual rate set as part of the peripheral dividers +* instead of high level clock control +*/ +if (clk->set_rate) { +clk_lock (); + ret = (clk->set_rate)(clk, rate); +clk_unlock (); + } + +return ret; +} +EXPORT_SYMBOL (clk_set_rate); + +/* +* clk_round_rate - adjust a rate to the exact rate a clock can provide +*/ +long clk_round_rate (struct clk *clk,unsigned long rate) +{ +int ret; + +/* Use set_rate to try to adjust the rate if it supports it */ + ret =clk_set_rate (clk, rate); +if (ret <0 ) +return ret; + +return clk->rate; +} +EXPORT_SYMBOL (clk_round_rate); + +/* +* clk_set_parent - set the parent clock source for this clock +*/ +int clk_set_parent (struct clk *clk,struct clk *parent) +{ +/* Clock re-parenting is not supported */ +return -EINVAL ; +} +EXPORT_SYMBOL (clk_set_parent); + +/* +* clk_get_parent - get the parent clock source for this clock +*/ +struct clk *clk_get_parent (struct clk *clk) +{ +return clk->parent; +} +EXPORT_SYMBOL (clk_get_parent); + +#define _REGISTER_CLOCK (d, n, c) \ + { \ + .dev_id = (d), \ + .con_id = (n), \ + .clk = &(c), \ + }, + +static struct clk_lookup lookups[] = { + _REGISTER_CLOCK(NULL, "osc_32KHz", osc_32KHz) + _REGISTER_CLOCK(NULL, "osc_pll397", osc_pll397) + _REGISTER_CLOCK(NULL, "osc_main", osc_main) + _REGISTER_CLOCK(NULL, "sys_ck", clk_sys) + _REGISTER_CLOCK(NULL, "arm_pll_ck", clk_armpll) + _REGISTER_CLOCK(NULL, "ck_pll5", clk_usbpll) + _REGISTER_CLOCK(NULL, "hclk_ck", clk_hclk) + _REGISTER_CLOCK(NULL, "pclk_ck", clk_pclk) + _REGISTER_CLOCK(NULL, "timer0_ck", clk_timer0) + _REGISTER_CLOCK(NULL, "timer1_ck", clk_timer1) + _REGISTER_CLOCK(NULL, "timer2_ck", clk_timer2) + _REGISTER_CLOCK(NULL, "timer3_ck", clk_timer3) + _REGISTER_CLOCK(NULL, "vfp9_ck", clk_vfp9) + _REGISTER_CLOCK(NULL, "clk_dmac", clk_dma) + _REGISTER_CLOCK("pnx4008-watchdog", NULL, clk_wdt) + _REGISTER_CLOCK(NULL, "uart3_ck", clk_uart3) + _REGISTER_CLOCK(NULL, "uart4_ck", clk_uart4) + _REGISTER_CLOCK(NULL, "uart5_ck", clk_uart5) + _REGISTER_CLOCK(NULL, "uart6_ck", clk_uart6) + _REGISTER_CLOCK("pnx-i2c.0", NULL, clk_i2c0) + _REGISTER_CLOCK("pnx-i2c.1", NULL, clk_i2c1) + _REGISTER_CLOCK("pnx-i2c.2", NULL, clk_i2c2) + _REGISTER_CLOCK("dev:ssp0", NULL, clk_ssp0) + _REGISTER_CLOCK("dev:ssp1", NULL, clk_ssp1) + _REGISTER_CLOCK("lpc32xx_keys.0", NULL, clk_kscan) + _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand) + _REGISTER_CLOCK("tbd", "i2s0_ck", clk_i2s0) + _REGISTER_CLOCK("tbd", "i2s1_ck", clk_i2s1) + _REGISTER_CLOCK("lpc32xx-ts", NULL, clk_tsc) + _REGISTER_CLOCK("dev:mmc0", "MCLK", clk_mmc) + _REGISTER_CLOCK("lpc-net.0", NULL, clk_net) + _REGISTER_CLOCK("dev:clcd", NULL, clk_lcd) + _REGISTER_CLOCK("lpc32xx_udc", "ck_usbd", clk_usbd) +_REGISTER_CLOCK ("lpc32xx_rtc" ,NULL , clk_rtc) +}; + +static int __init clk_init (void ) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (lookups); i++) +clkdev_add (&lookups[i]); + +/* +* Setup muxed SYSCLK for HCLK PLL base -this selects the +* parent clock used for the ARM PLL and is used to derive +* the many system clock rates in the device. +*/ +if (clk_is_sysclk_mainosc () !=0 ) + clk_sys.parent = &osc_main; +else + clk_sys.parent = &osc_pll397; + + clk_sys.rate = clk_sys.parent->rate; + +/* Compute the current ARM PLL and USB PLL frequencies */ +local_update_armpll_rate (); +local_update_usbpll_rate (); + +/* Compute HCLK and PCLK bus rates */ + clk_hclk.rate = clk_hclk.parent->rate /clk_get_hclk_div (); + clk_pclk.rate = clk_pclk.parent->rate /clk_get_pclk_div (); + +/* +* Enable system clocks - this step is somewhat formal, as the +* clocks are already running, but it does get the clock data +* inline with the actual system state. Never disable these +* clocks as they will only stop if the system is going to sleep. +* In that case, the chip/system power management functions will +* handle clock gating. +*/ +clk_enable (&clk_hclk); +clk_enable (&clk_pclk); + +/* +* Timers 0 and 1 were enabled and are being used by the high +* resolution tick function prior to this driver being initialized. +* Tag them now as used. +*/ +clk_enable (&clk_timer0); +clk_enable (&clk_timer1); + +return 0 ; +} +core_initcall (clk_init); +
arch/arm/mach-lpc32xx/clock.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* arch/arm/mach-lpc32xx/clock.h +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#ifndef __LPC32XX_CLOCK_H +#define __LPC32XX_CLOCK_H + +struct clk { +struct list_head node; +struct clk *parent; +u32 rate; +u32 usecount; + +int (*set_rate) (struct clk *,u32 ); +int (*enable) (struct clk *clk,int ); +u32 (*get_rate) (struct clk *clk); + +/* Register address and bit mask for simple clocks */ +void __iomem *enable_reg; +u32 enable_mask; +}; + +#endif
Signature · 1 line
1.6.6
PATCH 3/13 ARM: LPC32XX: Clock driver
arch/arm/mach-lpc32xx/clock.c line 117
Quoted 8 lines · On Fri, Feb 19, 2010 at 03:25:59PM -0800, wellsk40 at gmail.com wrote:
arch/arm/mach-lpc32xx/clock.c new file +8
-0+static u32 local_return_parent_rate (struct clk *clk) +{ +/* +* If a clock has a rate of 0, then it inherits it's parent +* clock rate +*/ +if (clk->rate ==0 ) +return local_return_parent_rate (clk->parent);
Does this really need to be recursive?
while (clk->rate == 0) clk = clk->parent; return clk->rate;
?
arch/arm/mach-lpc32xx/clock.c line 743
Quoted 9 lines
arch/arm/mach-lpc32xx/clock.c new file +9
-0+static u32 mmc_get_rate (struct clk *clk) +{ +u32 div, tmp, rate; + + div =__raw_readl (LPC32XX_CLKPWR_MS_CTRL ); + tmp = div &LPC32XX_CLKPWR_MSCARD_SDCARD_EN ; + +if (!tmp) +return 0 ;
There's no requirement to return a rate of zero if the clock is not enabled. In fact, it's something that should be avoided because it prevents querying the rate you'll get before enabling the clock (which might affect whether you decide to enable it.)
Quoted 5 lines
arch/arm/mach-lpc32xx/clock.c new file +5
-0+static void local_clk_disable (struct clk *clk) +{ +WARN_ON (clk->usecount ==0 ); + +/* Don't attempt to disable clock if it has no users */
arch/arm/mach-lpc32xx/clock.c line 863
Quoted 10 lines
arch/arm/mach-lpc32xx/clock.c new file +10
-0+if (clk->usecount >0 ) { + clk->usecount--; + +/* Only disable clock when it has no more users */ +if ((clk->usecount ==0 ) && (clk->enable)) + clk->enable (clk,0 ); + +/* Check parent clocks, they may need to be disabled too */ +if (clk->parent) +local_clk_disable (clk->parent);
This is not a good idea if you ever support clock reparenting - it's much better to have the parent enabled when the usecount changes from 0 to 1, and disabled when you move from 1 to 0 - otherwise you'll have to call local_clk_disable() and local_clk_enable() multiple times when you reparent.
arch/arm/mach-lpc32xx/clock.c line 929
Quoted 6 lines
arch/arm/mach-lpc32xx/clock.c new file +6
-0+unsigned long clk_get_rate (struct clk *clk) +{ +unsigned long rate; + +clk_lock (); + rate = (clk->get_rate)(clk);
parens aren't required.
arch/arm/mach-lpc32xx/clock.c line 950
Quoted 3 lines
arch/arm/mach-lpc32xx/clock.c new file +3
-0+if (clk->set_rate) { +clk_lock (); + ret = (clk->set_rate)(clk, rate);
Ditto.
arch/arm/mach-lpc32xx/clock.c line 966
Quoted 9 lines
arch/arm/mach-lpc32xx/clock.c new file +9
-0+/* +* clk_round_rate - adjust a rate to the exact rate a clock can provide +*/ +long clk_round_rate (struct clk *clk,unsigned long rate) +{ +int ret; + +/* Use set_rate to try to adjust the rate if it supports it */ + ret =clk_set_rate (clk, rate);
This is definitely wrong. round_rate() is supposed to return the rate which the clock will give you for the rate you're asking for _without_ setting it.
PATCH 3/13 ARM: LPC32XX: Clock driver
Hi Russell,
Thanks much for your response on this.
Does it make sense to repost the complete patchset or just the diffs of the changed files? (clock.h and clock.c).
Quoted 8 lines
There's no requirement to return a rate of zero if the clock is not enabled.
In fact, it's something that should be avoided because it prevents querying
the rate you'll get before enabling the clock (which might affect whether you decide to enable it.)
Alright, this reduces some checks. I've also made changes to set_rate functions to allow clock rate changes without the clock being enabled or changing the current clock enable state.
thanks,
Kevin
PATCH 4/13 ARM: LPC32XX: GPIO, timer, and IRQ drivers
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Common drivers for the LPC32XX used on all platforms
--- arch/arm/mach-lpc32xx/gpiolib.c | 446 +++++++++++++++++++++++++++++++++++++++ arch/arm/mach-lpc32xx/irq.c | 434 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-lpc32xx/timer.c | 182 ++++++++++++++++ 3 files changed, 1062 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/gpiolib.c new file +446 -0
@@ -0,0 +1,446 @@ +/* +* arch/arm/mach-lpc32xx/gpiolib.c +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/io.h> +#include <linux/errno.h> +#include <linux/gpio.h> + +#include <mach/hardware.h> +#include <mach/platform.h> +#include "common.h" + +#define LPC32XX_GPIO_P3_INP_STATE _GPREG(0x000) +#define LPC32XX_GPIO_P3_OUTP_SET _GPREG(0x004) +#define LPC32XX_GPIO_P3_OUTP_CLR _GPREG(0x008) +#define LPC32XX_GPIO_P3_OUTP_STATE _GPREG(0x00C) +#define LPC32XX_GPIO_P2_DIR_SET _GPREG(0x010) +#define LPC32XX_GPIO_P2_DIR_CLR _GPREG(0x014) +#define LPC32XX_GPIO_P2_DIR_STATE _GPREG(0x018) +#define LPC32XX_GPIO_P2_INP_STATE _GPREG(0x01C) +#define LPC32XX_GPIO_P2_OUTP_SET _GPREG(0x020) +#define LPC32XX_GPIO_P2_OUTP_CLR _GPREG(0x024) +#define LPC32XX_GPIO_P2_MUX_SET _GPREG(0x028) +#define LPC32XX_GPIO_P2_MUX_CLR _GPREG(0x02C) +#define LPC32XX_GPIO_P2_MUX_STATE _GPREG(0x030) +#define LPC32XX_GPIO_P0_INP_STATE _GPREG(0x040) +#define LPC32XX_GPIO_P0_OUTP_SET _GPREG(0x044) +#define LPC32XX_GPIO_P0_OUTP_CLR _GPREG(0x048) +#define LPC32XX_GPIO_P0_OUTP_STATE _GPREG(0x04C) +#define LPC32XX_GPIO_P0_DIR_SET _GPREG(0x050) +#define LPC32XX_GPIO_P0_DIR_CLR _GPREG(0x054) +#define LPC32XX_GPIO_P0_DIR_STATE _GPREG(0x058) +#define LPC32XX_GPIO_P1_INP_STATE _GPREG(0x060) +#define LPC32XX_GPIO_P1_OUTP_SET _GPREG(0x064) +#define LPC32XX_GPIO_P1_OUTP_CLR _GPREG(0x068) +#define LPC32XX_GPIO_P1_OUTP_STATE _GPREG(0x06C) +#define LPC32XX_GPIO_P1_DIR_SET _GPREG(0x070) +#define LPC32XX_GPIO_P1_DIR_CLR _GPREG(0x074) +#define LPC32XX_GPIO_P1_DIR_STATE _GPREG(0x078) + +#define GPIO012_PIN_TO_BIT (x) (1 << (x)) +#define GPIO3_PIN_TO_BIT (x) (1 << ((x) + 25)) +#define GPO3_PIN_TO_BIT (x) (1 << (x)) +#define GPIO012_PIN_IN_SEL (x, y) (((x) >> (y)) & 1) +#define GPIO3_PIN_IN_SHIFT (x) ((x) == 5 ? 24 : 10 + (x)) +#define GPIO3_PIN_IN_SEL (x, y) ((x) >> GPIO3_PIN_IN_SHIFT(y)) +#define GPIO3_PIN5_IN_SEL (x) (((x) >> 24) & 1) +#define GPI3_PIN_IN_SEL (x, y) (((x) >> (y)) & 1) + +struct gpio_regs { +void __iomem *inp_state; +void __iomem *outp_set; +void __iomem *outp_clr; +void __iomem *dir_set; +void __iomem *dir_clr; +}; + +/* +* GPIO names +*/ +static const char *gpio_p0_names[LPC32XX_GPIO_P0_MAX ] = { +"p0.0" ,"p0.1" ,"p0.2" ,"p0.3" , +"p0.4" ,"p0.5" ,"p0.6" ,"p0.7" +}; + +static const char *gpio_p1_names[LPC32XX_GPIO_P1_MAX ] = { +"p1.0" ,"p1.1" ,"p1.2" ,"p1.3" , +"p1.4" ,"p1.5" ,"p1.6" ,"p1.7" , +"p1.8" ,"p1.9" ,"p1.10" ,"p1.11" , +"p1.12" ,"p1.13" ,"p1.14" ,"p1.15" , +"p1.16" ,"p1.17" ,"p1.18" ,"p1.19" , +"p1.20" ,"p1.21" ,"p1.22" ,"p1.23" , +}; + +static const char *gpio_p2_names[LPC32XX_GPIO_P2_MAX ] = { +"p2.0" ,"p2.1" ,"p2.2" ,"p2.3" , +"p2.4" ,"p2.5" ,"p2.6" ,"p2.7" , +"p2.8" ,"p2.9" ,"p2.10" ,"p2.11" , +"p2.12" +}; + +static const char *gpio_p3_names[LPC32XX_GPIO_P3_MAX ] = { +"gpi000" ,"gpio01" ,"gpio02" ,"gpio03" , +"gpio04" ,"gpio05" +}; + +static const char *gpi_p3_names[LPC32XX_GPI_P3_MAX ] = { +"gpi00" ,"gpi01" ,"gpi02" ,"gpi03" , +"gpi04" ,"gpi05" ,"gpi06" ,"gpi07" , +"gpi08" ,"gpi09" ,NULL ,NULL , +NULL ,NULL ,NULL ,"gpi15" , +"gpi16" ,"gpi17" ,"gpi18" ,"gpi19" , +"gpi20" ,"gpi21" ,"gpi22" ,"gpi23" , +"gpi24" ,"gpi25" ,"gpi26" ,"gpi27" +}; + +static const char *gpo_p3_names[LPC32XX_GPO_P3_MAX ] = { +"gpo00" ,"gpo01" ,"gpo02" ,"gpo03" , +"gpo04" ,"gpo05" ,"gpo06" ,"gpo07" , +"gpo08" ,"gpo09" ,"gpo10" ,"gpo11" , +"gpo12" ,"gpo13" ,"gpo14" ,"gpo15" , +"gpo16" ,"gpo17" ,"gpo18" ,"gpo19" , +"gpo20" ,"gpo21" ,"gpo22" ,"gpo23" +}; + +static struct gpio_regs gpio_grp_regs_p0 = { + .inp_state =LPC32XX_GPIO_P0_INP_STATE , + .outp_set =LPC32XX_GPIO_P0_OUTP_SET , + .outp_clr =LPC32XX_GPIO_P0_OUTP_CLR , + .dir_set =LPC32XX_GPIO_P0_DIR_SET , + .dir_clr =LPC32XX_GPIO_P0_DIR_CLR , +}; + +static struct gpio_regs gpio_grp_regs_p1 = { + .inp_state =LPC32XX_GPIO_P1_INP_STATE , + .outp_set =LPC32XX_GPIO_P1_OUTP_SET , + .outp_clr =LPC32XX_GPIO_P1_OUTP_CLR , + .dir_set =LPC32XX_GPIO_P1_DIR_SET , + .dir_clr =LPC32XX_GPIO_P1_DIR_CLR , +}; + +static struct gpio_regs gpio_grp_regs_p2 = { + .inp_state =LPC32XX_GPIO_P2_INP_STATE , + .outp_set =LPC32XX_GPIO_P2_OUTP_SET , + .outp_clr =LPC32XX_GPIO_P2_OUTP_CLR , + .dir_set =LPC32XX_GPIO_P2_DIR_SET , + .dir_clr =LPC32XX_GPIO_P2_DIR_CLR , +}; + +static struct gpio_regs gpio_grp_regs_p3 = { + .inp_state =LPC32XX_GPIO_P3_INP_STATE , + .outp_set =LPC32XX_GPIO_P3_OUTP_SET , + .outp_clr =LPC32XX_GPIO_P3_OUTP_CLR , + .dir_set =LPC32XX_GPIO_P2_DIR_SET , + .dir_clr =LPC32XX_GPIO_P2_DIR_CLR , +}; + +struct lpc32xx_gpio_chip { +struct gpio_chip chip; +struct gpio_regs *gpio_grp; +}; + +static inline struct lpc32xx_gpio_chip *to_lpc32xx_gpio ( +struct gpio_chip *gpc) +{ + return container_of(gpc, struct lpc32xx_gpio_chip, chip); +} + +static void __set_gpio_dir_p012 (struct lpc32xx_gpio_chip *group, +unsigned pin,int input) +{ +if (input) +__raw_writel (GPIO012_PIN_TO_BIT (pin), + group->gpio_grp->dir_clr); +else +__raw_writel (GPIO012_PIN_TO_BIT (pin), + group->gpio_grp->dir_set); +} + +static void __set_gpio_dir_p3 (struct lpc32xx_gpio_chip *group, +unsigned pin,int input) +{ +u32 u =GPIO3_PIN_TO_BIT (pin); + +if (input) +__raw_writel (u, group->gpio_grp->dir_clr); +else +__raw_writel (u, group->gpio_grp->dir_set); +} + +static void __set_gpio_level_p012 (struct lpc32xx_gpio_chip *group, +unsigned pin,int high) +{ +if (high) +__raw_writel (GPIO012_PIN_TO_BIT (pin), + group->gpio_grp->outp_set); +else +__raw_writel (GPIO012_PIN_TO_BIT (pin), + group->gpio_grp->outp_clr); +} + +static void __set_gpio_level_p3 (struct lpc32xx_gpio_chip *group, +unsigned pin,int high) +{ +u32 u =GPIO3_PIN_TO_BIT (pin); + +if (high) +__raw_writel (u, group->gpio_grp->outp_set); +else +__raw_writel (u, group->gpio_grp->outp_clr); +} + +static void __set_gpo_level_p3 (struct lpc32xx_gpio_chip *group, +unsigned pin,int high) +{ +if (high) +__raw_writel (GPO3_PIN_TO_BIT (pin), group->gpio_grp->outp_set); +else +__raw_writel (GPO3_PIN_TO_BIT (pin), group->gpio_grp->outp_clr); +} + +static int __get_gpio_state_p012 (struct lpc32xx_gpio_chip *group, +unsigned pin) +{ +return GPIO012_PIN_IN_SEL (__raw_readl (group->gpio_grp->inp_state), + pin); +} + +static int __get_gpio_state_p3 (struct lpc32xx_gpio_chip *group, +unsigned pin) +{ +int state =__raw_readl (group->gpio_grp->inp_state); + +/* +* P3 GPIO pin input mapping is not contiguous, GPIOP3-0..4 is mapped +* to bits 10..14, while GPIOP3-5 is mapped to bit 24. +*/ +return GPIO3_PIN_IN_SEL (state, pin); +} + +static int __get_gpi_state_p3 (struct lpc32xx_gpio_chip *group, +unsigned pin) +{ +return GPI3_PIN_IN_SEL (__raw_readl (group->gpio_grp->inp_state), pin); +} + +/* +* GENERIC_GPIO primitives. +*/ +static int lpc32xx_gpio_dir_input_p012 (struct gpio_chip *chip, +unsigned pin) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +__set_gpio_dir_p012 (group, pin,1 ); + +return 0 ; +} + +static int lpc32xx_gpio_dir_input_p3 (struct gpio_chip *chip, +unsigned pin) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +__set_gpio_dir_p3 (group, pin,1 ); + +return 0 ; +} + +static int lpc32xx_gpio_dir_in_always (struct gpio_chip *chip, +unsigned pin) +{ +return 0 ; +} + +static int lpc32xx_gpio_get_value_p012 (struct gpio_chip *chip,unsigned pin) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +return __get_gpio_state_p012 (group, pin); +} + +static int lpc32xx_gpio_get_value_p3 (struct gpio_chip *chip,unsigned pin) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +return __get_gpio_state_p3 (group, pin); +} + +static int lpc32xx_gpi_get_value (struct gpio_chip *chip,unsigned pin) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +return __get_gpi_state_p3 (group, pin); +} + +static int lpc32xx_gpio_dir_output_p012 (struct gpio_chip *chip,unsigned pin, +int value) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +__set_gpio_dir_p012 (group, pin,0 ); + +return 0 ; +} + +static int lpc32xx_gpio_dir_output_p3 (struct gpio_chip *chip,unsigned pin, +int value) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +__set_gpio_dir_p3 (group, pin,0 ); + +return 0 ; +} + +static int lpc32xx_gpio_dir_out_always (struct gpio_chip *chip,unsigned pin, +int value) +{ +return 0 ; +} + +static void lpc32xx_gpio_set_value_p012 (struct gpio_chip *chip,unsigned pin, +int value) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +__set_gpio_level_p012 (group, pin, value); +} + +static void lpc32xx_gpio_set_value_p3 (struct gpio_chip *chip,unsigned pin, +int value) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +__set_gpio_level_p3 (group, pin, value); +} + +static void lpc32xx_gpo_set_value (struct gpio_chip *chip,unsigned pin, +int value) +{ +struct lpc32xx_gpio_chip *group =to_lpc32xx_gpio (chip); + +__set_gpo_level_p3 (group, pin, value); +} + +static int lpc32xx_gpio_request (struct gpio_chip *chip,unsigned pin) +{ +if (pin < chip->ngpio) +return 0 ; + +return -EINVAL ; +} + +static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { + { + .chip = { + .label ="gpio_p0" , + .direction_input = lpc32xx_gpio_dir_input_p012, + .get = lpc32xx_gpio_get_value_p012, + .direction_output = lpc32xx_gpio_dir_output_p012, + .set = lpc32xx_gpio_set_value_p012, + .request = lpc32xx_gpio_request, + .base =LPC32XX_GPIO_P0_GRP , + .ngpio =LPC32XX_GPIO_P0_MAX , + .names = gpio_p0_names, + .can_sleep =0 , + }, + .gpio_grp = &gpio_grp_regs_p0, + }, + { + .chip = { + .label ="gpio_p1" , + .direction_input = lpc32xx_gpio_dir_input_p012, + .get = lpc32xx_gpio_get_value_p012, + .direction_output = lpc32xx_gpio_dir_output_p012, + .set = lpc32xx_gpio_set_value_p012, + .request = lpc32xx_gpio_request, + .base =LPC32XX_GPIO_P1_GRP , + .ngpio =LPC32XX_GPIO_P1_MAX , + .names = gpio_p1_names, + .can_sleep =0 , + }, + .gpio_grp = &gpio_grp_regs_p1, + }, + { + .chip = { + .label ="gpio_p2" , + .direction_input = lpc32xx_gpio_dir_input_p012, + .get = lpc32xx_gpio_get_value_p012, + .direction_output = lpc32xx_gpio_dir_output_p012, + .set = lpc32xx_gpio_set_value_p012, + .request = lpc32xx_gpio_request, + .base =LPC32XX_GPIO_P2_GRP , + .ngpio =LPC32XX_GPIO_P2_MAX , + .names = gpio_p2_names, + .can_sleep =0 , + }, + .gpio_grp = &gpio_grp_regs_p2, + }, + { + .chip = { + .label ="gpio_p3" , + .direction_input = lpc32xx_gpio_dir_input_p3, + .get = lpc32xx_gpio_get_value_p3, + .direction_output = lpc32xx_gpio_dir_output_p3, + .set = lpc32xx_gpio_set_value_p3, + .request = lpc32xx_gpio_request, + .base =LPC32XX_GPIO_P3_GRP , + .ngpio =LPC32XX_GPIO_P3_MAX , + .names = gpio_p3_names, + .can_sleep =0 , + }, + .gpio_grp = &gpio_grp_regs_p3, + }, + { + .chip = { + .label ="gpi_p3" , + .direction_input = lpc32xx_gpio_dir_in_always, + .get = lpc32xx_gpi_get_value, + .request = lpc32xx_gpio_request, + .base =LPC32XX_GPI_P3_GRP , + .ngpio =LPC32XX_GPI_P3_MAX , + .names = gpi_p3_names, + .can_sleep =0 , + }, + .gpio_grp = &gpio_grp_regs_p3, + }, + { + .chip = { + .label ="gpo_p3" , + .direction_output = lpc32xx_gpio_dir_out_always, + .set = lpc32xx_gpo_set_value, + .request = lpc32xx_gpio_request, + .base =LPC32XX_GPO_P3_GRP , + .ngpio =LPC32XX_GPO_P3_MAX , + .names = gpo_p3_names, + .can_sleep =0 , + }, + .gpio_grp = &gpio_grp_regs_p3, + }, +}; + +void __init lpc32xx_gpio_init (void ) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (lpc32xx_gpiochip); i++) +gpiochip_add (&lpc32xx_gpiochip[i].chip); +}
arch/arm/mach-lpc32xx/irq.c new file +434 -0
434 lines not on this page · raw message
arch/arm/mach-lpc32xx/timer.c new file +182 -0
182 lines not on this page · raw message
Signature · 1 line
1.6.6
PATCH 5/13 ARM: LPC32XX: System suspend support
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Support for system suspend and resume
--- arch/arm/mach-lpc32xx/pm.c | 145 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-lpc32xx/suspend.S | 151 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 296 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/pm.c new file +145 -0
@@ -0,0 +1,145 @@ +/* +* arch/arm/mach-lpc32xx/pm.c +* +* Original authors: Vitaly Wool, Dmitry Chigirev <[email protected]> +* Modified by Kevin Wells <[email protected]> +* +* 2005 (c) MontaVista Software, Inc. This file is licensed under +* the terms of the GNU General Public License version 2. This program +* is licensed "as is" without any warranty of any kind, whether express +* or implied. +*/ + +/* +* LPC32XX CPU and system power management +* +* The LCP32XX has three CPU modes for controlling system power: run, +* direct-run, and halt modes. When switching between halt and run modes, +* the CPU transistions through direct-run mode. For Linux, direct-run +* mode is not used in normal operation. Halt mode is used when the +* system is fully suspended. +* +* Run mode: +* The ARM CPU clock (HCLK_PLL), HCLK bus clock, and PCLK bus clocks are +* derived from the HCLK PLL. The HCLK and PCLK bus rates are divided from +* the HCLK_PLL rate. Linux runs in this mode. +* +* Direct-run mode: +* The ARM CPU clock, HCLK bus clock, and PCLK bus clocks are driven from +* SYSCLK. SYSCLK is usually around 13MHz, but may vary based on SYSCLK +* source or the frequency of the main oscillator. In this mode, the +* HCLK_PLL can be safely enabled, changed, or disabled. +* +* Halt mode: +* SYSCLK is gated off and the CPU and system clocks are halted. +* Peripherals based on the 32KHz oscillator clock (ie, RTC, touch, +* key scanner, etc.) still operate if enabled. In this state, an enabled +* system event (ie, GPIO state change, RTC match, key press, etc.) will +* wake the system up back into direct-run mode. +* +* DRAM refresh +* DRAM clocking and refresh are slightly different for systems with DDR +* DRAM or regular SDRAM devices. If SDRAM is used in the system, the +* SDRAM will still be accessible in direct-run mode. In DDR based systems, +* a transistion to direct-run mode will stop all DDR accesses (no clocks). +* Because of this, the code to switch power modes and the code to enter +* and exit DRAM self-refresh modes must not be executed in DRAM. A small +* section of IRAM is used instead for this. +* +* Suspend is handled with the following logic: +* Backup a small area of IRAM used for the suspend code +* Copy suspend code to IRAM +* Transfer control to code in IRAM +* Places DRAMs in self-refresh mode +* Enter direct-run mode +* Save state of HCLK_PLL PLL +* Disable HCLK_PLL PLL +* Enter halt mode - CPU and buses will stop +* System enters direct-run mode when an enabled event occurs +* HCLK PLL state is restored +* Run mode is entered +* DRAMS are placed back into normal mode +* Code execution returns from IRAM +* IRAM code are used for suspend is restored +* Suspend mode is exited +*/ + +#include <linux/suspend.h> +#include <linux/io.h> + +#include <asm/cacheflush.h> + +#include <mach/hardware.h> +#include <mach/platform.h> +#include "common.h" +#include "clock.h" + +#define TEMP_IRAM_AREA IO_ADDRESS(LPC32XX_IRAM_BASE) + +/* +* Both STANDBY and MEM suspend states are handled the same with no +* loss of CPU or memory state +*/ +static int lpc32xx_pm_enter (suspend_state_t state) +{ +int (*lpc32xx_suspend_ptr) (void ); +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" ); +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 +* needs to run from IRAM as DRAM may no longer be available +* when the PLL is stopped. +*/ +memcpy ((void *)TEMP_IRAM_AREA , &lpc32xx_sys_suspend, + lpc32xx_sys_suspend_sz); +flush_icache_range ((unsigned long )TEMP_IRAM_AREA , + (unsigned long )(TEMP_IRAM_AREA ) + lpc32xx_sys_suspend_sz); + +/* Transfer to suspend code in IRAM */ + lpc32xx_suspend_ptr = (void *)TEMP_IRAM_AREA ; +flush_cache_all (); + (void )lpc32xx_suspend_ptr (); + +/* Restore original IRAM contents */ +memcpy ((void *)TEMP_IRAM_AREA , iram_swap_area, + lpc32xx_sys_suspend_sz); + +kfree (iram_swap_area); + +return 0 ; +} + +static struct platform_suspend_ops lpc32xx_pm_ops = { + .valid = suspend_valid_only_mem, + .enter = lpc32xx_pm_enter, +}; + +#define EMC_DYN_MEM_CTRL_OFS 0x20 +#define EMC_SRMMC (1 << 3) +#define EMC_CTRL_REG io_p2v(LPC32XX_EMC_BASE + EMC_DYN_MEM_CTRL_OFS) +static int __init lpc32xx_pm_init (void ) +{ +/* +* Setup SDRAM self-refresh clock to automatically disable o +* start of self-refresh. This only needs to be done once. +*/ +__raw_writel (__raw_readl (EMC_CTRL_REG ) |EMC_SRMMC ,EMC_CTRL_REG ); + +suspend_set_ops (&lpc32xx_pm_ops); + +return 0 ; +} +arch_initcall (lpc32xx_pm_init);
arch/arm/mach-lpc32xx/suspend.S new file +151 -0
151 lines not on this page · raw message
Signature · 1 line
1.6.6
PATCH 6/13 ARM: LPC32XX: Serial support code
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Serial port setup support code
--- arch/arm/mach-lpc32xx/serial.c | 191 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 191 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/serial.c new file +191 -0
@@ -0,0 +1,191 @@ +/* +* arch/arm/mach-lpc32xx/serial.c +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/serial.h> +#include <linux/serial_core.h> +#include <linux/serial_reg.h> +#include <linux/serial_8250.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <mach/hardware.h> +#include <mach/platform.h> +#include <mach/io.h> +#include "common.h" + +#define LPC32XX_SUART_FIFO_SIZE 64 + +/* Standard 8250/16550 compatible serial ports */ +static struct plat_serial8250_port serial_std_platform_data[] = { +#ifdef CONFIG_ARCH_LPC32XX_UART5_SELECT + { + .membase =io_p2v (LPC32XX_UART5_BASE ), + .mapbase =LPC32XX_UART5_BASE , + .irq =IRQ_LPC32XX_UART_IIR5 , + .uartclk =LPC32XX_MAIN_OSC_FREQ , + .regshift =2 , + .iotype =UPIO_MEM32 , + .flags =UPF_BOOT_AUTOCONF |UPF_BUGGY_UART | +UPF_SKIP_TEST , + }, +#endif +#ifdef CONFIG_ARCH_LPC32XX_UART3_SELECT + { + .membase =io_p2v (LPC32XX_UART3_BASE ), + .mapbase =LPC32XX_UART3_BASE , + .irq =IRQ_LPC32XX_UART_IIR3 , + .uartclk =LPC32XX_MAIN_OSC_FREQ , + .regshift =2 , + .iotype =UPIO_MEM32 , + .flags =UPF_BOOT_AUTOCONF |UPF_BUGGY_UART | +UPF_SKIP_TEST , + }, +#endif +#ifdef CONFIG_ARCH_LPC32XX_UART4_SELECT + { + .membase =io_p2v (LPC32XX_UART4_BASE ), + .mapbase =LPC32XX_UART4_BASE , + .irq =IRQ_LPC32XX_UART_IIR4 , + .uartclk =LPC32XX_MAIN_OSC_FREQ , + .regshift =2 , + .iotype =UPIO_MEM32 , + .flags =UPF_BOOT_AUTOCONF |UPF_BUGGY_UART | +UPF_SKIP_TEST , + }, +#endif +#ifdef CONFIG_ARCH_LPC32XX_UART6_SELECT + { + .membase =io_p2v (LPC32XX_UART6_BASE ), + .mapbase =LPC32XX_UART6_BASE , + .irq =IRQ_LPC32XX_UART_IIR6 , + .uartclk =LPC32XX_MAIN_OSC_FREQ , + .regshift =2 , + .iotype =UPIO_MEM32 , + .flags =UPF_BOOT_AUTOCONF |UPF_BUGGY_UART | +UPF_SKIP_TEST , + }, +#endif + { }, +}; + +struct uartinit { +char *uart_ck_name; +u32 ck_mode_mask; +void __iomem *pdiv_clk_reg; +}; + +static struct uartinit uartinit_data[] __initdata = { +#ifdef CONFIG_ARCH_LPC32XX_UART5_SELECT + { + .uart_ck_name = "uart5_ck", + .ck_mode_mask = + LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 5), + .pdiv_clk_reg = LPC32XX_CLKPWR_UART5_CLK_CTRL, + }, +#endif +#ifdef CONFIG_ARCH_LPC32XX_UART3_SELECT + { + .uart_ck_name = "uart3_ck", + .ck_mode_mask = + LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 3), + .pdiv_clk_reg = LPC32XX_CLKPWR_UART3_CLK_CTRL, + }, +#endif +#ifdef CONFIG_ARCH_LPC32XX_UART4_SELECT + { + .uart_ck_name = "uart4_ck", + .ck_mode_mask = + LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 4), + .pdiv_clk_reg = LPC32XX_CLKPWR_UART4_CLK_CTRL, + }, +#endif +#ifdef CONFIG_ARCH_LPC32XX_UART6_SELECT + { + .uart_ck_name = "uart6_ck", + .ck_mode_mask = + LPC32XX_UART_CLKMODE_LOAD(LPC32XX_UART_CLKMODE_ON, 6), + .pdiv_clk_reg = LPC32XX_CLKPWR_UART6_CLK_CTRL, + }, +#endif +}; + +static struct platform_device serial_std_platform_device = { + .name = "serial8250", + .id = 0, + .dev = { + .platform_data = serial_std_platform_data, + }, +}; + +static struct platform_device *lpc32xx_serial_devs[] __initdata = { + &serial_std_platform_device, +}; + +void __init lpc32xx_serial_init(void) +{ + u32 tmp, clkmodes = 0; + struct clk *clk; + unsigned int puart; + int i, j; + + /* UART clocks are off, let clock driver manage them */ + __raw_writel(0, LPC32XX_CLKPWR_UART_CLK_CTRL); + + for (i = 0; i < ARRAY_SIZE(uartinit_data); i++) { + clk = clk_get(NULL, uartinit_data[i].uart_ck_name); + if (!IS_ERR(clk)) { + clk_enable(clk); + serial_std_platform_data[i].uartclk = + clk_get_rate(clk); + } + + /* Fall back on main osc rate if clock rate return fails */ + if (serial_std_platform_data[i].uartclk == 0) + serial_std_platform_data[i].uartclk = + LPC32XX_MAIN_OSC_FREQ; + + /* Setup UART clock modes for all UARTs, disable autoclock */ + clkmodes |= uartinit_data[i].ck_mode_mask; + + /* pre-UART clock divider set to 1 */ + __raw_writel(0x0101, uartinit_data[i].pdiv_clk_reg); + } + + /* This needs to be done after all UART clocks are setup */ + __raw_writel(clkmodes, LPC32XX_UARTCTL_CLKMODE); + for (i = 0; i < ARRAY_SIZE(uartinit_data) - 1; i++) { + /* Force a flush of the RX FIFOs to work around a HW bug */ + puart = serial_std_platform_data[i].mapbase; + __raw_writel(0xC1, LPC32XX_UART_IIR_FCR(puart)); + __raw_writel(0x00, LPC32XX_UART_DLL_FIFO(puart)); + j = LPC32XX_SUART_FIFO_SIZE; + while (j--) + tmp = __raw_readl(LPC32XX_UART_DLL_FIFO(puart)); + __raw_writel(0, LPC32XX_UART_IIR_FCR(puart)); + } + + /* Disable UART5->USB transparent mode or USB won't work */ + tmp = __raw_readl(LPC32XX_UARTCTL_CTRL); + tmp &= ~LPC32XX_UART_U5_ROUTE_TO_USB; + __raw_writel(tmp, LPC32XX_UARTCTL_CTRL); + + platform_add_devices(lpc32xx_serial_devs, + ARRAY_SIZE(lpc32xx_serial_devs)); +}
Signature · 1 line
1.6.6
PATCH 6/13 ARM: LPC32XX: Serial support code
arch/arm/mach-lpc32xx/serial.c line 30
Quoted 12 lines · On Fri, Feb 19, 2010 at 03:26:02PM -0800, wellsk40 at gmail.com wrote:
arch/arm/mach-lpc32xx/serial.c new file +12
-0+#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/serial.h> +#include <linux/serial_core.h> +#include <linux/serial_reg.h> +#include <linux/serial_8250.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <mach/hardware.h> +#include <mach/platform.h> +#include <mach/io.h>
mach/io.h is not required.
PATCH 7/13 ARM: LPC32XX: Misc support functions
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Misc support functions and prototypes used in the LPC32XX arch and platforms
--- arch/arm/mach-lpc32xx/common.c | 271 ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-lpc32xx/common.h | 73 +++++++++++ 2 files changed, 344 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/common.c new file +271 -0
@@ -0,0 +1,271 @@ +/* +* arch/arm/mach-lpc32xx/common.c +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/err.h> +#include <linux/i2c.h> +#include <linux/i2c-pnx.h> +#include <linux/io.h> + +#include <asm/mach/map.h> + +#include <mach/i2c.h> +#include <mach/hardware.h> +#include <mach/platform.h> +#include "common.h" + +/* +* Watchdog timer +*/ +static struct resource watchdog_resources[] = { + [0 ] = { + .start =LPC32XX_WDTIM_BASE , + .end =LPC32XX_WDTIM_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +struct platform_device lpc32xx_watchdog_device = { + .name ="pnx4008-watchdog" , + .id =-1 , + .num_resources =ARRAY_SIZE (watchdog_resources), + .resource = watchdog_resources, +}; + +/* +* I2C busses +*/ +static struct i2c_pnx_data i2c0_data = { + .name =I2C_CHIP_NAME "1" , + .base =LPC32XX_I2C1_BASE , + .irq =IRQ_LPC32XX_I2C_1 , +}; + +static struct i2c_pnx_data i2c1_data = { + .name =I2C_CHIP_NAME "2" , + .base =LPC32XX_I2C2_BASE , + .irq =IRQ_LPC32XX_I2C_2 , +}; + +static struct i2c_pnx_data i2c2_data = { + .name ="USB-I2C" , + .base =LPC32XX_OTG_I2C_BASE , + .irq =IRQ_LPC32XX_USB_I2C , +}; + +struct platform_device lpc32xx_i2c0_device = { + .name ="pnx-i2c" , + .id =0 , + .dev = { + .platform_data = &i2c0_data, + }, +}; + +struct platform_device lpc32xx_i2c1_device = { + .name ="pnx-i2c" , + .id =1 , + .dev = { + .platform_data = &i2c1_data, + }, +}; + +struct platform_device lpc32xx_i2c2_device = { + .name ="pnx-i2c" , + .id =2 , + .dev = { + .platform_data = &i2c2_data, + }, +}; + +/* +* Returns the unique ID for the device +*/ +void lpc32xx_get_uid (u32 devid[4 ]) +{ +int i; + +for (i =0 ; i <4 ; i++) + devid[i] =__raw_readl (LPC32XX_CLKPWR_DEVID (i <<2 )); +} + +/* +* Returns SYSCLK source +* 0 = PLL397, 1 = main oscillator +*/ +int clk_is_sysclk_mainosc (void ) +{ +if ((__raw_readl (LPC32XX_CLKPWR_SYSCLK_CTRL ) & +LPC32XX_CLKPWR_SYSCTRL_SYSCLKMUX ) ==0 ) +return 1 ; + +return 0 ; +} + +/* +* System reset via the watchdog timer +*/ +void lpc32xx_watchdog_reset (void ) +{ +/* Make sure WDT clocks are enabled */ +__raw_writel (LPC32XX_CLKPWR_PWMCLK_WDOG_EN , +LPC32XX_CLKPWR_TIMER_CLK_CTRL ); + +/* Instant assert of RESETOUT_N with pulse length 1mS */ +__raw_writel (13000 ,io_p2v (LPC32XX_WDTIM_BASE +0x18 )); +__raw_writel (0x70 ,io_p2v (LPC32XX_WDTIM_BASE +0xC )); +} + +/* +* Detects and returns IRAM size for the device variation +*/ +#define LPC32XX_IRAM_BANK_SIZE SZ_128K +static u32 iram_size; +u32 lpc32xx_return_iram_size (void ) +{ +if (iram_size ==0 ) { +u32 savedval1, savedval2; +void __iomem *iramptr1, *iramptr2; + + iramptr1 =io_p2v (LPC32XX_IRAM_BASE ); + iramptr2 =io_p2v (LPC32XX_IRAM_BASE +LPC32XX_IRAM_BANK_SIZE ); + savedval1 =__raw_readl (iramptr1); + savedval2 =__raw_readl (iramptr2); + +if (savedval1 == savedval2) { +__raw_writel (savedval2 +1 , iramptr2); +if (__raw_readl (iramptr1) == savedval2 +1 ) + iram_size =LPC32XX_IRAM_BANK_SIZE ; +else + iram_size =LPC32XX_IRAM_BANK_SIZE *2 ; +__raw_writel (savedval2, iramptr2); + }else + iram_size =LPC32XX_IRAM_BANK_SIZE *2 ; + } + +return iram_size; +} + +/* +* Computes PLL rate from PLL register and input clock +*/ +u32 clk_check_pll_setup (u32 ifreq,struct clk_pll_setup *pllsetup) +{ +u32 ilfreq, p, m, n, fcco, fref, cfreq; +int mode; + +/* +* PLL requirements +* ifreq must be >= 1MHz and <= 20MHz +* FCCO must be >= 156MHz and <= 320MHz +* FREF must be >= 1MHz and <= 27MHz +* Assume the passed input data is not valid +*/ + + ilfreq = ifreq; + m = pllsetup->pll_m; + n = pllsetup->pll_n; + p = pllsetup->pll_p; + + mode = (pllsetup->cco_bypass_b15 <<2 ) | + (pllsetup->direct_output_b14 <<1 ) | + pllsetup->fdbk_div_ctrl_b13; + +switch (mode) { +case 0x0 :/* Non-integer mode */ + cfreq = (m * ilfreq) / (2 * p * n); + fcco = (m * ilfreq) / n; + fref = ilfreq / n; +break ; + +case 0x1 :/* integer mode */ + cfreq = (m * ilfreq) / n; + fcco = (m * ilfreq) / (n *2 * p); + fref = ilfreq / n; +break ; + +case 0x2 : +case 0x3 :/* Direct mode */ + cfreq = (m * ilfreq) / n; + fcco = cfreq; + fref = ilfreq / n; +break ; + +case 0x4 : +case 0x5 :/* Bypass mode */ + cfreq = ilfreq / (2 * p); + fcco =156000000 ; + fref =1000000 ; +break ; + +case 0x6 : +case 0x7 :/* Direct bypass mode */ +default : + cfreq = ilfreq; + fcco =156000000 ; + fref =1000000 ; +break ; + } + +if (fcco <156000000 || fcco >320000000 ) + cfreq =0 ; + +if (fref <1000000 || fref >27000000 ) + cfreq =0 ; + +return (u32 ) cfreq; +} + +u32 clk_get_pclk_div (void ) +{ +return 1 + ((__raw_readl (LPC32XX_CLKPWR_HCLK_DIV ) >>2 ) &0x1F ); +} + +static struct map_desc lpc32xx_io_desc[]__initdata = { + { + .virtual =IO_ADDRESS (LPC32XX_AHB0_START ), + .pfn =__phys_to_pfn (LPC32XX_AHB0_START ), + .length =LPC32XX_AHB0_SIZE , + .type =MT_DEVICE + }, + { + .virtual =IO_ADDRESS (LPC32XX_AHB1_START ), + .pfn =__phys_to_pfn (LPC32XX_AHB1_START ), + .length =LPC32XX_AHB1_SIZE , + .type =MT_DEVICE + }, + { + .virtual =IO_ADDRESS (LPC32XX_FABAPB_START ), + .pfn =__phys_to_pfn (LPC32XX_FABAPB_START ), + .length =LPC32XX_FABAPB_SIZE , + .type =MT_DEVICE + }, + { + .virtual =IO_ADDRESS (LPC32XX_IRAM_BASE ), + .pfn =__phys_to_pfn (LPC32XX_IRAM_BASE ), + .length = (LPC32XX_IRAM_BANK_SIZE *2 ), + .type =MT_DEVICE + }, +}; + +void __init lpc32xx_map_io (void ) +{ +iotable_init (lpc32xx_io_desc,ARRAY_SIZE (lpc32xx_io_desc)); +}
arch/arm/mach-lpc32xx/common.h new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
1.6.6
PATCH 8/13 ARM: LPC32XX: Phytec 3250 platform support
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Platform support file for the PHY3250 mach id
--- arch/arm/mach-lpc32xx/phy3250.c | 397 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 397 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/phy3250.c new file +397 -0
@@ -0,0 +1,397 @@ +/* +* arch/arm/mach-lpc32xx/phy3250.c +* +* Author: Kevin Wells <[email protected]> +* +* Copyright (C) 2010 NXP Semiconductors +* +* 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. +*/ + +#include <linux/init.h> +#include <linux/platform_device.h> +#include <linux/sysdev.h> +#include <linux/interrupt.h> +#include <linux/irq.h> +#include <linux/dma-mapping.h> +#include <linux/device.h> +#include <linux/spi/spi.h> +#include <linux/spi/eeprom.h> +#include <linux/leds.h> +#include <linux/gpio.h> +#include <linux/amba/bus.h> +#include <linux/amba/clcd.h> +#include <linux/amba/pl022.h> + +#include <asm/setup.h> +#include <asm/mach-types.h> +#include <asm/mach/arch.h> + +#include <mach/hardware.h> +#include <mach/platform.h> +#include "common.h" + +/* +* Mapped GPIOLIB GPIOs +*/ +#define SPI0_CS_GPIO LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5) +#define LCD_POWER_GPIO LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 0) +#define BKL_POWER_GPIO LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 4) +#define LED_GPIO LPC32XX_GPIO(LPC32XX_GPO_P3_GRP, 1) + +/* +* 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_writecombine (&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; + +if (gpio_request (LCD_POWER_GPIO ,"LCD power" )) +printk (KERN_ERR "Error requesting gpio %u" , +LCD_POWER_GPIO ); +else if (gpio_direction_output (LCD_POWER_GPIO ,1 )) +printk (KERN_ERR "Error setting gpio %u to output" , +LCD_POWER_GPIO ); + +if (gpio_request (BKL_POWER_GPIO ,"LCD backlight power" )) +printk (KERN_ERR "Error requesting gpio %u" , +BKL_POWER_GPIO ); +else if (gpio_direction_output (BKL_POWER_GPIO ,1 )) +printk (KERN_ERR "Error setting gpio %u to output" , +BKL_POWER_GPIO ); + +return 0 ; +} + +static int lpc32xx_clcd_mmap (struct clcd_fb *fb,struct vm_area_struct *vma) +{ +return dma_mmap_writecombine (&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_writecombine (&fb->dev->dev, fb->fb.fix.smem_len, + fb->fb.screen_base, fb->fb.fix.smem_start); +} + +/* +* On some early LCD modules (1307.0), the backlight logic is inverted. +* For those board variants, swap the disable and enable states for +* BKL_POWER_GPIO. +*/ +static void clcd_disable (struct clcd_fb *fb) +{ +gpio_set_value (BKL_POWER_GPIO ,0 ); +gpio_set_value (LCD_POWER_GPIO ,0 ); +} + +static void clcd_enable (struct clcd_fb *fb) +{ +gpio_set_value (BKL_POWER_GPIO ,1 ); +gpio_set_value (LCD_POWER_GPIO ,1 ); +} + +static struct clcd_board lpc32xx_clcd_data = { + .name ="Phytec LCD" , + .check = clcdfb_check, + .decode = clcdfb_decode, + .disable = clcd_disable, + .enable = clcd_enable, + .setup = lpc32xx_clcd_setup, + .mmap = lpc32xx_clcd_mmap, + .remove = lpc32xx_clcd_remove, +}; + +static struct amba_device lpc32xx_clcd_device = { + .dev = { + .coherent_dma_mask = ~0 , + .init_name ="dev:clcd" , + .platform_data = &lpc32xx_clcd_data, + }, + .res = { + .start =LPC32XX_LCD_BASE , + .end = (LPC32XX_LCD_BASE +SZ_4K -1 ), + .flags =IORESOURCE_MEM , + }, + .dma_mask = ~0 , + .irq = {IRQ_LPC32XX_LCD ,NO_IRQ }, +}; + +/* +* AMBA SSP (SPI) +*/ +static void phy3250_spi_cs_set (u32 control) +{ +gpio_set_value (SPI0_CS_GPIO , (int ) control); +} + +static struct pl022_config_chip spi0_chip_info = { + .lbm =LOOPBACK_DISABLED , + .com_mode =INTERRUPT_TRANSFER , + .iface =SSP_INTERFACE_MOTOROLA_SPI , + .hierarchy =SSP_MASTER , + .slave_tx_disable =0 , + .endian_tx =SSP_TX_LSB , + .endian_rx =SSP_RX_LSB , + .data_size =SSP_DATA_BITS_8 , + .rx_lev_trig =SSP_RX_4_OR_MORE_ELEM , + .tx_lev_trig =SSP_TX_4_OR_MORE_EMPTY_LOC , + .clk_phase =SSP_CLK_FIRST_EDGE , + .clk_pol =SSP_CLK_POL_IDLE_LOW , + .ctrl_len =SSP_BITS_8 , + .wait_state =SSP_MWIRE_WAIT_ZERO , + .duplex =SSP_MICROWIRE_CHANNEL_FULL_DUPLEX , + .cs_control = phy3250_spi_cs_set, +}; + +static struct pl022_ssp_controller lpc32xx_ssp0_data = { + .bus_id =0 , + .num_chipselect =1 , + .enable_dma =0 , +}; + +static struct amba_device lpc32xx_ssp0_device = { + .dev = { + .coherent_dma_mask = ~0 , + .init_name ="dev:ssp0" , + .platform_data = &lpc32xx_ssp0_data, + }, + .res = { + .start =LPC32XX_SSP0_BASE , + .end = (LPC32XX_SSP0_BASE +SZ_4K -1 ), + .flags =IORESOURCE_MEM , + }, + .dma_mask = ~0 , + .irq = {IRQ_LPC32XX_SSP0 ,NO_IRQ }, +}; + +/* AT25 driver registration */ +static int __init phy3250_spi_board_register (void ) +{ +#if defined(CONFIG_SPI_SPIDEV ) || defined(CONFIG_SPI_SPIDEV_MODULE ) +static struct spi_board_info info[] = { + { + .modalias ="spidev" , + .max_speed_hz =5000000 , + .bus_num =0 , + .chip_select =0 , + .controller_data = &spi0_chip_info, + }, + }; + +#else +static struct spi_eeprom eeprom = { + .name ="at25256a" , + .byte_len =0x8000 , + .page_size =64 , + .flags =EE_ADDR2 , + }; + +static struct spi_board_info info[] = { + { + .modalias ="at25" , + .max_speed_hz =5000000 , + .bus_num =0 , + .chip_select =0 , + .platform_data = &eeprom, + .controller_data = &spi0_chip_info, + }, + }; +#endif +return spi_register_board_info (info,ARRAY_SIZE (info)); +} +arch_initcall (phy3250_spi_board_register); + +static struct i2c_board_info __initdata phy3250_i2c_board_info[] = { + { +I2C_BOARD_INFO ("pcf8563" ,0x51 ), + }, +}; + +static struct gpio_led phy_leds[] = { + { + .name ="led0" , + .gpio =LED_GPIO , + .active_low =1 , + .default_trigger ="heartbeat" , + }, +}; + +static struct gpio_led_platform_data led_data = { + .leds = phy_leds, + .num_leds =ARRAY_SIZE (phy_leds), +}; + +static struct platform_device lpc32xx_gpio_led_device = { + .name ="leds-gpio" , + .id =-1 , + .dev.platform_data = &led_data, +}; + +static struct platform_device *phy3250_devs[]__initdata = { + &lpc32xx_i2c0_device, + &lpc32xx_i2c1_device, + &lpc32xx_i2c2_device, + &lpc32xx_watchdog_device, + &lpc32xx_gpio_led_device, +}; + +static struct amba_device *amba_devs[]__initdata = { + &lpc32xx_clcd_device, + &lpc32xx_ssp0_device, +}; + +/* +* Board specific functions +*/ +static void __init phy3250_board_init (void ) +{ +u32 tmp; +int i; + +lpc32xx_gpio_init (); + +/* Register GPIOs used on this board */ +if (gpio_request (SPI0_CS_GPIO ,"spi0 cs" )) +printk (KERN_ERR "Error requesting gpio %u" , +SPI0_CS_GPIO ); +else if (gpio_direction_output (SPI0_CS_GPIO ,1 )) +printk (KERN_ERR "Error setting gpio %u to output" , +SPI0_CS_GPIO ); + +/* Setup network interface for RMII mode */ + tmp =__raw_readl (LPC32XX_CLKPWR_MACCLK_CTRL ); + tmp &= ~LPC32XX_CLKPWR_MACCTRL_PINS_MSK ; + tmp |=LPC32XX_CLKPWR_MACCTRL_USE_RMII_PINS ; +__raw_writel (tmp,LPC32XX_CLKPWR_MACCLK_CTRL ); + +/* Setup SLC NAND controller muxing */ +__raw_writel (LPC32XX_CLKPWR_NANDCLK_SEL_SLC , +LPC32XX_CLKPWR_NAND_CLK_CTRL ); + +/* 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 ); + +/* Set up I2C pull levels */ + tmp =__raw_readl (LPC32XX_CLKPWR_I2C_CLK_CTRL ); + tmp |=LPC32XX_CLKPWR_I2CCLK_USBI2CHI_DRIVE | +LPC32XX_CLKPWR_I2CCLK_I2C2HI_DRIVE ; +__raw_writel (tmp,LPC32XX_CLKPWR_I2C_CLK_CTRL ); + +/* Disable IrDA pulsing support on UART6 */ + tmp =__raw_readl (LPC32XX_UARTCTL_CTRL ); + tmp |=LPC32XX_UART_UART6_IRDAMOD_BYPASS ; +__raw_writel (tmp,LPC32XX_UARTCTL_CTRL ); + +/* Enable DMA for I2S1 channel */ + tmp =__raw_readl (LPC32XX_CLKPWR_I2S_CLK_CTRL ); + tmp =LPC32XX_CLKPWR_I2SCTRL_I2S1_USE_DMA ; +__raw_writel (tmp,LPC32XX_CLKPWR_I2S_CLK_CTRL ); + +lpc32xx_serial_init (); + +/* +* AMBA peripheral clocks need to be enabled prior to AMBA device +* detection or a data fault will occur, so enable the clocks +* here. However, we don't want to enable them if the peripheral +* isn't included in the image +*/ +#ifdef CONFIG_FB_ARMCLCD + tmp =__raw_readl (LPC32XX_CLKPWR_LCDCLK_CTRL ); +__raw_writel ((tmp |LPC32XX_CLKPWR_LCDCTRL_CLK_EN ), +LPC32XX_CLKPWR_LCDCLK_CTRL ); +#endif +#ifdef CONFIG_SPI_PL022 + tmp =__raw_readl (LPC32XX_CLKPWR_SSP_CLK_CTRL ); +__raw_writel ((tmp |LPC32XX_CLKPWR_SSPCTRL_SSPCLK0_EN ), +LPC32XX_CLKPWR_SSP_CLK_CTRL ); +#endif + +platform_add_devices (phy3250_devs,ARRAY_SIZE (phy3250_devs)); +for (i =0 ; i <ARRAY_SIZE (amba_devs); i++) { +struct amba_device *d = amba_devs[i]; +amba_device_register (d, &iomem_resource); + } + +/* Test clock needed for UDA1380 initial init */ +__raw_writel (LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC | +LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN , +LPC32XX_CLKPWR_TEST_CLK_SEL ); + +i2c_register_board_info (0 , phy3250_i2c_board_info, +ARRAY_SIZE (phy3250_i2c_board_info)); +} + +static int __init lpc32xx_display_uid (void ) +{ +u32 uid[4 ]; + +lpc32xx_get_uid (uid); + +printk (KERN_INFO "LPC32XX unique ID: %08x%08x%08x%08x\n" , + uid[3 ], uid[2 ], uid[1 ], uid[0 ]); + +return 1 ; +} +arch_initcall (lpc32xx_display_uid); + +MACHINE_START (PHY3250 ,"Phytec 3250 board with the LPC3250 Microcontroller" ) +/* Maintainer: Kevin Wells, NXP Semiconductors */ + .phys_io = LPC32XX_UART5_BASE, + .io_pg_offst = ((IO_ADDRESS(LPC32XX_UART5_BASE))>>18) & 0xfffc, + .boot_params = 0x80000100, + .map_io = lpc32xx_map_io, + .init_irq = lpc32xx_init_irq, + .timer = &lpc32xx_timer, + .init_machine = phy3250_board_init, +MACHINE_END
Signature · 1 line
1.6.6
PATCH 9/13 ARM: LPC32XX: Arch config menu supoport and makefiles
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
--- arch/arm/mach-lpc32xx/Kconfig | 33 +++++++++++++++++++++++++++++++++ arch/arm/mach-lpc32xx/Makefile | 8 ++++++++ arch/arm/mach-lpc32xx/Makefile.boot | 4 ++++ 3 files changed, 45 insertions(+), 0 deletions(-)
arch/arm/mach-lpc32xx/Kconfig new file +33 -0
@@ -0,0 +1,33 @@ +if ARCH_LPC32XX + +menu "Individual UART enable selections" + +config ARCH_LPC32XX_UART3_SELECT + bool "Add support for standard UART3" + help + Adds support for standard UART 3 when the 8250 serial support + is enabled. + +config ARCH_LPC32XX_UART4_SELECT + bool "Add support for standard UART4" + help + Adds support for standard UART 4 when the 8250 serial support + is enabled. + +config ARCH_LPC32XX_UART5_SELECT + bool "Add support for standard UART5" + default y + help + Adds support for standard UART 5 when the 8250 serial support + is enabled. + +config ARCH_LPC32XX_UART6_SELECT + bool "Add support for standard UART6" + help + Adds support for standard UART 6 when the 8250 serial support + is enabled. + +endmenu + +endif +
arch/arm/mach-lpc32xx/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# +# Makefile for the linux kernel. +# + +obj-y := timer.o irq.o common.o serial.o clock.o +obj-y += gpiolib.o pm.o suspend.o +obj-y += phy3250.o +
arch/arm/mach-lpc32xx/Makefile.boot new file +4 -0
@@ -0,0 +1,4 @@ + zreladdr-y := 0x80008000 +params_phys-y := 0x80000100 +initrd_phys-y := 0x82000000 +
Signature · 1 line
1.6.6
PATCH 10/13 ARM: LPC32XX: Default PHY3250 kernel config (ramdisk)
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
--- arch/arm/configs/phy3250_defconfig | 1084 ++++++++++++++++++++++++++++++++++++ 1 files changed, 1084 insertions(+), 0 deletions(-)
arch/arm/configs/phy3250_defconfig new file +1084 -0
@@ -0,0 +1,1084 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.33-rc6 +# Mon Feb 8 13:45:54 2010 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_CONSTRUCTORS=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_HAVE_KERNEL_GZIP=y +CONFIG_HAVE_KERNEL_LZO=y +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_BZIP2 is not set +# CONFIG_KERNEL_LZMA is not set +# CONFIG_KERNEL_LZO is not set +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_BSD_PROCESS_ACCT is not set + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_TREE_PREEMPT_RCU is not set +# CONFIG_TINY_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_TREE_RCU_TRACE is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_GROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_RT_GROUP_SCHED is not set +CONFIG_USER_SCHED=y +# CONFIG_CGROUP_SCHED is not set +# CONFIG_CGROUPS is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +# CONFIG_RELAY is not set +# CONFIG_NAMESPACES is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_RD_GZIP=y +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_LZO is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EMBEDDED=y +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y + +# +# Kernel Performance Events And Counters +# +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_COMPAT_BRK=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y + +# +# GCOV-based kernel profiling +# +# CONFIG_SLOW_WORK is not set +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +# CONFIG_INLINE_SPIN_UNLOCK is not set +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +# CONFIG_INLINE_READ_UNLOCK is not set +# CONFIG_INLINE_READ_UNLOCK_BH is not set +# CONFIG_INLINE_READ_UNLOCK_IRQ is not set +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +# CONFIG_INLINE_WRITE_UNLOCK is not set +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +# CONFIG_MUTEX_SPIN_ON_OWNER is not set +CONFIG_FREEZER=y + +# +# System Type +# +CONFIG_MMU=y +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_GEMINI is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_STMP3XXX is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_NOMADIK is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_DOVE is not set +# CONFIG_ARCH_KIRKWOOD is not set +# CONFIG_ARCH_LOKI is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_MMP is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_W90X900 is not set +CONFIG_ARCH_LPC32XX=y +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_MSM is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_S3C64XX is not set +# CONFIG_ARCH_S5PC1XX is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_U300 is not set +# CONFIG_ARCH_DAVINCI is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_BCMRING is not set +# CONFIG_ARCH_U8500 is not set + +# +# Individual UART enable selections +# +# CONFIG_ARCH_LPC32XX_UART3_SELECT is not set +# CONFIG_ARCH_LPC32XX_UART4_SELECT is not set +CONFIG_ARCH_LPC32XX_UART5_SELECT=y +# CONFIG_ARCH_LPC32XX_UART6_SELECT is not set + +# +# Processor Type +# +CONFIG_CPU_ARM926T=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5TJ=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y + +# +# Processor Features +# +CONFIG_ARM_THUMB=y +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_WRITETHROUGH is not set +# CONFIG_CPU_CACHE_ROUND_ROBIN is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_COMMON_CLKDEV=y + +# +# Bus support +# +CONFIG_ARM_AMBA=y +# CONFIG_PCI_SYSCALL is not set +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCCARD is not set + +# +# Kernel Features +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_1G is not set +CONFIG_PAGE_OFFSET=0xC0000000 +# CONFIG_PREEMPT_NONE is not set +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREEMPT=y +CONFIG_HZ=100 +CONFIG_AEABI=y +CONFIG_OABI_COMPAT=y +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_HIGHMEM is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_ALIGNMENT_TRAP=y +# CONFIG_UACCESS_WITH_MEMCPY is not set + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="console=tty0 console=ttyS0,115200n81 root=/dev/ram0 init=/sbin/init" +# CONFIG_XIP_KERNEL is not set +# CONFIG_KEXEC is not set + +# +# CPU Power Management +# +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set +CONFIG_VFP=y + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_HAVE_AOUT=y +CONFIG_BINFMT_AOUT=y +# CONFIG_BINFMT_MISC is not set + +# +# Power management options +# +CONFIG_PM=y +# CONFIG_PM_DEBUG is not set +CONFIG_PM_SLEEP=y +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +# CONFIG_APM_EMULATION is not set +# CONFIG_PM_RUNTIME is not set +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_NET is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_DEVTMPFS is not set +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_MTD is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_CRYPTOLOOP=y + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=1 +CONFIG_BLK_DEV_RAM_SIZE=16384 +# CONFIG_BLK_DEV_XIP is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_MG_DISK is not set +CONFIG_MISC_DEVICES=y +# CONFIG_AD525X_DPOT is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_ISL29003 is not set +# CONFIG_DS1682 is not set +# CONFIG_TI_DAC7512 is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +CONFIG_EEPROM_AT25=y +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +# CONFIG_EEPROM_93CX6 is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_LIBFC is not set +# CONFIG_LIBFCOE is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_DH is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +# CONFIG_ATA is not set +# CONFIG_MD is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_SPARSEKMAP is not set + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_VT_HW_CONSOLE_BINDING is not set +CONFIG_DEVKMEM=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_AMBA_PL010 is not set +# CONFIG_SERIAL_AMBA_PL011 is not set +# CONFIG_SERIAL_MAX3100 is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_HELPER_AUTO=y + +# +# I2C Hardware Bus support +# + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_GPIO is not set +# CONFIG_I2C_OCORES is not set +CONFIG_I2C_PNX=y +# CONFIG_I2C_SIMTEC is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_STUB is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +# CONFIG_SPI_BITBANG is not set +# CONFIG_SPI_GPIO is not set +CONFIG_SPI_PL022=y +# CONFIG_SPI_XILINX is not set +# CONFIG_SPI_DESIGNWARE is not set + +# +# SPI Protocol Masters +# +# CONFIG_SPI_SPIDEV is not set +# CONFIG_SPI_TLE62X0 is not set + +# +# PPS support +# +# CONFIG_PPS is not set +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_GPIOLIB=y +# CONFIG_DEBUG_GPIO is not set +CONFIG_GPIO_SYSFS=y + +# +# Memory mapped GPIO expanders: +# +# CONFIG_GPIO_PL061 is not set + +# +# I2C GPIO expanders: +# +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCF857X is not set +# CONFIG_GPIO_ADP5588 is not set + +# +# PCI GPIO expanders: +# + +# +# SPI GPIO expanders: +# +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MCP23S08 is not set +# CONFIG_GPIO_MC33880 is not set + +# +# AC97 GPIO expanders: +# +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_PNX4008_WATCHDOG=y +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_ASIC3 is not set +# CONFIG_HTC_EGPIO is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TPS65010 is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_MFD_TC6393XB is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_MC13783 is not set +# CONFIG_AB3100_CORE is not set +# CONFIG_EZX_PCAP is not set +# CONFIG_MFD_88PM8607 is not set +# CONFIG_AB4500_CORE is not set +# CONFIG_REGULATOR is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +CONFIG_FB_ARMCLCD=y +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_SOUND is not set +# CONFIG_HID_SUPPORT is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +# CONFIG_LEDS_PCA9532 is not set +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_GPIO_PLATFORM=y +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_DAC124S085 is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_LT3593 is not set + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +# CONFIG_LEDS_TRIGGER_TIMER is not set +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_GPIO is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_ACCESSIBILITY is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set + +# +# TI VLYNQ +# +# CONFIG_STAGING is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_FILE_LOCKING is not set +CONFIG_FSNOTIFY=y +# CONFIG_DNOTIFY is not set +# CONFIG_INOTIFY is not set +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_CRAMFS=y +# CONFIG_SQUASHFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set +# CONFIG_EFI_PARTITION is not set +# CONFIG_SYSV68_PARTITION is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=y + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +CONFIG_DETECT_HUNG_TASK=y +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +CONFIG_SCHED_DEBUG=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_PREEMPT is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +CONFIG_FRAME_POINTER=y +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_RCU_CPU_STALL_DETECTOR is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_LATENCYTOP is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_PAGE_POISONING is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +# CONFIG_ARM_UNWIND is not set +CONFIG_DEBUG_USER=y +CONFIG_DEBUG_ERRORS=y +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_LL is not set +# CONFIG_OC_ETM is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +# CONFIG_DEFAULT_SECURITY_SELINUX is not set +# CONFIG_DEFAULT_SECURITY_SMACK is not set +# CONFIG_DEFAULT_SECURITY_TOMOYO is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +# CONFIG_CRYPTO_FIPS is not set +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_PCOMP=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_AUTHENC is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +CONFIG_CRYPTO_CBC=y +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +# CONFIG_CRYPTO_ECB is not set +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_GHASH is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_ZLIB is not set +# CONFIG_CRYPTO_LZO is not set + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=y +# CONFIG_CRYPTO_HW is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +CONFIG_CRC_CCITT=y +# CONFIG_CRC16 is not set +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +CONFIG_CRC32=y +# CONFIG_CRC7 is not set +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y
Signature · 1 line
1.6.6
PATCH 11/13 ARM: Add support for the LPC32XX arch
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Add LPC32XX support in arch/arm/Kconfig and arch/arm/Makefile
--- arch/arm/Kconfig | 15 +++++++++++++++ arch/arm/Makefile | 1 + 2 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/Kconfig +15 -0
@@ -572,6 +572,19 @@ config ARCH_NUC93X Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a low-power and high performance MPEG-4/JPEG multimedia controller chip. +config ARCH_LPC32XX + bool "NXP LPC32XX" + select CPU_ARM926T + select ARCH_REQUIRE_GPIOLIB + select HAVE_IDE + select ARM_AMBA + select USB_ARCH_HAS_OHCI + select COMMON_CLKDEV + select GENERIC_TIME + select GENERIC_CLOCKEVENTS + help + Support for the NXP LPC32XX family of processors + config ARCH_PNX4008 bool "Philips Nexperia PNX4008 Mobile" select CPU_ARM926T
@@ -809,6 +822,8 @@ source "arch/arm/mach-lh7a40x/Kconfig" source "arch/arm/mach-loki/Kconfig" +source "arch/arm/mach-lpc32xx/Kconfig" + source "arch/arm/mach-msm/Kconfig" source "arch/arm/mach-mv78xx0/Kconfig"
arch/arm/Makefile +1 -0
@@ -139,6 +139,7 @@ machine-$(CONFIG_ARCH_KS8695) := ks8695 machine-$(CONFIG_ARCH_L7200) := l7200 machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x machine-$(CONFIG_ARCH_LOKI) := loki +machine-$(CONFIG_ARCH_LPC32XX) := lpc32xx machine-$(CONFIG_ARCH_MMP) := mmp machine-$(CONFIG_ARCH_MSM) := msm machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0
Signature · 1 line
1.6.6
PATCH 12/13 i2c: Add support for the LPC32XX arch
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Allow the i2c-pnx driver to be reused with the LPC32xx arch. Changed menu title to include NXP devices
--- drivers/i2c/busses/Kconfig | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/Kconfig +2 -2
@@ -474,8 +474,8 @@ config I2C_PASEMI Supports the PA Semi PWRficient on-chip SMBus interfaces. config I2C_PNX - tristate "I2C bus support for Philips PNX targets" - depends on ARCH_PNX4008 + tristate "I2C bus support for Philips/NXP devices" + depends on ARCH_PNX4008 || ARCH_LPC32XX help This driver supports the Philips IP3204 I2C IP block master and/or slave controller
Signature · 1 line
1.6.6
PATCH 13/13 WATCHDOG: Add support for the LPC32XX arch
In reply to wellsk40 at gmail.comFrom: Kevin Wells <[email protected]>
Allow the pnx4408 watchdog driver to be reused with the LPC32xx arch. Changed menu title to include the LCP32XX device.
--- drivers/watchdog/Kconfig | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/watchdog/Kconfig +3 -3
@@ -205,11 +205,11 @@ config OMAP_WATCHDOG here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430 watchdog timer. config PNX4008_WATCHDOG - tristate "PNX4008 Watchdog" - depends on ARCH_PNX4008 + tristate "PNX4008/LPC32XX Watchdog" + depends on ARCH_PNX4008 || ARCH_LPC32XX help Say Y here if to include support for the watchdog timer - in the PNX4008 processor. + in the PNX4008 or LPC32XX processors. This driver can be built as a module by choosing M. The module will be called pnx4008_wdt.
Signature · 1 line
1.6.6