summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap')
-rw-r--r--arch/arm/mach-omap/Kconfig28
-rw-r--r--arch/arm/mach-omap/Makefile4
-rw-r--r--arch/arm/mach-omap/devices-gpmc-nand.c4
-rw-r--r--arch/arm/mach-omap/gpio.c175
-rw-r--r--arch/arm/mach-omap/gpmc.c4
-rw-r--r--arch/arm/mach-omap/include/mach/clocks.h4
-rw-r--r--arch/arm/mach-omap/include/mach/control.h4
-rw-r--r--arch/arm/mach-omap/include/mach/debug_ll.h3
-rw-r--r--arch/arm/mach-omap/include/mach/emac_defs.h48
-rw-r--r--arch/arm/mach-omap/include/mach/gpio.h4
-rw-r--r--arch/arm/mach-omap/include/mach/gpmc.h4
-rw-r--r--arch/arm/mach-omap/include/mach/intc.h4
-rw-r--r--arch/arm/mach-omap/include/mach/omap3-clock.h4
-rw-r--r--arch/arm/mach-omap/include/mach/omap3-mux.h4
-rw-r--r--arch/arm/mach-omap/include/mach/omap3-silicon.h4
-rw-r--r--arch/arm/mach-omap/include/mach/omap3-smx.h3
-rw-r--r--arch/arm/mach-omap/include/mach/omap4-mux.h4
-rw-r--r--arch/arm/mach-omap/include/mach/omap4-silicon.h4
-rw-r--r--arch/arm/mach-omap/include/mach/sdrc.h4
-rw-r--r--arch/arm/mach-omap/include/mach/silicon.h4
-rw-r--r--arch/arm/mach-omap/include/mach/sys_info.h4
-rw-r--r--arch/arm/mach-omap/include/mach/syslib.h4
-rw-r--r--arch/arm/mach-omap/include/mach/timers.h4
-rw-r--r--arch/arm/mach-omap/include/mach/wdt.h4
-rw-r--r--arch/arm/mach-omap/include/mach/xload.h4
-rw-r--r--arch/arm/mach-omap/omap3_clock.c18
-rw-r--r--arch/arm/mach-omap/omap3_core.S4
-rw-r--r--arch/arm/mach-omap/omap3_generic.c23
-rw-r--r--arch/arm/mach-omap/omap4_generic.c19
-rw-r--r--arch/arm/mach-omap/omap4_twl6030_mmc.c4
-rw-r--r--arch/arm/mach-omap/s32k_clksource.c4
-rw-r--r--arch/arm/mach-omap/syslib.c4
-rw-r--r--arch/arm/mach-omap/xload.c99
33 files changed, 267 insertions, 245 deletions
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index d735284a11..c0d02efc77 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -15,10 +15,6 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
menu "OMAP Features"
depends on ARCH_OMAP
@@ -52,20 +48,7 @@ config ARCH_OMAP4
endchoice
-### Generic Clock configurations to be enabled by Mach - invisible to enable.
-config OMAP_CLOCK_UART
- bool
-config OMAP_CLOCK_UART2
- bool
-config OMAP_CLOCK_UART3
- bool
-config OMAP_CLOCK_I2C
- bool
-
# Blind enable all possible clocks.. think twice before you do this.
-config OMAP_CLOCK_ALL
- bool
-
config OMAP_CLOCK_SOURCE_S32K
bool
@@ -91,6 +74,13 @@ config OMAP_BUILD_IFT
prompt "build ift binary"
bool
+config OMAP_BUILD_SPI
+ prompt "build SPI binary"
+ bool
+ help
+ Say Y here if you want to build an barebox.spi image as used
+ on the AM35xx chips when booting form SPI NOR flash.
+
config ARCH_TEXT_BASE
hex
default 0x80e80000 if MACH_OMAP343xSDP
@@ -110,14 +100,12 @@ choice
config MACH_OMAP343xSDP
bool "Texas Instrument's SDP343x"
- select OMAP_CLOCK_ALL
depends on ARCH_OMAP3
help
Say Y here if you are using SDP343x platform
config MACH_BEAGLE
bool "Texas Instrument's Beagle Board"
- select OMAP_CLOCK_ALL
select HAVE_NOSHELL
depends on ARCH_OMAP3
help
@@ -125,7 +113,6 @@ config MACH_BEAGLE
config MACH_OMAP3EVM
bool "Texas Instrument's OMAP3 EVM"
- select OMAP_CLOCK_ALL
select HAVE_NOSHELL
depends on ARCH_OMAP3
help
@@ -150,7 +137,6 @@ config MACH_PCM049
config MACH_PCAAL1
bool "Phytec phyCARD-A-L1"
- select OMAP_CLOCK_ALL
select HAVE_NOSHELL
depends on ARCH_OMAP3
help
diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index f087f4b765..f752bc7986 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -14,10 +14,6 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
#
obj-$(CONFIG_ARCH_OMAP) += syslib.o
pbl-$(CONFIG_ARCH_OMAP) += syslib.o
diff --git a/arch/arm/mach-omap/devices-gpmc-nand.c b/arch/arm/mach-omap/devices-gpmc-nand.c
index 64ca66619f..129f91a617 100644
--- a/arch/arm/mach-omap/devices-gpmc-nand.c
+++ b/arch/arm/mach-omap/devices-gpmc-nand.c
@@ -20,10 +20,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <common.h>
#include <console.h>
diff --git a/arch/arm/mach-omap/gpio.c b/arch/arm/mach-omap/gpio.c
index 142cf524eb..ff49708b15 100644
--- a/arch/arm/mach-omap/gpio.c
+++ b/arch/arm/mach-omap/gpio.c
@@ -12,10 +12,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*
* This work is derived from the linux 2.6.27 kernel source
* To fetch, use the kernel repository
@@ -36,11 +32,10 @@
* published by the Free Software Foundation.
*/
#include <common.h>
-#include <mach/gpio.h>
#include <io.h>
#include <errno.h>
-
-#ifdef CONFIG_ARCH_OMAP3
+#include <gpio.h>
+#include <init.h>
#define OMAP_GPIO_OE 0x0034
#define OMAP_GPIO_DATAIN 0x0038
@@ -48,129 +43,115 @@
#define OMAP_GPIO_CLEARDATAOUT 0x0090
#define OMAP_GPIO_SETDATAOUT 0x0094
-static void __iomem *gpio_bank[] = {
- (void *)0x48310000,
- (void *)0x49050000,
- (void *)0x49052000,
- (void *)0x49054000,
- (void *)0x49056000,
- (void *)0x49058000,
-};
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-
-#define OMAP_GPIO_OE 0x0134
-#define OMAP_GPIO_DATAIN 0x0138
-#define OMAP_GPIO_DATAOUT 0x013c
-#define OMAP_GPIO_CLEARDATAOUT 0x0190
-#define OMAP_GPIO_SETDATAOUT 0x0194
-
-static void __iomem *gpio_bank[] = {
- (void *)0x4a310000,
- (void *)0x48055000,
- (void *)0x48057000,
- (void *)0x48059000,
- (void *)0x4805b000,
- (void *)0x4805d000,
+struct omap_gpio_chip {
+ void __iomem *base;
+ struct gpio_chip chip;
};
-#endif
-
-static inline void __iomem *get_gpio_base(int gpio)
-{
- return gpio_bank[gpio >> 5];
-}
-static inline int get_gpio_index(int gpio)
+static inline int omap_get_gpio_index(int gpio)
{
return gpio & 0x1f;
}
-static inline int gpio_valid(int gpio)
+static void omap_gpio_set_value(struct gpio_chip *chip,
+ unsigned gpio, int value)
{
- if (gpio < 0)
- return -1;
- if (gpio / 32 < ARRAY_SIZE(gpio_bank))
- return 0;
- return -1;
-}
-
-static int check_gpio(int gpio)
-{
- if (gpio_valid(gpio) < 0) {
- printf("ERROR : check_gpio: invalid GPIO %d\n", gpio);
- return -1;
- }
- return 0;
-}
-
-void gpio_set_value(unsigned gpio, int value)
-{
- void __iomem *reg;
+ struct omap_gpio_chip *omapgpio =
+ container_of(chip, struct omap_gpio_chip, chip);
+ void __iomem *base = omapgpio->base;
u32 l = 0;
- if (check_gpio(gpio) < 0)
- return;
-
- reg = get_gpio_base(gpio);
-
if (value)
- reg += OMAP_GPIO_SETDATAOUT;
+ base += OMAP_GPIO_SETDATAOUT;
else
- reg += OMAP_GPIO_CLEARDATAOUT;
- l = 1 << get_gpio_index(gpio);
+ base += OMAP_GPIO_CLEARDATAOUT;
+
+ l = 1 << omap_get_gpio_index(gpio);
- __raw_writel(l, reg);
+ writel(l, base);
}
-int gpio_direction_input(unsigned gpio)
+static int omap_gpio_direction_input(struct gpio_chip *chip,
+ unsigned gpio)
{
- void __iomem *reg;
+ struct omap_gpio_chip *omapgpio =
+ container_of(chip, struct omap_gpio_chip, chip);
+ void __iomem *base = omapgpio->base;
u32 val;
- if (check_gpio(gpio) < 0)
- return -EINVAL;
-
- reg = get_gpio_base(gpio);
-
- reg += OMAP_GPIO_OE;
+ base += OMAP_GPIO_OE;
- val = __raw_readl(reg);
- val |= 1 << get_gpio_index(gpio);
- __raw_writel(val, reg);
+ val = readl(base);
+ val |= 1 << omap_get_gpio_index(gpio);
+ writel(val, base);
return 0;
}
-int gpio_direction_output(unsigned gpio, int value)
+static int omap_gpio_direction_output(struct gpio_chip *chip,
+ unsigned gpio, int value)
{
- void __iomem *reg;
+ struct omap_gpio_chip *omapgpio =
+ container_of(chip, struct omap_gpio_chip, chip);
+ void __iomem *base = omapgpio->base;
u32 val;
- if (check_gpio(gpio) < 0)
- return -EINVAL;
- reg = get_gpio_base(gpio);
+ omap_gpio_set_value(chip, gpio, value);
- gpio_set_value(gpio, value);
+ base += OMAP_GPIO_OE;
- reg += OMAP_GPIO_OE;
-
- val = __raw_readl(reg);
- val &= ~(1 << get_gpio_index(gpio));
- __raw_writel(val, reg);
+ val = readl(base);
+ val &= ~(1 << omap_get_gpio_index(gpio));
+ writel(val, base);
return 0;
}
-int gpio_get_value(unsigned gpio)
+static int omap_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
+{
+ struct omap_gpio_chip *omapgpio =
+ container_of(chip, struct omap_gpio_chip, chip);
+ void __iomem *base = omapgpio->base;
+
+ base += OMAP_GPIO_DATAIN;
+
+ return (readl(base) & (1 << omap_get_gpio_index(gpio))) != 0;
+
+}
+
+static struct gpio_ops omap_gpio_ops = {
+ .direction_input = omap_gpio_direction_input,
+ .direction_output = omap_gpio_direction_output,
+ .get = omap_gpio_get_value,
+ .set = omap_gpio_set_value,
+};
+
+static int omap_gpio_probe(struct device_d *dev)
{
- void __iomem *reg;
+ struct omap_gpio_chip *omapgpio;
+
+ omapgpio = xzalloc(sizeof(*omapgpio));
+ omapgpio->base = dev_request_mem_region(dev, 0);
+ omapgpio->chip.ops = &omap_gpio_ops;
+ omapgpio->chip.base = -1;
+ omapgpio->chip.ngpio = 32;
+ omapgpio->chip.dev = dev;
+ gpiochip_add(&omapgpio->chip);
- if (check_gpio(gpio) < 0)
- return -EINVAL;
- reg = get_gpio_base(gpio);
+ dev_dbg(dev, "probed gpiochip%d with base %d\n",
+ dev->id, omapgpio->chip.base);
+
+ return 0;
+}
- reg += OMAP_GPIO_DATAIN;
+static struct driver_d omap_gpio_driver = {
+ .name = "omap-gpio",
+ .probe = omap_gpio_probe,
+};
- return (__raw_readl(reg) & (1 << get_gpio_index(gpio))) != 0;
+static int omap_gpio_add(void)
+{
+ register_driver(&omap_gpio_driver);
+ return 0;
}
+coredevice_initcall(omap_gpio_add);
diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c
index 5b4daaf031..ff8b58b772 100644
--- a/arch/arm/mach-omap/gpmc.c
+++ b/arch/arm/mach-omap/gpmc.c
@@ -22,10 +22,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <common.h>
#include <clock.h>
diff --git a/arch/arm/mach-omap/include/mach/clocks.h b/arch/arm/mach-omap/include/mach/clocks.h
index 3efa057931..b2b0c99bec 100644
--- a/arch/arm/mach-omap/include/mach/clocks.h
+++ b/arch/arm/mach-omap/include/mach/clocks.h
@@ -23,10 +23,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __OMAP_CLOCKS_H_
#define __OMAP_CLOCKS_H_
diff --git a/arch/arm/mach-omap/include/mach/control.h b/arch/arm/mach-omap/include/mach/control.h
index 7c1614cc24..18064ba9c5 100644
--- a/arch/arm/mach-omap/include/mach/control.h
+++ b/arch/arm/mach-omap/include/mach/control.h
@@ -26,10 +26,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP_CONTROL_H
diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
index be388d12d1..c1fcc9d9b6 100644
--- a/arch/arm/mach-omap/include/mach/debug_ll.h
+++ b/arch/arm/mach-omap/include/mach/debug_ll.h
@@ -12,9 +12,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with barebox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MACH_DEBUG_LL_H__
diff --git a/arch/arm/mach-omap/include/mach/emac_defs.h b/arch/arm/mach-omap/include/mach/emac_defs.h
new file mode 100644
index 0000000000..568de6a12a
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/emac_defs.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+ *
+ * Based on:
+ *
+ * ----------------------------------------------------------------------------
+ *
+ * dm644x_emac.h
+ *
+ * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM
+ *
+ * Copyright (C) 2005 Texas Instruments.
+ *
+ * ----------------------------------------------------------------------------
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * ----------------------------------------------------------------------------
+
+ * Modifications:
+ * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
+ *
+ */
+
+#ifndef _AM3517_EMAC_H_
+#define _AM3517_EMAC_H_
+
+#define EMAC_BASE_ADDR 0x5C010000
+#define EMAC_WRAPPER_BASE_ADDR 0x5C000000
+#define EMAC_WRAPPER_RAM_ADDR 0x5C020000
+#define EMAC_MDIO_BASE_ADDR 0x5C030000
+#define EMAC_HW_RAM_ADDR 0x01E20000
+
+#define EMAC_MDIO_BUS_FREQ 166000000 /* 166 MHZ check */
+#define EMAC_MDIO_CLOCK_FREQ 1000000 /* 2.0 MHz */
+
+#endif /* _AM3517_EMAC_H_ */
diff --git a/arch/arm/mach-omap/include/mach/gpio.h b/arch/arm/mach-omap/include/mach/gpio.h
index 245f781ede..79bf4485b9 100644
--- a/arch/arm/mach-omap/include/mach/gpio.h
+++ b/arch/arm/mach-omap/include/mach/gpio.h
@@ -12,10 +12,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*
* This work is derived from the linux 2.6.27 kernel source
* To fetch, use the kernel repository
diff --git a/arch/arm/mach-omap/include/mach/gpmc.h b/arch/arm/mach-omap/include/mach/gpmc.h
index ed4e82df7c..95c02dbaac 100644
--- a/arch/arm/mach-omap/include/mach/gpmc.h
+++ b/arch/arm/mach-omap/include/mach/gpmc.h
@@ -32,10 +32,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP_GPMC_H
diff --git a/arch/arm/mach-omap/include/mach/intc.h b/arch/arm/mach-omap/include/mach/intc.h
index 48fcf3d1d6..950f714d1d 100644
--- a/arch/arm/mach-omap/include/mach/intc.h
+++ b/arch/arm/mach-omap/include/mach/intc.h
@@ -26,10 +26,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP_INTC_H
diff --git a/arch/arm/mach-omap/include/mach/omap3-clock.h b/arch/arm/mach-omap/include/mach/omap3-clock.h
index 67f267353d..4f5a1d1bea 100644
--- a/arch/arm/mach-omap/include/mach/omap3-clock.h
+++ b/arch/arm/mach-omap/include/mach/omap3-clock.h
@@ -22,10 +22,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef _OMAP343X_CLOCKS_H_
#define _OMAP343X_CLOCKS_H_
diff --git a/arch/arm/mach-omap/include/mach/omap3-mux.h b/arch/arm/mach-omap/include/mach/omap3-mux.h
index 2badc3f851..133bcf8d34 100644
--- a/arch/arm/mach-omap/include/mach/omap3-mux.h
+++ b/arch/arm/mach-omap/include/mach/omap3-mux.h
@@ -25,10 +25,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef _ASM_ARCH_OMAP3_MUX_H_
#define _ASM_ARCH_OMAP3_MUX_H_
diff --git a/arch/arm/mach-omap/include/mach/omap3-silicon.h b/arch/arm/mach-omap/include/mach/omap3-silicon.h
index e4002e6618..e1a321aa86 100644
--- a/arch/arm/mach-omap/include/mach/omap3-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap3-silicon.h
@@ -30,10 +30,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP3_H
diff --git a/arch/arm/mach-omap/include/mach/omap3-smx.h b/arch/arm/mach-omap/include/mach/omap3-smx.h
index 78cff95f5b..436e9afae2 100644
--- a/arch/arm/mach-omap/include/mach/omap3-smx.h
+++ b/arch/arm/mach-omap/include/mach/omap3-smx.h
@@ -26,9 +26,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP_SMX_H
diff --git a/arch/arm/mach-omap/include/mach/omap4-mux.h b/arch/arm/mach-omap/include/mach/omap4-mux.h
index d06beaa0f1..9ed648613a 100644
--- a/arch/arm/mach-omap/include/mach/omap4-mux.h
+++ b/arch/arm/mach-omap/include/mach/omap4-mux.h
@@ -18,10 +18,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef _MUX_OMAP4_H_
#define _MUX_OMAP4_H_
diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h b/arch/arm/mach-omap/include/mach/omap4-silicon.h
index 4082bac34a..697a497c08 100644
--- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
+++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
@@ -22,10 +22,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef _OMAP4_H_
diff --git a/arch/arm/mach-omap/include/mach/sdrc.h b/arch/arm/mach-omap/include/mach/sdrc.h
index 9d2d2d1107..406dc3210e 100644
--- a/arch/arm/mach-omap/include/mach/sdrc.h
+++ b/arch/arm/mach-omap/include/mach/sdrc.h
@@ -23,10 +23,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*
*/
diff --git a/arch/arm/mach-omap/include/mach/silicon.h b/arch/arm/mach-omap/include/mach/silicon.h
index 638d6c4727..5ee1931b17 100644
--- a/arch/arm/mach-omap/include/mach/silicon.h
+++ b/arch/arm/mach-omap/include/mach/silicon.h
@@ -13,10 +13,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP_SILICON_H
#define __ASM_ARCH_OMAP_SILICON_H
diff --git a/arch/arm/mach-omap/include/mach/sys_info.h b/arch/arm/mach-omap/include/mach/sys_info.h
index f0594bf2b7..5d9b870877 100644
--- a/arch/arm/mach-omap/include/mach/sys_info.h
+++ b/arch/arm/mach-omap/include/mach/sys_info.h
@@ -24,10 +24,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYS_INFO_H_
diff --git a/arch/arm/mach-omap/include/mach/syslib.h b/arch/arm/mach-omap/include/mach/syslib.h
index 1909f172a6..ab88dcf829 100644
--- a/arch/arm/mach-omap/include/mach/syslib.h
+++ b/arch/arm/mach-omap/include/mach/syslib.h
@@ -23,10 +23,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP_SYSLIB_H_
#define __ASM_ARCH_OMAP_SYSLIB_H_
diff --git a/arch/arm/mach-omap/include/mach/timers.h b/arch/arm/mach-omap/include/mach/timers.h
index a93824378c..e8dad9a60a 100644
--- a/arch/arm/mach-omap/include/mach/timers.h
+++ b/arch/arm/mach-omap/include/mach/timers.h
@@ -26,10 +26,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_GPT_H
#define __ASM_ARCH_GPT_H
diff --git a/arch/arm/mach-omap/include/mach/wdt.h b/arch/arm/mach-omap/include/mach/wdt.h
index 532252d080..e359e8b7d3 100644
--- a/arch/arm/mach-omap/include/mach/wdt.h
+++ b/arch/arm/mach-omap/include/mach/wdt.h
@@ -20,10 +20,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_OMAP_WDT_H
#define __ASM_ARCH_OMAP_WDT_H
diff --git a/arch/arm/mach-omap/include/mach/xload.h b/arch/arm/mach-omap/include/mach/xload.h
index 844b57f0e5..63b68df15c 100644
--- a/arch/arm/mach-omap/include/mach/xload.h
+++ b/arch/arm/mach-omap/include/mach/xload.h
@@ -1,13 +1,11 @@
#ifndef _MACH_XLOAD_H
#define _MACH_XLOAD_H
-void *omap_xload_boot_nand(int offset, int size);
-void *omap_xload_boot_mmc(void);
-
enum omap_boot_src {
OMAP_BOOTSRC_UNKNOWN,
OMAP_BOOTSRC_MMC1,
OMAP_BOOTSRC_NAND,
+ OMAP_BOOTSRC_SPI1,
};
enum omap_boot_src omap3_bootsrc(void);
diff --git a/arch/arm/mach-omap/omap3_clock.c b/arch/arm/mach-omap/omap3_clock.c
index 646235e4c2..cfac7bc17f 100644
--- a/arch/arm/mach-omap/omap3_clock.c
+++ b/arch/arm/mach-omap/omap3_clock.c
@@ -32,10 +32,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <common.h>
@@ -674,18 +670,6 @@ static void per_clocks_enable(void)
/* Enable the ICLK for 32K Sync Timer as its used in udelay */
sr32(CM_REG(ICLKEN_WKUP), 2, 1, 0x1);
-#ifdef CONFIG_OMAP_CLOCK_UART
- /* Enable UART1 clocks */
- sr32(CM_REG(FCLKEN1_CORE), 13, 1, 0x1);
- sr32(CM_REG(ICLKEN1_CORE), 13, 1, 0x1);
-#endif
-#ifdef CONFIG_OMAP_CLOCK_I2C
- /* Turn on all 3 I2C clocks */
- sr32(CM_REG(FCLKEN1_CORE), 15, 3, 0x7);
- sr32(CM_REG(ICLKEN1_CORE), 15, 3, 0x7); /* I2C1,2,3 = on */
-#endif
-
-#ifdef CONFIG_OMAP_CLOCK_ALL
#define FCK_IVA2_ON 0x00000001
#define FCK_CORE1_ON 0x03fffe29
#define ICK_CORE1_ON 0x3ffffffb
@@ -710,7 +694,7 @@ static void per_clocks_enable(void)
sr32(CM_REG(ICLKEN_CAM), 0, 32, ICK_CAM_ON);
sr32(CM_REG(FCLKEN_PER), 0, 32, FCK_PER_ON);
sr32(CM_REG(ICLKEN_PER), 0, 32, ICK_PER_ON);
-#endif
+
/* Settle down my friend */
sdelay(1000);
}
diff --git a/arch/arm/mach-omap/omap3_core.S b/arch/arm/mach-omap/omap3_core.S
index ceb3c76ee5..9f574f1ba1 100644
--- a/arch/arm/mach-omap/omap3_core.S
+++ b/arch/arm/mach-omap/omap3_core.S
@@ -29,10 +29,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <config.h>
diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index 4ab265a9ba..5028e9a9e6 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -29,10 +29,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <common.h>
#include <init.h>
@@ -515,3 +511,22 @@ const struct gpmc_config omap3_nand_cfg = {
.base = 0x28000000,
.size = GPMC_SIZE_16M,
};
+
+static int omap3_gpio_init(void)
+{
+ add_generic_device("omap-gpio", 0, NULL, 0x48310000,
+ 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 1, NULL, 0x49050000,
+ 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 2, NULL, 0x49052000,
+ 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 3, NULL, 0x49054000,
+ 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 4, NULL, 0x49056000,
+ 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 5, NULL, 0x49058000,
+ 0x100, IORESOURCE_MEM, NULL);
+
+ return 0;
+}
+coredevice_initcall(omap3_gpio_init);
diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
index 617d786984..a159dfcb7e 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -572,3 +572,22 @@ const struct gpmc_config omap4_nand_cfg = {
.base = 0x28000000,
.size = GPMC_SIZE_16M,
};
+
+static int omap4_gpio_init(void)
+{
+ add_generic_device("omap-gpio", 0, NULL, 0x4a310100,
+ 0x1000, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 1, NULL, 0x48055100,
+ 0x1000, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 2, NULL, 0x48057100,
+ 0x1000, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 3, NULL, 0x48059100,
+ 0x1000, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 4, NULL, 0x4805b100,
+ 0x1000, IORESOURCE_MEM, NULL);
+ add_generic_device("omap-gpio", 5, NULL, 0x4805d100,
+ 0x1000, IORESOURCE_MEM, NULL);
+
+ return 0;
+}
+coredevice_initcall(omap4_gpio_init);
diff --git a/arch/arm/mach-omap/omap4_twl6030_mmc.c b/arch/arm/mach-omap/omap4_twl6030_mmc.c
index 5d87935404..7d71eb868a 100644
--- a/arch/arm/mach-omap/omap4_twl6030_mmc.c
+++ b/arch/arm/mach-omap/omap4_twl6030_mmc.c
@@ -11,10 +11,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <common.h>
diff --git a/arch/arm/mach-omap/s32k_clksource.c b/arch/arm/mach-omap/s32k_clksource.c
index 3ed9448949..6ce0c6410b 100644
--- a/arch/arm/mach-omap/s32k_clksource.c
+++ b/arch/arm/mach-omap/s32k_clksource.c
@@ -24,10 +24,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <common.h>
diff --git a/arch/arm/mach-omap/syslib.c b/arch/arm/mach-omap/syslib.c
index 765a816147..01b5cf2a8a 100644
--- a/arch/arm/mach-omap/syslib.c
+++ b/arch/arm/mach-omap/syslib.c
@@ -24,10 +24,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
*/
#include <config.h>
diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index 13024abac7..9fa8221ec9 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -7,16 +7,65 @@
#include <fcntl.h>
#include <mach/xload.h>
#include <sizes.h>
+#include <filetype.h>
-void *omap_xload_boot_nand(int offset, int size)
+static void *read_image_head(const char *name)
{
+ void *header = xmalloc(ARM_HEAD_SIZE);
+ struct cdev *cdev;
int ret;
- void *to = xmalloc(size);
+
+ cdev = cdev_open(name, O_RDONLY);
+ if (!cdev) {
+ printf("failed to open partition\n");
+ return NULL;
+ }
+
+ ret = cdev_read(cdev, header, ARM_HEAD_SIZE, 0, 0);
+ cdev_close(cdev);
+
+ if (ret != ARM_HEAD_SIZE) {
+ printf("failed to read from partition\n");
+ return NULL;
+ }
+
+ return header;
+}
+
+static unsigned int get_image_size(void *head)
+{
+ unsigned int ret = 0;
+ unsigned int *psize = head + ARM_HEAD_SIZE_OFFSET;
+
+ if (is_barebox_arm_head(head))
+ ret = *psize;
+ debug("Detected barebox image size %u\n", ret);
+
+ return ret;
+}
+
+static void *omap_xload_boot_nand(int offset)
+{
+ int ret;
+ int size;
+ void *to, *header;
struct cdev *cdev;
- devfs_add_partition("nand0", offset, size, DEVFS_PARTITION_FIXED, "x");
+ devfs_add_partition("nand0", offset, SZ_1M, DEVFS_PARTITION_FIXED, "x");
dev_add_bb_dev("x", "bbx");
+ header = read_image_head("bbx");
+ if (header == NULL)
+ return NULL;
+
+ size = get_image_size(header);
+ if (!size) {
+ printf("failed to get image size\n");
+ return NULL;
+ }
+
+ to = xmalloc(size);
+
cdev = cdev_open("bbx", O_RDONLY);
if (!cdev) {
printf("failed to open nand\n");
@@ -32,7 +81,7 @@ void *omap_xload_boot_nand(int offset, int size)
return to;
}
-void *omap_xload_boot_mmc(void)
+static void *omap_xload_boot_mmc(void)
{
int ret;
void *buf;
@@ -54,6 +103,42 @@ void *omap_xload_boot_mmc(void)
return buf;
}
+static void *omap_xload_boot_spi(int offset)
+{
+ int ret;
+ int size;
+ void *to, *header;
+ struct cdev *cdev;
+
+ devfs_add_partition("m25p0", offset, SZ_1M, DEVFS_PARTITION_FIXED, "x");
+
+ header = read_image_head("x");
+ if (header == NULL)
+ return NULL;
+
+ size = get_image_size(header);
+ if (!size) {
+ printf("failed to get image size\n");
+ return NULL;
+ }
+
+ to = xmalloc(size);
+
+ cdev = cdev_open("x", O_RDONLY);
+ if (!cdev) {
+ printf("failed to open spi flash\n");
+ return NULL;
+ }
+
+ ret = cdev_read(cdev, to, size, 0, 0);
+ if (ret != size) {
+ printf("failed to read from spi flash\n");
+ return NULL;
+ }
+
+ return to;
+}
+
enum omap_boot_src omap_bootsrc(void)
{
#if defined(CONFIG_ARCH_OMAP3)
@@ -80,7 +165,11 @@ int run_shell(void)
printf("unknown boot source. Fall back to nand\n");
case OMAP_BOOTSRC_NAND:
printf("booting from NAND\n");
- func = omap_xload_boot_nand(SZ_128K, SZ_256K);
+ func = omap_xload_boot_nand(SZ_128K);
+ break;
+ case OMAP_BOOTSRC_SPI1:
+ printf("booting from SPI1\n");
+ func = omap_xload_boot_spi(SZ_128K);
break;
}