diff options
author | Juergen Beisert <jbe@isonoe.(none)> | 2007-10-17 17:57:55 +0200 |
---|---|---|
committer | Juergen Beisert <jbe@isonoe.(none)> | 2007-10-17 17:57:55 +0200 |
commit | 3be8ed2fa1d4813bf11985083850ec7fa47236ed (patch) | |
tree | 12a67fbeaeedc95f02e1c110bb08a396d1a870bb /arch/arm | |
parent | 60f8ee6f3f220383c2bc29ee0316530666c43769 (diff) | |
download | barebox-3be8ed2fa1d4813bf11985083850ec7fa47236ed.tar.gz barebox-3be8ed2fa1d4813bf11985083850ec7fa47236ed.tar.xz |
adding i.MX31 CPU support
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 19 | ||||
-rw-r--r-- | arch/arm/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/cpu/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/cpu/start-arm920t.S | 32 | ||||
-rw-r--r-- | arch/arm/mach-imx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/speed-imx31.c | 63 |
6 files changed, 103 insertions, 17 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5392322691..8ac34116a9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -6,6 +6,7 @@ config ARCH_TEXT_BASE default 0x81f00000 if MACH_NXDB500 default 0x21e00000 if MACH_ECO920 default 0xa0000000 if MACH_PCM038 + default 0x87f00000 if MACH_IMX31 config BOARDINFO default "Synertronixx scb9328" if MACH_SCB9328 @@ -16,6 +17,9 @@ config BOARDINFO config BOARDINFO default "Phytec Phycore MX27" if MACH_PCM038 +config BOARDINFO + default "Phytec Phycore i.MX31" if MACH_IMX31 + config ARM bool select HAS_KALLSYMS @@ -28,7 +32,7 @@ config ARM920T config ARM926EJS bool -# i.MX1 i.MXL and i.MX27 are quite similar and thus +# i.MX1, i.MXL, i.MX27 and i.MX31 are quite similar and thus # handled in one arch config ARCH_IMX bool @@ -43,6 +47,10 @@ config ARCH_IMX27 select ARCH_IMX select ARM926EJS +config ARCH_IMX31 + bool + select ARCH_IMX + config ARCH_AT91RM9200 bool select ARM920T @@ -92,7 +100,14 @@ config MACH_NXDB500 select ARCH_NETX help Say Y here if you are using the Hilscher Netx nxdb500 board - + +config MACH_IMX31 + bool "Phytec i.MX31" + select ARCH_IMX31 + help + Say Y here if your are using Phytec's pcm-mx31 equipped + with a Freescale i.MX31 Processor + endchoice source arch/arm/mach-netx/Kconfig diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f838d3743d..4e3a351de4 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -12,6 +12,8 @@ board-$(CONFIG_MACH_ECO920) := eco920 board-$(CONFIG_MACH_SCB9328) := scb9328 board-$(CONFIG_MACH_PCM038) := phycore_pcm038 board-$(CONFIG_MACH_NXDB500) := netx +board-$(CONFIG_MACH_IMX31) := phycore_imx31 +# FIXME "cpu-y" never used on ARM! cpu-$(CONFIG_ARM920T) := arm920t cpu-$(CONFIG_ARM926EJS) := arm926ejs @@ -68,7 +70,7 @@ else BOARD := endif -ifneq ($(cpu-y),) +ifneq ($(machine-y),) MACH := arch/arm/mach-$(machine-y)/ else MACH := diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile index 27fa6ca0b5..0daad49231 100644 --- a/arch/arm/cpu/Makefile +++ b/arch/arm/cpu/Makefile @@ -8,3 +8,4 @@ obj-y += interrupts.o # obj-$(CONFIG_ARM920T) += start-arm920t.o obj-$(CONFIG_ARM926EJS) += start-arm920t.o +obj-$(CONFIG_ARCH_IMX31) += start-arm920t.o
\ No newline at end of file diff --git a/arch/arm/cpu/start-arm920t.S b/arch/arm/cpu/start-arm920t.S index 9627427952..eed1364e3a 100644 --- a/arch/arm/cpu/start-arm920t.S +++ b/arch/arm/cpu/start-arm920t.S @@ -1,8 +1,8 @@ /* * armboot - Startup Code for ARM920 CPU-core * - * Copyright (c) 2001 Marius Gröger <mag@sysgo.de> - * Copyright (c) 2002 Alex Züpke <azu@sysgo.de> + * Copyright (c) 2001 Marius Gr�ger <mag@sysgo.de> + * Copyright (c) 2002 Alex Z�pke <azu@sysgo.de> * Copyright (c) 2002 Gary Jennejohn <gj@denx.de> * * See file CREDITS for list of people who contributed to this @@ -24,17 +24,21 @@ * MA 02111-1307 USA */ +/* + * Note: + * This file can be used for at least: + * - ARM920T + * - i.MX1 + * - i.MX27 + * - i.MX31 + */ .section ".text_entry","ax" #include <config.h> -/* - ************************************************************************* - * +/************************************************************************* * Jump vector table as in table 3.1 in [1] - * - ************************************************************************* - */ + *************************************************************************/ .globl _start _start: @@ -77,6 +81,10 @@ _TEXT_BASE: _u_boot_start: .word _start +/************************************************************************* + * FIXME + *************************************************************************/ + _MALLOC_START: .word _start - CFG_MALLOC_LEN @@ -106,11 +114,9 @@ FIQ_STACK_START: .word 0x0badc0de #endif - -/* +/************************************************************************* * the actual reset code - */ - + *************************************************************************/ reset: /* * set the cpu to SVC32 mode @@ -121,10 +127,8 @@ reset: msr cpsr,r0 #ifdef ARCH_HAS_INIT_LOWLEVEL - /* Samsung S3C24x0 needs some stuff here */ bl arch_init_lowlevel #endif - /* * flush v4 I/D caches */ diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index a545a07be9..405c757ce1 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -1,6 +1,7 @@ obj-y += clocksource.o obj-$(CONFIG_ARCH_IMX1) += speed-imx1.o obj-$(CONFIG_ARCH_IMX27) += speed-imx27.o +obj-$(CONFIG_ARCH_IMX31) += speed-imx31.o obj-y += speed.o obj-y += gpio.o diff --git a/arch/arm/mach-imx/speed-imx31.c b/arch/arm/mach-imx/speed-imx31.c new file mode 100644 index 0000000000..ae39392730 --- /dev/null +++ b/arch/arm/mach-imx/speed-imx31.c @@ -0,0 +1,63 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/clock.h> +#include <init.h> + +ulong imx_get_mpl_dpdgck_clk(void) +{ + ulong infreq; + + if ((__REG(CCM_CCMR) & CCMR_PRCS_MASK) == CCMR_FPM) + infreq = CONFIG_MX31_CLK32 * 1024; + else + infreq = CONFIG_MX31_HCLK_FREQ; + + return imx_decode_pll(__REG(CCM_MPCTL), infreq); +} + +ulong imx_get_mcu_main_clk(void) +{ + /* For now we assume mpl_dpdgck_clk == mcu_main_clk + * which should be correct for most boards + */ + return imx_get_mpl_dpdgck_clk(); +} + +ulong imx_get_perclk1(void) +{ + u32 freq = imx_get_mcu_main_clk(); + u32 pdr0 = __REG(CCM_PDR0); + + freq /= ((pdr0 >> 3) & 0x7) + 1; + freq /= ((pdr0 >> 6) & 0x3) + 1; + + return freq; +} + +int imx_dump_clocks(void) +{ + ulong cpufreq = imx_get_mcu_main_clk(); + printf("mx31 cpu clock: %dMHz\n",cpufreq / 1000000); + printf("ipg clock : %dHz\n", imx_get_perclk1()); + + return 0; +} + +late_initcall(imx_dump_clocks); |