[U-Boot] [PATCH v2 2/2] add Eukrea's CPUIMX25
Vikram Narayanan
vikram186 at gmail.com
Sun Sep 23 19:32:18 CEST 2012
On 9/23/2012 5:33 PM, Eric Bénard wrote:
> this board is based on an i.MX25 from Freescale.
> It consists of a SOM containing :
> - NAND flash (internal or external boot supported and tested)
> - mDDR (64MB tested)
> - ethernet PHY connected in RMII mode (tested)
> and a baseboard containing :
> - a serial transceiver on UART1 (tested)
> - a SDCard connector on eSDHC1 (tested but disabled until Benoît's fix
> gets applied)
>
> bootlog :
> U-Boot 2012.10-rc1-00003-gdd12be5 (Sep 23 2012 - 13:53:21)
>
> CPU: Freescale i.MX25 rev1.2 at 399 MHz
> Reset cause: POR
>
> DRAM: 64 MiB
> NAND: 256 MiB
> MMC:
> In: serial
> Out: serial
> Err: serial
> Net: FEC
> Hit any key to stop autoboot: 0
>
> Signed-off-by: Eric Bénard<eric at eukrea.com>
> ---
> v2: rebased against 2012.10-rc1, disabled eSDHC until proper fix
> from Benoît gets applied, updated bootlog.
>
> MAINTAINERS | 2 +
> board/eukrea/cpuimx25/Makefile | 44 +++++++
> board/eukrea/cpuimx25/config.mk | 5 +
> board/eukrea/cpuimx25/cpuimx25.c | 123 ++++++++++++++++++
> board/eukrea/cpuimx25/imximage.cfg | 55 ++++++++
> board/eukrea/cpuimx25/lowlevel_init.S | 113 ++++++++++++++++
> boards.cfg | 2 +
> include/configs/cpuimx25.h | 198 +++++++++++++++++++++++++++++
> nand_spl/board/eukrea/cpuimx25/Makefile | 79 ++++++++++++
> nand_spl/board/eukrea/cpuimx25/config.mk | 1 +
> nand_spl/board/eukrea/cpuimx25/u-boot.lds | 83 ++++++++++++
> 11 files changed, 705 insertions(+), 0 deletions(-)
> create mode 100644 board/eukrea/cpuimx25/Makefile
> create mode 100644 board/eukrea/cpuimx25/config.mk
> create mode 100644 board/eukrea/cpuimx25/cpuimx25.c
> create mode 100644 board/eukrea/cpuimx25/imximage.cfg
> create mode 100644 board/eukrea/cpuimx25/lowlevel_init.S
> create mode 100644 include/configs/cpuimx25.h
> create mode 100644 nand_spl/board/eukrea/cpuimx25/Makefile
> create mode 100644 nand_spl/board/eukrea/cpuimx25/config.mk
> create mode 100644 nand_spl/board/eukrea/cpuimx25/u-boot.lds
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index aa54fe1..94e759f 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -606,6 +606,8 @@ Eric Benard<eric at eukrea.com>
> cpuat91 ARM920T
> cpu9260 ARM926EJS (AT91SAM9260 SoC)
> cpu9G20 ARM926EJS (AT91SAM9G20 SoC)
> + cpuimx25 i.MX25
> + cpuimx25nand i.MX25
>
> Ajay Bhargav<ajay.bhargav at einfochips.com>
>
> diff --git a/board/eukrea/cpuimx25/Makefile b/board/eukrea/cpuimx25/Makefile
> new file mode 100644
> index 0000000..46131fd
> --- /dev/null
> +++ b/board/eukrea/cpuimx25/Makefile
> @@ -0,0 +1,44 @@
> +#
> +# (C) Copyright 2009 DENX Software Engineering
> +# Author: John Rigby<jcrigby at gmail.com>
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# 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 $(TOPDIR)/config.mk
> +
> +LIB = $(obj)lib$(BOARD).o
> +
> +COBJS := cpuimx25.o
> +SOBJS := lowlevel_init.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS))
> +SOBJS := $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB): $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#########################################################################
> +
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/eukrea/cpuimx25/config.mk b/board/eukrea/cpuimx25/config.mk
> new file mode 100644
> index 0000000..18b2883
> --- /dev/null
> +++ b/board/eukrea/cpuimx25/config.mk
> @@ -0,0 +1,5 @@
> +ifdef CONFIG_NAND_SPL
> +CONFIG_SYS_TEXT_BASE = 0x810c0000
> +else
> +CONFIG_SYS_TEXT_BASE = 0x81200000
> +endif
> diff --git a/board/eukrea/cpuimx25/cpuimx25.c b/board/eukrea/cpuimx25/cpuimx25.c
> new file mode 100644
> index 0000000..72fa8a5
> --- /dev/null
> +++ b/board/eukrea/cpuimx25/cpuimx25.c
> @@ -0,0 +1,123 @@
> +/*
> + * (C) Copyright 2009 DENX Software Engineering
> + * (C) Copyright 2012 Eukrea Electromatique<www.eukrea.com>
> + * Eric Benard<eric at eukrea.com>
> + *
> + * Based on tx25.c:
> + * Author: John Rigby<jrigby at gmail.com>
> + *
> + * Based on imx27lite.c:
> + * Copyright (C) 2008,2009 Eric Jarrige<jorasse at users.sourceforge.net>
> + * Copyright (C) 2009 Ilya Yanok<yanok at emcraft.com>
> + * And:
> + * RedBoot tx25_misc.c Copyright (C) 2009 Red Hat
> + *
> + * 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/io.h>
> +#include<asm/arch/imx-regs.h>
> +#include<asm/arch/imx25-pinmux.h>
> +#include<asm/gpio.h>
> +#include<asm/arch/sys_proto.h>
> +#include<mmc.h>
> +#include<fsl_esdhc.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#ifdef CONFIG_FSL_ESDHC
> +struct fsl_esdhc_cfg esdhc_cfg[1] = {
> + {IMX_MMC_SDHC1_BASE},
> +};
> +#endif
> +
> +int board_init()
> +{
> +#ifdef CONFIG_MXC_UART
> + mx25_uart1_init_pins();
> +#endif
> + /* board id for linux */
> + gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
> + return 0;
> +}
> +
> +int board_late_init(void)
> +{
> +#ifdef CONFIG_FEC_MXC
> + mx25_fec_init_pins();
> +#endif
> + return 0;
> +}
> +
> +int dram_init(void)
> +{
> + /* dram_init must store complete ramsize in gd->ram_size */
> + gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1,
> + PHYS_SDRAM_1_SIZE);
> + return 0;
> +}
> +
> +void dram_init_banksize(void)
> +{
> + gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> + gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1,
> + PHYS_SDRAM_1_SIZE);
> +}
> +
> +int checkboard(void)
> +{
> + printf("Eukrea Electromatique CPUIMX25\n");
> + return 0;
> +}
> +
> +#ifdef CONFIG_FSL_ESDHC
> +int board_mmc_getcd(struct mmc *mmc)
> +{
> + struct iomuxc_mux_ctl *muxctl;
> + struct iomuxc_pad_ctl *padctl;
> + struct gpio_regs *gpio2 = (struct gpio_regs *)IMX_GPIO2_BASE;
> + u32 val;
> +
> + muxctl = (struct iomuxc_mux_ctl *)IMX_IOPADMUX_BASE;
> + padctl = (struct iomuxc_pad_ctl *)IMX_IOPADCTL_BASE;
> +
> + writel(MX25_PIN_MUX_MODE(5),&muxctl->pad_de_b);
> +
> + writel(0x0,&padctl->pad_de_b);
> +
> + val = readl(&gpio2->gpio_dir)& ~(1<< 20);
> + writel(val,&gpio2->gpio_dir);
> + val = readl(&gpio2->gpio_dr)& (1<< 20);
> + return val ? 0 : 1;
> +
> +}
> +
> +int board_mmc_init(bd_t *bis)
> +{
> + struct iomuxc_mux_ctl *muxctl;
> + struct iomuxc_pad_ctl *padctl;
> + u32 sdhc1_mux_mode = MX25_PIN_MUX_MODE(0) | MX25_PIN_MUX_SION;
> + muxctl = (struct iomuxc_mux_ctl *)IMX_IOPADMUX_BASE;
> + writel(sdhc1_mux_mode,&muxctl->pad_sd1_cmd);
> + writel(sdhc1_mux_mode,&muxctl->pad_sd1_clk);
> + writel(sdhc1_mux_mode,&muxctl->pad_sd1_data0);
> + writel(sdhc1_mux_mode,&muxctl->pad_sd1_data1);
> + writel(sdhc1_mux_mode,&muxctl->pad_sd1_data2);
> + writel(sdhc1_mux_mode,&muxctl->pad_sd1_data3);
> + return fsl_esdhc_initialize(bis,&esdhc_cfg[0]);
> +}
> +#endif
> diff --git a/board/eukrea/cpuimx25/imximage.cfg b/board/eukrea/cpuimx25/imximage.cfg
> new file mode 100644
> index 0000000..c0b7b20
> --- /dev/null
> +++ b/board/eukrea/cpuimx25/imximage.cfg
> @@ -0,0 +1,55 @@
> +#
> +# (C) Copyright 2009
> +# Stefano Babic DENX Software Engineering sbabic at denx.de.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# 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.
> +#
> +# Refer docs/README.imxmage for more details about how-to configure
> +# and create imximage boot image
> +#
> +# The syntax is taken as close as possible with the kwbimage
> +
> +# Boot Device : one of
> +# nand, sd, spi
> +
> +BOOT_FROM nand
> +
> +# Device Configuration Data (DCD)
> +#
> +# Each entry must have the format:
> +# Addr-type Address Value
> +#
> +# where:
> +# Addr-type register length (1,2 or 4 bytes)
> +# Address absolute address of the register
> +# value value to be stored in the register
> +
> +# MDDR init
> +DATA 4 0xb8001010 0x00000004
> +DATA 4 0xb8001000 0x92100000
> +DATA 1 0x80000400 0x12344321
> +DATA 4 0xb8001000 0xa2100000
> +DATA 4 0x80000000 0x12344321
> +DATA 4 0x80000000 0x12344321
> +DATA 4 0xb8001000 0xb2100000
> +DATA 1 0x80000033 0xda
> +DATA 1 0x81000000 0xff
> +DATA 4 0xb8001000 0x82216080
> +DATA 4 0xb8001004 0x00295729
> +DATA 4 0x53f80008 0x20034000
> +
> +# Enable the clocks
> +DATA 4 0x53f8000c 0x1fffffff
> +DATA 4 0x53f80010 0xffffffff
> +DATA 4 0x53f80014 0xfdfff
> diff --git a/board/eukrea/cpuimx25/lowlevel_init.S b/board/eukrea/cpuimx25/lowlevel_init.S
> new file mode 100644
> index 0000000..76e4e6f
> --- /dev/null
> +++ b/board/eukrea/cpuimx25/lowlevel_init.S
> @@ -0,0 +1,113 @@
> +/*
> + * (C) Copyright 2009 DENX Software Engineering
> + * (C) Copyright 2012 Eukrea Electromatique<www.eukrea.com>
> + * Eric Benard<eric at eukrea.com>
> + *
> + * Based on tx25 and zmx25:
> + * Author: John Rigby<jrigby at gmail.com>
> + *
> + * Based on U-Boot and RedBoot sources for several different i.mx
> + * platforms.
> + *
> + * 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<asm/macro.h>
> +#include<asm/arch/macro.h>
> +#include<asm/arch/imx-regs.h>
> +#include<generated/asm-offsets.h>
> +
> +.macro init_m3if
> + write32 0xb8003000, 0x1
> +.endm
> +
> +.macro init_clocks
> + write32 0x53f80064, 0x00000000
> + write32 0x53f80008, 0x20034000
> +
> + /*
> + * enable all implemented clocks in all three
> + * clock control registers
> + */
> + write32 0x53f8000c, 0x1fffffff
> + write32 0x53f80010, 0xffffffff
> + write32 0x53f80014, 0xfdfff
> +.endm
Why the clock init is in two places?
imximage.cfg and this file. Am I missing something?
~Vikram
More information about the U-Boot
mailing list