Support for the DENX M28 SoM
Subsystems (12)
v2 cover Support for the DENX M28 SoM
This series adds support for DENX M28 SoM and M28EVK kit.
This series depends on previous series:
* Support for both FEC interfaces on i.MX28
* Random NAND fixes and improvements
* SPL modifications
V2: * Convert to SPL framework
* Squash patches together
* Fix pointed out issues
Marek Vasut (15):
iMX28: Initial support for iMX28 CPU
iMX28: Add SSP MMC driver
FEC: Add support for iMX28 quirks
iMX28: Add PINMUX control
iMX28: Add I2C bus driver
iMX28: Add GPIO control
iMX28: Add SPI driver
iMX28: Add APBH DMA driver
iMX28: Add GPMI NAND driver
iMX28: Add driver for internal RTC
iMX28: Add image header generator tool
iMX28: Add u-boot.sb target to Makefile
iMX28: Add support for DENX M28EVK board
M28: Add MMC SPL
M28: Add doc/README.m28 documentation
MAINTAINERS | 1 + Makefile | 5 + arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/iomux.c | 109 +++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 200 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/dma.h | 170 ++++ arch/arm/include/asm/arch-mx28/gpio.h | 32 + arch/arm/include/asm/arch-mx28/imx-regs.h | 39 + arch/arm/include/asm/arch-mx28/iomux-mx28.h | 537 +++++++++++ arch/arm/include/asm/arch-mx28/iomux.h | 168 ++++ arch/arm/include/asm/arch-mx28/regs-apbh.h | 466 +++++++++ arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 32 + board/denx/m28evk/Makefile | 57 ++ board/denx/m28evk/m28_init.h | 36 + board/denx/m28evk/m28evk.c | 195 ++++ board/denx/m28evk/mem_init.c | 213 ++++ board/denx/m28evk/mmc_boot.c | 273 ++++++ board/denx/m28evk/power_init.c | 911 ++++++++++++++++++ board/denx/m28evk/start.S | 396 ++++++++ board/denx/m28evk/u-boot-spl.lds | 87 ++ board/denx/m28evk/u-boot.bd | 14 + boards.cfg | 1 + doc/README.m28 | 223 +++++ drivers/dma/Makefile | 1 + drivers/dma/apbh_dma.c | 691 +++++++++++++ drivers/gpio/Makefile | 1 + drivers/gpio/mxs_gpio.c | 136 +++ drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 240 +++++ drivers/mmc/Makefile | 1 + drivers/mmc/mxsmmc.c | 351 +++++++ drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1159 ++++++++++++++++++++++ drivers/net/fec_mxc.c | 44 +- drivers/rtc/Makefile | 1 + drivers/rtc/mxsrtc.c | 86 ++ drivers/spi/Makefile | 1 + drivers/spi/mxs_spi.c | 172 ++++ include/configs/m28evk.h | 289 ++++++ tools/Makefile | 6 + tools/mxsboot.c | 687 +++++++++++++ 56 files changed, 12296 insertions(+), 2 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/iomux.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/dma.h create mode 100644 arch/arm/include/asm/arch-mx28/gpio.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/iomux-mx28.h create mode 100644 arch/arm/include/asm/arch-mx28/iomux.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-apbh.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28_init.h create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 board/denx/m28evk/mem_init.c create mode 100644 board/denx/m28evk/mmc_boot.c create mode 100644 board/denx/m28evk/power_init.c create mode 100644 board/denx/m28evk/start.S create mode 100644 board/denx/m28evk/u-boot-spl.lds create mode 100644 board/denx/m28evk/u-boot.bd create mode 100644 doc/README.m28 create mode 100644 drivers/dma/apbh_dma.c create mode 100644 drivers/gpio/mxs_gpio.c create mode 100644 drivers/i2c/mxs_i2c.c create mode 100644 drivers/mmc/mxsmmc.c create mode 100644 drivers/mtd/nand/mxs_nand.c create mode 100644 drivers/rtc/mxsrtc.c create mode 100644 drivers/spi/mxs_spi.c create mode 100644 include/configs/m28evk.h create mode 100644 tools/mxsboot.c
Signature · 1 line
1.7.5.4
PATCH v2 1/15 iMX28: Initial support for iMX28 CPU
This patch supports:
- Timers
- Debug UART
- Clock
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 194 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4527 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h
arch/arm/cpu/arm926ejs/mx28/Makefile new file +46 -0
@@ -0,0 +1,46 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd 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. +# +# 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$(SOC).o + +COBJS = clock.o mx28.o timer.o + +SRCS := $(START:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/arm/cpu/arm926ejs/mx28/clock.c new file +355 -0
355 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +194 -0
194 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/timer.c new file +141 -0
141 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/clock.h new file +61 -0
61 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/imx-regs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Freescale i.MX28 Registers +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __IMX_REGS_H__ +#define __IMX_REGS_H__ + +#include <asm/arch/regs-base.h> +#include <asm/arch/regs-bch.h> +#include <asm/arch/regs-clkctrl.h> +#include <asm/arch/regs-gpmi.h> +#include <asm/arch/regs-i2c.h> +#include <asm/arch/regs-ocotp.h> +#include <asm/arch/regs-pinctrl.h> +#include <asm/arch/regs-power.h> +#include <asm/arch/regs-rtc.h> +#include <asm/arch/regs-ssp.h> +#include <asm/arch/regs-timrot.h> + +#endif /* __IMX_REGS_H__ */
arch/arm/include/asm/arch-mx28/regs-base.h new file +88 -0
88 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-bch.h new file +230 -0
230 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-clkctrl.h new file +312 -0
312 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-common.h new file +66 -0
66 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-gpmi.h new file +222 -0
222 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-i2c.h new file +207 -0
207 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ocotp.h new file +173 -0
173 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-pinctrl.h new file +1284 -0
867 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-power.h new file +413 -0
413 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-rtc.h new file +147 -0
147 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ssp.h new file +349 -0
349 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-timrot.h new file +171 -0
171 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/sys_proto.h new file +30 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.5.4
Part of the diff is not shown here. View the raw message.
PATCH 1/15 iMX28: Initial support for iMX28 CPU
Quoted 10 lines · Marek Vasut
This patch supports:
- Timers
- Debug UART
- ClockSigned-off-by Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>---
Hi Marek,
it seems ok to me.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH v2 1/15 iMX28: Initial support for iMX28 CPU
In reply to Marek VasutThis patch supports:
- Timers
- Debug UART
- Clock
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 196 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4529 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h
V2: Use watchdog for reset
arch/arm/cpu/arm926ejs/mx28/Makefile new file +46 -0
@@ -0,0 +1,46 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd 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. +# +# 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$(SOC).o + +COBJS = clock.o mx28.o timer.o + +SRCS := $(START:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/arm/cpu/arm926ejs/mx28/clock.c new file +355 -0
355 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +196 -0
196 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/timer.c new file +141 -0
141 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/clock.h new file +61 -0
61 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/imx-regs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Freescale i.MX28 Registers +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __IMX_REGS_H__ +#define __IMX_REGS_H__ + +#include <asm/arch/regs-base.h> +#include <asm/arch/regs-bch.h> +#include <asm/arch/regs-clkctrl.h> +#include <asm/arch/regs-gpmi.h> +#include <asm/arch/regs-i2c.h> +#include <asm/arch/regs-ocotp.h> +#include <asm/arch/regs-pinctrl.h> +#include <asm/arch/regs-power.h> +#include <asm/arch/regs-rtc.h> +#include <asm/arch/regs-ssp.h> +#include <asm/arch/regs-timrot.h> + +#endif /* __IMX_REGS_H__ */
arch/arm/include/asm/arch-mx28/regs-base.h new file +88 -0
88 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-bch.h new file +230 -0
230 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-clkctrl.h new file +312 -0
312 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-common.h new file +66 -0
66 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-gpmi.h new file +222 -0
222 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-i2c.h new file +207 -0
207 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ocotp.h new file +173 -0
173 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-pinctrl.h new file +1284 -0
865 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-power.h new file +413 -0
413 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-rtc.h new file +147 -0
147 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ssp.h new file +349 -0
349 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-timrot.h new file +171 -0
171 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/sys_proto.h new file +30 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.5.4
Part of the diff is not shown here. View the raw message.
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
This patch supports:
- Timers
- Debug UART
- Clock
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 194 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4527 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h
V2: Use watchdog for reset
V3: Remove redundant power_regs from cpu_reset() (gcc4.6)
arch/arm/cpu/arm926ejs/mx28/Makefile new file +46 -0
@@ -0,0 +1,46 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd 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. +# +# 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$(SOC).o + +COBJS = clock.o mx28.o timer.o + +SRCS := $(START:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/arm/cpu/arm926ejs/mx28/clock.c new file +355 -0
355 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +194 -0
194 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/timer.c new file +141 -0
141 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/clock.h new file +61 -0
61 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/imx-regs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Freescale i.MX28 Registers +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __IMX_REGS_H__ +#define __IMX_REGS_H__ + +#include <asm/arch/regs-base.h> +#include <asm/arch/regs-bch.h> +#include <asm/arch/regs-clkctrl.h> +#include <asm/arch/regs-gpmi.h> +#include <asm/arch/regs-i2c.h> +#include <asm/arch/regs-ocotp.h> +#include <asm/arch/regs-pinctrl.h> +#include <asm/arch/regs-power.h> +#include <asm/arch/regs-rtc.h> +#include <asm/arch/regs-ssp.h> +#include <asm/arch/regs-timrot.h> + +#endif /* __IMX_REGS_H__ */
arch/arm/include/asm/arch-mx28/regs-base.h new file +88 -0
88 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-bch.h new file +230 -0
230 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-clkctrl.h new file +312 -0
312 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-common.h new file +66 -0
66 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-gpmi.h new file +222 -0
222 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-i2c.h new file +207 -0
207 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ocotp.h new file +173 -0
173 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-pinctrl.h new file +1284 -0
867 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-power.h new file +413 -0
413 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-rtc.h new file +147 -0
147 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ssp.h new file +349 -0
349 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-timrot.h new file +171 -0
171 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/sys_proto.h new file +30 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.5.4
Part of the diff is not shown here. View the raw message.
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
Quoted 4 lines · Marek Vasut
This patch supports:
- Timers
- Debug UART
- Clock
Hi Marek,
/opt/tools/bin/checkpatch.pl --no-tree ~/Desktop/U-Boot-01-15-V3-iMX28-Initial-support-for-iMX28-CPU.patch
WARNING: line over 80 characters
#634: FILE: arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
+int do_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
total: 0 errors, 1 warnings, 4527 lines checked
Can you fix and resubmit ?
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
Quoted 15 lines · Stefano Babic
Quoted 4 lines · Marek Vasut
This patch supports:
- Timers
- Debug UART
- ClockHi Marek,
/opt/tools/bin/checkpatch.pl--no-tree~/Desktop/U-Boot-01-15-V3-iMX28-Initial-support-for-iMX28-CPU.patch
WARNING: line over 80 characters
#634: FILE:arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
+intdo_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Quoted 5 lines
total: 0 errors, 1 warnings, 4527 lines checked
Can you fix and resubmit ?
Stefano
Hi Stefano,
the patch is big and will need approval to be let into ML. Removing the space in char * const argv[] shall do the trick, can you please do that by hand ?
Cheers
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
Dear Marek Vasut,
Quoted 3 lines · In message <[email protected]> you wrote:
the patch is big and will need approval to be let into ML. Removing the space in char * const argv[] shall do the trick, can you please do that by hand ?
It will do the trick and trigger a new checkpatch warning?
Please fix yourself, test, and resubmit.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Some people march to the beat of a different drummer. And some people tango!
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
In reply to Marek VasutQuoted 5 lines · Marek Vasut
Hi Stefano,
the patch is big and will need approval to be let into ML. Removing the space in char * const argv[] shall do the trick, can you please do that by hand ?
I have absolutely no intention to push patches without beeing reviewed by ML, but I would like to prepare a branch with all your M28 patches to check consistency with the rest of code.
Running checkpatch on your patches I see a lot of issues, and not only a couple of them.
For example,
WARNING: line over 80 characters
#632: FILE: arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
+int do_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
WARNING: line over 80 characters
#5415: FILE: arch/arm/include/asm/arch-mx28/iomux-mx28.h:23:
+ *
BANK PIN MUX
WARNING: line over 80 characters
#5418: FILE: arch/arm/include/asm/arch-mx28/iomux-mx28.h:26:
+#define MX28_PAD_GPMI_D00__GPMI_D0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0)
Running checkpatch on all your patches I get 488 warnings. Can you check and fix them ?
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
Quoted 31 lines · Stefano Babic
Quoted 5 lines · Marek Vasut
Hi Stefano,
the patch is big and will need approval to be let into ML. Removing the space in char * const argv[] shall do the trick, can you please do that by hand ?
I have absolutely no intention to push patches without beeing reviewed by ML, but I would like to prepare a branch with all your M28 patches to check consistency with the rest of code.
Running checkpatch on your patches I see a lot of issues, and not only a couple of them.
For example,
WARNING: line over 80 characters
#632: FILE:arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
+intdo_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])WARNING: line over 80 characters
#5415: FILE:arch/arm/include/asm/arch-mx28/iomux-mx28.h:23:
+ *
BANK PIN MUXWARNING: line over 80 characters
#5418: FILE:arch/arm/include/asm/arch-mx28/iomux-mx28.h:26:
+#defineMX28_PAD_GPMI_D00__GPMI_D0MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0)
Quoted 4 lines
Running checkpatch on all your patches I get 488 warnings. Can you check and fix them ?
Stefano
Stefano,
those iomux-mx28.h issues were already explained. It's a file taken from linux kernel with no modifications, that's why the issues. And if you take a look inside, fixing it would make it unreadable.
Cheers
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
Dear Marek Vasut,
Quoted 13 lines · In message <[email protected]> you wrote:
Quoted 10 lines
Running checkpatch on your patches I see a lot of issues, and not only a couple of them.
For example,
WARNING: line over 80 characters
#632: FILE:arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
+intdo_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Quoted 3 lines
those
iomux-mx28.hissues were already explained. It's a file taken from linux kernel with no modifications, that's why the issues. And if you take a look inside, fixing it would make it unreadable.
The error above appears to be unrelated. Why did you not fix at least these?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Where people stand is not as important as which way they face.
- Terry Pratchett & Stephen Briggs, _The Discworld Companion_PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
Quoted 13 lines · Wolfgang Denk
Dear Marek Vasut,
Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 9 lines
Running checkpatch on your patches I see a lot of issues, and not only a couple of them.
For example,
WARNING: line over 80 characters
#632: FILE:arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
+intdo_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Quoted 6 lines
Quoted 3 lines
those
iomux-mx28.hissues were already explained. It's a file taken from linux kernel with no modifications, that's why the issues. And if you take a look inside, fixing it would make it unreadable.The error above appears to be unrelated. Why did you not fix at least these?
I believe the V3 should have that error fixed. The line-over-80 error that is.
PATCH v4 1/15 iMX28: Initial support for iMX28 CPU
In reply to Marek VasutThis patch supports:
- Timers
- Debug UART
- Clock
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 194 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4527 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h
V2: Use watchdog for reset
V3: Remove redundant power_regs from cpu_reset() (gcc4.6)
V4: Squash checkpatch issue
arch/arm/cpu/arm926ejs/mx28/Makefile new file +46 -0
@@ -0,0 +1,46 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd 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. +# +# 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$(SOC).o + +COBJS = clock.o mx28.o timer.o + +SRCS := $(START:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/arm/cpu/arm926ejs/mx28/clock.c new file +355 -0
355 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +194 -0
194 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/timer.c new file +141 -0
141 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/clock.h new file +61 -0
61 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/imx-regs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Freescale i.MX28 Registers +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __IMX_REGS_H__ +#define __IMX_REGS_H__ + +#include <asm/arch/regs-base.h> +#include <asm/arch/regs-bch.h> +#include <asm/arch/regs-clkctrl.h> +#include <asm/arch/regs-gpmi.h> +#include <asm/arch/regs-i2c.h> +#include <asm/arch/regs-ocotp.h> +#include <asm/arch/regs-pinctrl.h> +#include <asm/arch/regs-power.h> +#include <asm/arch/regs-rtc.h> +#include <asm/arch/regs-ssp.h> +#include <asm/arch/regs-timrot.h> + +#endif /* __IMX_REGS_H__ */
arch/arm/include/asm/arch-mx28/regs-base.h new file +88 -0
88 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-bch.h new file +230 -0
230 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-clkctrl.h new file +312 -0
312 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-common.h new file +66 -0
66 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-gpmi.h new file +222 -0
222 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-i2c.h new file +207 -0
207 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ocotp.h new file +173 -0
173 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-pinctrl.h new file +1284 -0
867 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-power.h new file +413 -0
413 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-rtc.h new file +147 -0
147 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ssp.h new file +349 -0
349 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-timrot.h new file +171 -0
171 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/sys_proto.h new file +30 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.6.3
Part of the diff is not shown here. View the raw message.
PATCH v5 1/15 iMX28: Initial support for iMX28 CPU
This patch supports:
- Timers
- Debug UART
- Clock
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 193 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4526 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h
V2: Use watchdog for reset
V3: Remove redundant power_regs from cpu_reset() (gcc4.6)
V4: Squash checkpatch issue
V5: Drop bogus include directive including so far nonexistent file
arch/arm/cpu/arm926ejs/mx28/Makefile new file +46 -0
@@ -0,0 +1,46 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd 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. +# +# 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$(SOC).o + +COBJS = clock.o mx28.o timer.o + +SRCS := $(START:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/arm/cpu/arm926ejs/mx28/clock.c new file +355 -0
355 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +193 -0
193 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/timer.c new file +141 -0
141 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/clock.h new file +61 -0
61 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/imx-regs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Freescale i.MX28 Registers +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __IMX_REGS_H__ +#define __IMX_REGS_H__ + +#include <asm/arch/regs-base.h> +#include <asm/arch/regs-bch.h> +#include <asm/arch/regs-clkctrl.h> +#include <asm/arch/regs-gpmi.h> +#include <asm/arch/regs-i2c.h> +#include <asm/arch/regs-ocotp.h> +#include <asm/arch/regs-pinctrl.h> +#include <asm/arch/regs-power.h> +#include <asm/arch/regs-rtc.h> +#include <asm/arch/regs-ssp.h> +#include <asm/arch/regs-timrot.h> + +#endif /* __IMX_REGS_H__ */
arch/arm/include/asm/arch-mx28/regs-base.h new file +88 -0
88 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-bch.h new file +230 -0
230 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-clkctrl.h new file +312 -0
312 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-common.h new file +66 -0
66 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-gpmi.h new file +222 -0
222 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-i2c.h new file +207 -0
207 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ocotp.h new file +173 -0
173 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-pinctrl.h new file +1284 -0
868 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-power.h new file +413 -0
413 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-rtc.h new file +147 -0
147 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ssp.h new file +349 -0
349 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-timrot.h new file +171 -0
171 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/sys_proto.h new file +30 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.6.3
Part of the diff is not shown here. View the raw message.
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
In reply to Marek VasutDear Marek Vasut,
Quoted 49 lines · In message <[email protected]> you wrote:
This patch supports:
- Timers
- Debug UART
- ClockSigned-off-by Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>--- arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 194 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4527 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h
...
arch/arm/cpu/arm926ejs/mx28/mx28.c line 36
Quoted 8 lines
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +8
-0+#include <common.h> +#include <asm/errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/gpio.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/iomux-mx28.h>
You include <asm/arch/iomux-mx28.h> here, but add this file only in patch # 4 of your series. That means your patches are not bisectable.
Please fix.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Man did not weave the web of life; he is merely a strand in it. Whatever he does to the web, he does to himself. - Seattle [1854]
PATCH v3 1/15 iMX28: Initial support for iMX28 CPU
Quoted 3 lines · Wolfgang Denk
Dear Marek Vasut,
In message <[email protected]> you
Quoted 54 lines · wrote:
Quoted 51 lines
This patch supports:
- Timers
- Debug UART
- ClockSigned-off-by Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>---
arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 194 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4527 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h...
Quoted 11 lines
arch/arm/cpu/arm926ejs/mx28/mx28.c line 36
Quoted 8 lines
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +8
-0+#include <common.h> +#include <asm/errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/gpio.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/iomux-mx28.h> You include <
asm/arch/iomux-mx28.h> here, but add this file only in patch # 4 of your series. That means your patches are not bisectable.
Good catch, it must have crawled in when I was debugging the reset issue. Dropping the include does the trick, thanks for your constant torture! ;-)
Fix in V4 on the way!
Cheers
PATCH v2 2/15 iMX28: Add SSP MMC driver
In reply to Marek Vasut--- arch/arm/include/asm/arch-mx28/sys_proto.h | 2 + drivers/mmc/Makefile | 1 + drivers/mmc/mxsmmc.c | 351 ++++++++++++++++++++++++++++ 3 files changed, 354 insertions(+), 0 deletions(-) create mode 100644 drivers/mmc/mxsmmc.c
arch/arm/include/asm/arch-mx28/sys_proto.h +2 -0
@@ -27,4 +27,6 @@ int mx28_reset_block(struct mx28_register *reg);int mx28_wait_mask_set (struct mx28_register *reg,uint32_t mask,int timeout);int mx28_wait_mask_clr (struct mx28_register *reg,uint32_t mask,int timeout); +int mxsmmc_initialize (bd_t *bis,int id,int (*wp)(int )); +#endif /* __MX28_H__ */
drivers/mmc/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_MMC_SPI) += mmc_spi.o COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o COBJS-$(CONFIG_MV_SDHCI) += mv_sdhci.o COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o +COBJS-$(CONFIG_MXS_MMC) += mxsmmc.o COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o
drivers/mmc/mxsmmc.c new file +351 -0
351 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 3/15 FEC: Add support for iMX28 quirks
In reply to Marek Vasut--- drivers/net/fec_mxc.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-)
drivers/net/fec_mxc.c +42 -2
@@ -42,6 +42,14 @@ DECLARE_GLOBAL_DATA_PTR;#define CONFIG_FEC_XCV_TYPE MII100#endif +/* +* The i.MX28 operates with packets in big endian. We need to swap them before +* sending and after receiving. +*/ +#ifdef CONFIG_MX28 +#define CONFIG_FEC_MXC_SWAP_PACKET +#endif +#undef DEBUGstruct nbuf {
@@ -51,6 +59,32 @@ struct nbuf {uint8_t head[16 ];/**< MAC header(6 + 6 + 2) + 2(aligned) */ }; +#ifdef CONFIG_FEC_MXC_SWAP_PACKET +static void swap_packet (uint32_t *packet,int length) +{ +int i; + +for (i =0 ; i <DIV_ROUND_UP (length,4 ); i++) + packet[i] =__swab32 (packet[i]); +} +#endif + +/* +* The i.MX28 has two ethernet interfaces, but they are not equal. +* Only the first one can access the MDIO bus. +*/ +#ifdef CONFIG_MX28 +static inline struct ethernet_regs *fec_miiphy_fec_to_eth (struct fec_priv *fec) +{ +return (struct ethernet_regs *)MXS_ENET0_BASE ; +} +#else +static inline struct ethernet_regs *fec_miiphy_fec_to_eth (struct fec_priv *fec) +{ +return fec->eth; +} +#endif +/* * MII-interface related functions */
@@ -59,7 +93,7 @@ static int fec_miiphy_read(const char *dev, uint8_t phyAddr, uint8_t regAddr, {struct eth_device *edev =eth_get_dev_by_name (dev);struct fec_priv *fec = (struct fec_priv *)edev->priv; -struct ethernet_regs *eth = fec->eth; +struct ethernet_regs *eth =fec_miiphy_fec_to_eth (fec);uint32_t reg;/* convenient holder for the PHY register */ uint32_t phy;/* convenient holder for the PHY */
@@ -117,7 +151,7 @@ static int fec_miiphy_write(const char *dev, uint8_t phyAddr, uint8_t regAddr, {struct eth_device *edev =eth_get_dev_by_name (dev);struct fec_priv *fec = (struct fec_priv *)edev->priv; -struct ethernet_regs *eth = fec->eth; +struct ethernet_regs *eth =fec_miiphy_fec_to_eth (fec);uint32_t reg;/* convenient holder for the PHY register */ uint32_t phy;/* convenient holder for the PHY */
@@ -572,6 +606,9 @@ static int fec_send(struct eth_device *dev, volatile void* packet, int length)* Note: We are always using the first buffer for transmission, * the second will be empty and only used to stop the DMA engine */ +#ifdef CONFIG_FEC_MXC_SWAP_PACKET +swap_packet ((uint32_t *)packet, length); +#endif writew (length, &fec->tbd_base[fec->tbd_index].data_length);writel ((uint32_t )packet, &fec->tbd_base[fec->tbd_index].data_pointer);/*
@@ -668,6 +705,9 @@ static int fec_recv(struct eth_device *dev)/* * Fill the buffer and pass it to upper layers */ +#ifdef CONFIG_FEC_MXC_SWAP_PACKET +swap_packet ((uint32_t *)frame->data, frame_length); +#endif memcpy (buff, frame->data, frame_length);NetReceive (buff, frame_length); len = frame_length;
Signature · 1 line
1.7.5.4
PATCH 3/15 FEC: Add support for iMX28 quirks
Quoted 6 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Ben Warren <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>---
Hi Marek,
only a small question:
Quoted 9 lines
drivers/net/fec_mxc.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-)drivers/net/fec_mxc.c +0
-0@@ -42,6 +42,14 @@ DECLARE_GLOBAL_DATA_PTR;#define CONFIG_FEC_XCV_TYPE MII100
drivers/net/fec_mxc.c DECLARE_GLOBAL_DATA_PTR; · line 52
Quoted 10 lines
drivers/net/fec_mxc.c +8
-0#endif +/* +* The i.MX28 operates with packets in big endian. We need to swap them before +* sending and after receiving. +*/ +#ifdef CONFIG_MX28 +#define CONFIG_FEC_MXC_SWAP_PACKET +#endif +
Do we really need two defines ? If the MX28 has the oddity to swap packets and this must be always done for this SOC, we could protect the code only with CONFIG_MX28. I think in the code it is already clear that in case of MX28 the packets are swapped.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH v2 3/15 FEC: Add support for iMX28 quirks
Quoted 24 lines · Stefano Babic
Quoted 6 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Ben Warren <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>---
Hi Marek,
only a small question:
Quoted 13 lines
drivers/net/fec_mxc.c | 44++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-)
drivers/net/fec_mxc.c +0
-0@@ -42,6 +42,14 @@ DECLARE_GLOBAL_DATA_PTR;#define CONFIG_FEC_XCV_TYPE MII100#endif
Quoted 13 lines
drivers/net/fec_mxc.c DECLARE_GLOBAL_DATA_PTR; · line 52
Quoted 8 lines
drivers/net/fec_mxc.c +2
-0+/* +* The i.MX28 operates with packets in big endian. We need to swap them before + * sending and after receiving.
+ */drivers/net/fec_mxc.c +4
-0+#ifdef CONFIG_MX28 +#define CONFIG_FEC_MXC_SWAP_PACKET +#endif +Do we really need two defines ? If the MX28 has the oddity to swap packets and this must be always done for this SOC, we could protect the code only with
CONFIG_MX28. I think in the code it is already clear that in case of MX28 the packets are swapped.
Well if any other CPU with this problem pops up on the market, we should be ready.
Quoted 3 lines
Best regards,
Stefano Babic
PATCH 3/15 FEC: Add support for iMX28 quirks
Quoted 18 lines · Marek Vasut
Quoted 4 lines · Stefano Babic
Quoted 3 lines · Marek Vasut
drivers/net/fec_mxc.c +0
-0Quoted 12 lines
drivers/net/fec_mxc.c
Quoted 7 lines
+/*
+ * The i.MX28 operates with packets in big endian. We need to swap them before + * sending and after receiving.
+ */drivers/net/fec_mxc.c +3
-0+#ifdef ? ? CONFIG_MX28 +#define ? ?CONFIG_FEC_MXC_SWAP_PACKET +#endif Do we really need two defines ? If the MX28 has the oddity to swap packets and this must be always done for this SOC, we could protect the code only with
CONFIG_MX28. I think in the code it is already clear that in case of MX28 the packets are swapped.
Quoted 2 lines
Well if any other CPU with this problem pops up on the market, we should be ready.
makes sense
-mike
PATCH v2 4/15 iMX28: Add PINMUX control
In reply to Marek VasutTaken from Linux kernel with minor modifications:
commit bf985969e27b507f734435a99df8bf745a3dbb2b
Author: Shawn Guo <[email protected]> Date: Mon Dec 20 22:57:43 2010 +0800
ARM: mxs: Add iomux support
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 2 +- arch/arm/cpu/arm926ejs/mx28/iomux.c | 109 ++++++ arch/arm/include/asm/arch-mx28/iomux-mx28.h | 537 +++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/iomux.h | 168 +++++++++ 4 files changed, 815 insertions(+), 1 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/iomux.c create mode 100644 arch/arm/include/asm/arch-mx28/iomux-mx28.h create mode 100644 arch/arm/include/asm/arch-mx28/iomux.h
arch/arm/cpu/arm926ejs/mx28/Makefile +1 -1
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).o -COBJS = clock.o mx28.o timer.o +COBJS = clock.o mx28.o iomux.o timer.o SRCS := $(START:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
arch/arm/cpu/arm926ejs/mx28/iomux.c new file +109 -0
109 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/iomux-mx28.h new file +537 -0
537 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/iomux.h new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 5/15 iMX28: Add I2C bus driver
In reply to Marek Vasut--- drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 240 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 241 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/mxs_i2c.c
drivers/i2c/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o COBJS-$(CONFIG_I2C_MV) += mv_i2c.o COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o +COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.o COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
drivers/i2c/mxs_i2c.c new file +240 -0
240 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 5/15 iMX28: Add I2C bus driver
Hello Marek,
Quoted 10 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 240 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 241 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/mxs_i2c.c
Hmm I see you worked in my comment, but then your subject line should contain a "v2", and also a short description, what you changed, would be nice ... also, patchwork did not recognize, that this patch is a following up to your first version. When sending patchupdates, you should use your first Message-id, so patchwork could follow it.
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH v2 5/15 iMX28: Add I2C bus driver
Quoted 16 lines · Heiko Schocher
Hello Marek,
Quoted 5 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>Quoted 7 lines
---
drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 240 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 241 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/mxs_i2c.c
Quoted 5 lines
Hmm I see you worked in my comment, but then your subject line should contain a "v2", and also a short description, what you changed, would be nice ... also, patchwork did not recognize, that this patch is a following up to your first version. When sending patchupdates, you should use your first Message-id, so patchwork could follow it.
ACK, will do next time.
Quoted 3 lines
bye,
Heiko
PATCH 5/15 iMX28: Add I2C bus driver
In reply to Marek VasutHi Marek,
Quoted 29 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 240 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 241 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/mxs_i2c.cdrivers/i2c/Makefile +1
-0@@ -31,6 +31,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o COBJS-$(CONFIG_I2C_MV) += mv_i2c.o COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o +COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.o COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.odrivers/i2c/mxs_i2c.c new file +0
-0
drivers/i2c/mxs_i2c.c line 5
Quoted 5 lines
drivers/i2c/mxs_i2c.c new file +5
-0@@ -0,0 +1,240 @@ +/* +* Freescale i.MX28 I2C Driver +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH
Do you mind adding the copyrights from the kernel driver here? It looks quite inspired to me, even if you didn't like some of the variable names and defines :)
Regards,
Wolfram
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : http://lists.denx.de/pipermail/u-boot/attachments/20110913/80883383/attachment.pgp
PATCH v2 5/15 iMX28: Add I2C bus driver
Quoted 32 lines · Wolfram Sang
Hi Marek,
Quoted 29 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Heiko Schocher <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>---
drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 240 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 241 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/mxs_i2c.cdrivers/i2c/Makefile +1
-0@@ -31,6 +31,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o COBJS-$(CONFIG_I2C_MV) += mv_i2c.o COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o +COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.oCOBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
Quoted 15 lines
drivers/i2c/mxs_i2c.c line 5
Quoted 11 lines
drivers/i2c/mxs_i2c.c new file +5
-0@@ -0,0 +1,240 @@ +/* +* Freescale i.MX28 I2C Driver +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH Do you mind adding the copyrights from the kernel driver here? It looks quite inspired to me, even if you didn't like some of the variable names and defines :)
Bits are from the STMP3xxx driver, not much though.
Quoted 4 lines
Regards,
Wolfram
PATCH 5/15 iMX28: Add I2C bus driver
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
drivers/i2c/mxs_i2c.c new file +1
-0@@ -0,0 +1,240 @@ +/* Quoted 8 lines
drivers/i2c/mxs_i2c.c line 5
Quoted 4 lines
drivers/i2c/mxs_i2c.c new file +4
-0+* Freescale i.MX28 I2C Driver +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH Do you mind adding the copyrights from the kernel driver here? It looks quite inspired to me, even if you didn't like some of the variable names and defines :)
Quoted 1 line
Bits are from the STMP3xxx driver, not much though.
Could you point me to that driver? Maybe it needs fixing as well, because that pattern for example:
+ off = i;
+ for (; i < off + blen; i++) {
+ data >>= 8; + data |= buf[i - off] << 24; + if ((i & 3) == 2)
+ writel(data, &i2c_regs->hw_i2c_data);
+ }
+
+ remain = 24 - ((i & 3) * 8);
+ if (remain)
+ writel(data >> remain, &i2c_regs->hw_i2c_data);
is highly similar to my reimplementation of the "let's feed the buffer code" in the kernel (to name one example). Check current linus-git:
for (i = 0; i < len; i++) {
data >>= 8;
data |= buf[i] << 24;
if ((i & 3) == 2)
writel(data, i2c->regs + MXS_I2C_DATA);
}
/* Write out the remaining bytes if any */
shifts_left = 24 - (i & 3) * 8;
if (shifts_left)
writel(data >> shifts_left, i2c->regs + MXS_I2C_DATA);I'd be very surprised if two programmers would come up with two routines that equal?
Regards,
Wolfram
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : http://lists.denx.de/pipermail/u-boot/attachments/20110913/e7ccc63e/attachment.pgp
PATCH v2 5/15 iMX28: Add I2C bus driver
Quoted 48 lines · Wolfram Sang
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
drivers/i2c/mxs_i2c.c new file +1
-0@@ -0,0 +1,240 @@ +/* Quoted 8 lines
drivers/i2c/mxs_i2c.c line 5
Quoted 4 lines
drivers/i2c/mxs_i2c.c new file +4
-0+* Freescale i.MX28 I2C Driver +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH Do you mind adding the copyrights from the kernel driver here? It looks quite inspired to me, even if you didn't like some of the variable names and defines :)
Quoted 1 line
Bits are from the STMP3xxx driver, not much though.
Could you point me to that driver? Maybe it needs fixing as well, because that pattern for example:
drivers/i2c/mxs_i2c.c new file +11
-0+ off = i; +for (; i < off + blen; i++) { + data >>=8 ; + data |= buf[i - off] <<24 ; +if ((i &3 ) ==2 ) +writel (data, &i2c_regs->hw_i2c_data); + } + + remain =24 - ((i &3 ) *8 ); +if (remain) +writel (data >> remain, &i2c_regs->hw_i2c_data);is highly similar to my reimplementation of the "let's feed the buffer code" in the kernel (to name one example). Check current linus-git:
for (i = 0; i < len; i++) { data >>= 8; data |= buf[i] << 24; if ((i & 3) == 2) writel(data, i2c->regs + MXS_I2C_DATA); } /* Write out the remaining bytes if any */ shifts_left = 24 - (i & 3) * 8; if (shifts_left) writel(data >> shifts_left, i2c->regs + MXS_I2C_DATA);
Quoted 2 lines
I'd be very surprised if two programmers would come up with two routines that equal?
Oh I2C, not SPI. Sorry.
Will add Based on line, cheers!
Quoted 4 lines
Regards,
Wolfram
PATCH 5/15 iMX28: Add I2C bus driver
Quoted 3 lines
Oh I2C, not SPI. Sorry.
Will add Based on line, cheers!
Cool, thanks.
Signature · 9 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : http://lists.denx.de/pipermail/u-boot/attachments/20110913/21cd75d0/attachment.pgp
PATCH v2 5/15 iMX28: Add I2C bus driver
In reply to Marek Vasut--- drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 246 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/mxs_i2c.c
V2: Add "based on" text.
drivers/i2c/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o COBJS-$(CONFIG_I2C_MV) += mv_i2c.o COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o +COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.o COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
drivers/i2c/mxs_i2c.c new file +246 -0
246 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 6/15 iMX28: Add GPIO control
In reply to Marek Vasut--- arch/arm/cpu/arm926ejs/mx28/mx28.c | 6 ++ arch/arm/include/asm/arch-mx28/gpio.h | 32 ++++++++ drivers/gpio/Makefile | 1 + drivers/gpio/mxs_gpio.c | 136 +++++++++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-mx28/gpio.h create mode 100644 drivers/gpio/mxs_gpio.c
arch/arm/cpu/arm926ejs/mx28/mx28.c +6 -0
@@ -31,6 +31,7 @@#include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/gpio.h> +#include <asm/arch/iomux.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h>
@@ -135,6 +136,11 @@ int arch_cpu_init(void)udelay (1000 ); +/* +* Configure GPIO unit +*/ +mxs_gpio_init (); + return 0; }#endif
arch/arm/include/asm/arch-mx28/gpio.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Freescale i.MX28 GPIO +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __MX28_GPIO_H__ +#define __MX28_GPIO_H__ + +#ifdef CONFIG_MXS_GPIO +void mxs_gpio_init (void ); +#else +inline void mxs_gpio_init (void ) {} +#endif + +#endif /* __MX28_GPIO_H__ */
drivers/gpio/Makefile +1 -0
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_AT91_GPIO) += at91_gpio.o COBJS-$(CONFIG_KIRKWOOD_GPIO) += kw_gpio.o COBJS-$(CONFIG_MARVELL_MFP) += mvmfp.o COBJS-$(CONFIG_MXC_GPIO) += mxc_gpio.o +COBJS-$(CONFIG_MXS_GPIO) += mxs_gpio.o COBJS-$(CONFIG_PCA953X) += pca953x.o COBJS-$(CONFIG_S5P) += s5p_gpio.o COBJS-$(CONFIG_TEGRA2_GPIO) += tegra2_gpio.o
drivers/gpio/mxs_gpio.c new file +136 -0
136 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 6/15 iMX28: Add GPIO control
Quoted 5 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>---
Hi Marek,
Quoted 17 lines
drivers/gpio/mxs_gpio.c new file +17
-0+ +#include <common.h> +#include <netdev.h> +#include <asm/errno.h> +#include <asm/io.h> +#include <asm/arch/iomux.h> +#include <asm/arch/imx-regs.h> + +#if defined(CONFIG_MX23 ) +#define PINCTRL_BANKS 3 +#define PINCTRL_DOUT (n) (0x0500 + ((n) * 0x10)) +#define PINCTRL_DIN (n) (0x0600 + ((n) * 0x10)) +#define PINCTRL_DOE (n) (0x0700 + ((n) * 0x10)) +#define PINCTRL_PIN2IRQ (n) (0x0800 + ((n) * 0x10)) +#define PINCTRL_IRQEN (n) (0x0900 + ((n) * 0x10)) +#define PINCTRL_IRQSTAT (n) (0x0c00 + ((n) * 0x10)) +#elif defined(CONFIG_MX28 )
drivers/gpio/mxs_gpio.c line 51
Quoted 10 lines
drivers/gpio/mxs_gpio.c new file +10
-0+#define PINCTRL_BANKS 5 +#define PINCTRL_DOUT (n) (0x0700 + ((n) * 0x10)) +#define PINCTRL_DIN (n) (0x0900 + ((n) * 0x10)) +#define PINCTRL_DOE (n) (0x0b00 + ((n) * 0x10)) +#define PINCTRL_PIN2IRQ (n) (0x1000 + ((n) * 0x10)) +#define PINCTRL_IRQEN (n) (0x1100 + ((n) * 0x10)) +#define PINCTRL_IRQSTAT (n) (0x1400 + ((n) * 0x10)) +#else +#error "Please select CONFIG_MX23 or CONFIG_MX28" +#endif
Only to remark: I know that at the moment we have not CONFIG_MX23 in u-boot and the MX23 part is dead code. However, the added part is very small and clear visible, and I agree to let it in code even if it breaks this u-boot rule.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH v2 7/15 iMX28: Add SPI driver
In reply to Marek Vasut--- drivers/spi/Makefile | 1 + drivers/spi/mxs_spi.c | 172 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 0 deletions(-) create mode 100644 drivers/spi/mxs_spi.c
drivers/spi/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o +COBJS-$(CONFIG_MXS_SPI) += mxs_spi.o COBJS-$(CONFIG_OC_TINY_SPI) += oc_tiny_spi.o COBJS-$(CONFIG_OMAP3_SPI) += omap3_spi.o COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
drivers/spi/mxs_spi.c new file +172 -0
172 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 7/15 iMX28: Add SPI driver
Quoted 6 lines · On Monday, September 12, 2011 00:06:41 Marek Vasut wrote:
drivers/spi/mxs_spi.c new file +6
-0+struct spi_slave *spi_setup_slave (unsigned int bus,unsigned int cs, +unsigned int max_hz,unsigned int mode) +{ + +mx28_reset_block (&ssp_regs->hw_ssp_ctrl0_reg); +
drivers/spi/mxs_spi.c line 78
Quoted 10 lines
drivers/spi/mxs_spi.c new file +10
-0+writel (SSP_CTRL0_BUS_WIDTH_ONE_BIT , &ssp_regs->hw_ssp_ctrl0); + + reg =SSP_CTRL1_SSP_MODE_SPI |SSP_CTRL1_WORD_LENGTH_EIGHT_BITS ; + reg |= (mode &SPI_CPOL ) ?SSP_CTRL1_POLARITY :0 ; + reg |= (mode &SPI_CPHA ) ?SSP_CTRL1_PHASE :0 ; +writel (reg, &ssp_regs->hw_ssp_ctrl1); + +writel (0 , &ssp_regs->hw_ssp_cmd0); + +mx28_set_ssp_busclock (bus, max_hz /1000 );
these steps should be done in the claim_bus func
drivers/spi/mxs_spi.c line 104
Quoted 2 lines
drivers/spi/mxs_spi.c new file +2
-0+void mxs_spi_start_xfer(struct spi_slave *slave) +void mxs_spi_end_xfer(struct spi_slave *slave)
both should be static
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110912/9b6bf187/attachment.pgp
PATCH v2 7/15 iMX28: Add SPI driver
Quoted 11 lines · Mike Frysinger
Quoted 10 lines · On Monday, September 12, 2011 00:06:41 Marek Vasut wrote:
drivers/spi/mxs_spi.c new file +10
-0+struct spi_slave *spi_setup_slave (unsigned int bus,unsigned int cs, +unsigned int max_hz,unsigned int mode) +{ + +mx28_reset_block (&ssp_regs->hw_ssp_ctrl0_reg); + +writel (SSP_CTRL0_BUS_WIDTH_ONE_BIT , &ssp_regs->hw_ssp_ctrl0); + + reg =SSP_CTRL1_SSP_MODE_SPI |SSP_CTRL1_WORD_LENGTH_EIGHT_BITS ; + reg |= (mode &SPI_CPOL ) ?SSP_CTRL1_POLARITY :0 ;
Quoted 8 lines
drivers/spi/mxs_spi.c line 78
Quoted 6 lines
drivers/spi/mxs_spi.c new file +6
-0+ reg |= (mode &SPI_CPHA ) ?SSP_CTRL1_PHASE :0 ; +writel (reg, &ssp_regs->hw_ssp_ctrl1); + +writel (0 , &ssp_regs->hw_ssp_cmd0); + +mx28_set_ssp_busclock (bus, max_hz /1000 );these steps should be done in the
claim_busfunc
I don't think so ... I need to access max_hz and mode. This seems more fitting to me.
Quoted 6 lines
drivers/spi/mxs_spi.c line 104
Quoted 3 lines
drivers/spi/mxs_spi.c new file +2
-0+void mxs_spi_start_xfer(struct spi_slave *slave) +void mxs_spi_end_xfer(struct spi_slave *slave)both should be static
-mike
ACK
Cheers
PATCH 7/15 iMX28: Add SPI driver
Quoted 21 lines · On Monday, September 12, 2011 13:42:22 Marek Vasut wrote:
Quoted 11 lines · Mike Frysinger
Quoted 10 lines · On Monday, September 12, 2011 00:06:41 Marek Vasut wrote:
drivers/spi/mxs_spi.c new file +10
-0+struct spi_slave *spi_setup_slave (unsigned int bus,unsigned int cs, +unsigned int max_hz,unsigned int mode) +{ + +mx28_reset_block (&ssp_regs->hw_ssp_ctrl0_reg); + +writel (SSP_CTRL0_BUS_WIDTH_ONE_BIT , &ssp_regs->hw_ssp_ctrl0); + + reg =SSP_CTRL1_SSP_MODE_SPI |SSP_CTRL1_WORD_LENGTH_EIGHT_BITS ; + reg |= (mode &SPI_CPOL ) ?SSP_CTRL1_POLARITY :0 ;Quoted 8 lines
drivers/spi/mxs_spi.c line 78
Quoted 6 lines
drivers/spi/mxs_spi.c new file +6
-0+ reg |= (mode &SPI_CPHA ) ?SSP_CTRL1_PHASE :0 ; +writel (reg, &ssp_regs->hw_ssp_ctrl1); + +writel (0 , &ssp_regs->hw_ssp_cmd0); + +mx28_set_ssp_busclock (bus, max_hz /1000 );these steps should be done in the
claim_busfunc
Quoted 2 lines
I don't think so ... I need to access
max_hzand mode. This seems more fitting to me.
that's not how the API works. you create clients, then you acquire the bus for a specific client, do a transfer, and then release it. your bus breaks with the trivial case:
- setup slave A
- setup slave B
- claim bus for slave A
- transfer with slave A <- uses settings from slave B
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110912/92ae84b9/attachment.pgp
PATCH v2 7/15 iMX28: Add SPI driver
Quoted 5 lines · Mike Frysinger
Quoted 4 lines · On Monday, September 12, 2011 13:42:22 Marek Vasut wrote:
Quoted 3 lines · Mike Frysinger
Review
Quoted 2 lines · On Monday, September 12, 2011 00:06:41 Marek Vasut wrote:
(quoted diff) +2
-0+struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, + unsigned int max_hz, unsigned int
mode)
Quoted 20 lines
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
drivers/spi/mxs_spi.c new file +8
-0+{ + +mx28_reset_block (&ssp_regs->hw_ssp_ctrl0_reg); + +writel (SSP_CTRL0_BUS_WIDTH_ONE_BIT , &ssp_regs->hw_ssp_ctrl0); + + reg =SSP_CTRL1_SSP_MODE_SPI |SSP_CTRL1_WORD_LENGTH_EIGHT_BITS ; + reg |= (mode &SPI_CPOL ) ?SSP_CTRL1_POLARITY :0 ;Quoted 8 lines
drivers/spi/mxs_spi.c line 78
Quoted 6 lines
drivers/spi/mxs_spi.c new file +6
-0+ reg |= (mode &SPI_CPHA ) ?SSP_CTRL1_PHASE :0 ; +writel (reg, &ssp_regs->hw_ssp_ctrl1); + +writel (0 , &ssp_regs->hw_ssp_cmd0); + +mx28_set_ssp_busclock (bus, max_hz /1000 );these steps should be done in the
claim_busfuncQuoted 2 lines
I don't think so ... I need to access
max_hzand mode. This seems more fitting to me.
Quoted 8 lines
that's not how the API works. you create clients, then you acquire the bus for a specific client, do a transfer, and then release it. your bus breaks with the trivial case:
- setup slave A
- setup slave B
- claim bus for slave A
- transfer with slave A <- uses settings from slave B
-mike
Thanks for clearing this, fixed in V3
PATCH v2 7/15 iMX28: Add SPI driver
In reply to Marek Vasut--- drivers/spi/Makefile | 1 + drivers/spi/mxs_spi.c | 186 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 0 deletions(-) create mode 100644 drivers/spi/mxs_spi.c
V2: Use the SPI API properly.
drivers/spi/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o +COBJS-$(CONFIG_MXS_SPI) += mxs_spi.o COBJS-$(CONFIG_OC_TINY_SPI) += oc_tiny_spi.o COBJS-$(CONFIG_OMAP3_SPI) += omap3_spi.o COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
drivers/spi/mxs_spi.c new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 7/15 iMX28: Add SPI driver
Quoted 8 lines · On Tuesday, September 13, 2011 18:26:19 Marek Vasut wrote:
drivers/spi/mxs_spi.c new file +8
-0+int spi_claim_bus (struct spi_slave *slave) +{ +struct mxs_spi_slave *mxs_slave =to_mxs_slave (slave); +struct mx28_ssp_regs *ssp_regs = mxs_slave->regs; +uint32_t reg =0 ; + +mx28_reset_block (&ssp_regs->hw_ssp_ctrl0_reg); +
drivers/spi/mxs_spi.c line 103
Quoted 10 lines
drivers/spi/mxs_spi.c new file +10
-0+writel (SSP_CTRL0_BUS_WIDTH_ONE_BIT , &ssp_regs->hw_ssp_ctrl0); + + reg =SSP_CTRL1_SSP_MODE_SPI |SSP_CTRL1_WORD_LENGTH_EIGHT_BITS ; + reg |= (mxs_slave->mode &SPI_CPOL ) ?SSP_CTRL1_POLARITY :0 ; + reg |= (mxs_slave->mode &SPI_CPHA ) ?SSP_CTRL1_PHASE :0 ; +writel (reg, &ssp_regs->hw_ssp_ctrl1); + +writel (0 , &ssp_regs->hw_ssp_cmd0); + +mx28_set_ssp_busclock (slave->bus, mxs_slave->max_khz);
this turns on the hardware ...
drivers/spi/mxs_spi.c line 110
Quoted 3 lines
drivers/spi/mxs_spi.c new file +3
-0+void spi_release_bus (struct spi_slave *slave) +{ +}
... so shouldn't this turn it off ?
i dont have the datasheet for the controller, so i have no idea :)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110913/310bfd73/attachment.pgp
PATCH v2 7/15 iMX28: Add SPI driver
Quoted 13 lines · Mike Frysinger
Quoted 12 lines · On Tuesday, September 13, 2011 18:26:19 Marek Vasut wrote:
drivers/spi/mxs_spi.c new file +12
-0+int spi_claim_bus (struct spi_slave *slave) +{ +struct mxs_spi_slave *mxs_slave =to_mxs_slave (slave); +struct mx28_ssp_regs *ssp_regs = mxs_slave->regs; +uint32_t reg =0 ; + +mx28_reset_block (&ssp_regs->hw_ssp_ctrl0_reg); + +writel (SSP_CTRL0_BUS_WIDTH_ONE_BIT , &ssp_regs->hw_ssp_ctrl0); + + reg =SSP_CTRL1_SSP_MODE_SPI |SSP_CTRL1_WORD_LENGTH_EIGHT_BITS ; + reg |= (mxs_slave->mode &SPI_CPOL ) ?SSP_CTRL1_POLARITY :0 ;
Quoted 8 lines
drivers/spi/mxs_spi.c line 103
Quoted 6 lines
drivers/spi/mxs_spi.c new file +6
-0+ reg |= (mxs_slave->mode &SPI_CPHA ) ?SSP_CTRL1_PHASE :0 ; +writel (reg, &ssp_regs->hw_ssp_ctrl1); + +writel (0 , &ssp_regs->hw_ssp_cmd0); + +mx28_set_ssp_busclock (slave->bus, mxs_slave->max_khz);this turns on the hardware ...
This only sets up the clock to a correct frequency, the hardware is running all the time.
Quoted 9 lines
drivers/spi/mxs_spi.c line 110
Quoted 4 lines
drivers/spi/mxs_spi.c new file +3
-0+void spi_release_bus (struct spi_slave *slave) +{ +}... so shouldn't this turn it off ?
i dont have the datasheet for the controller, so i have no idea :) -mike
PATCH v2 8/15 iMX28: Add APBH DMA driver
In reply to Marek Vasut--- arch/arm/include/asm/arch-mx28/dma.h | 170 +++++++ arch/arm/include/asm/arch-mx28/imx-regs.h | 1 + arch/arm/include/asm/arch-mx28/regs-apbh.h | 466 +++++++++++++++++++ drivers/dma/Makefile | 1 + drivers/dma/apbh_dma.c | 691 ++++++++++++++++++++++++++++ 5 files changed, 1329 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-mx28/dma.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-apbh.h create mode 100644 drivers/dma/apbh_dma.c
arch/arm/include/asm/arch-mx28/dma.h new file +170 -0
@@ -0,0 +1,170 @@ +/* +* Freescale i.MX28 APBH DMA +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* Based on code from LTIB: +* Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. +* +* 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 +* +*/ + +#ifndef __DMA_H__ +#define __DMA_H__ + +#include <linux/list.h> + +#ifndef CONFIG_ARCH_DMA_PIO_WORDS +#define DMA_PIO_WORDS 15 +#else +#define DMA_PIO_WORDS CONFIG_ARCH_DMA_PIO_WORDS +#endif + +#define MXS_DMA_ALIGNMENT 32 + +/* +* MXS DMA channels +*/ +enum { +MXS_DMA_CHANNEL_AHB_APBH_SSP0 =0 , +MXS_DMA_CHANNEL_AHB_APBH_SSP1 , +MXS_DMA_CHANNEL_AHB_APBH_SSP2 , +MXS_DMA_CHANNEL_AHB_APBH_SSP3 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI0 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI1 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI2 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI3 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI4 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI5 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI6 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI7 , +MXS_DMA_CHANNEL_AHB_APBH_SSP , +MXS_MAX_DMA_CHANNELS , +}; + +/* +* MXS DMA hardware command. +* +* This structure describes the in-memory layout of an entire DMA command, +* including space for the maximum number of PIO accesses. See the appropriate +* reference manual for a detailed description of what these fields mean to the +* DMA hardware. +*/ +#define MXS_DMA_DESC_COMMAND_MASK 0x3 +#define MXS_DMA_DESC_COMMAND_OFFSET 0 +#define MXS_DMA_DESC_COMMAND_NO_DMAXFER 0x0 +#define MXS_DMA_DESC_COMMAND_DMA_WRITE 0x1 +#define MXS_DMA_DESC_COMMAND_DMA_READ 0x2 +#define MXS_DMA_DESC_COMMAND_DMA_SENSE 0x3 +#define MXS_DMA_DESC_CHAIN (1 << 2) +#define MXS_DMA_DESC_IRQ (1 << 3) +#define MXS_DMA_DESC_NAND_LOCK (1 << 4) +#define MXS_DMA_DESC_NAND_WAIT_4_READY (1 << 5) +#define MXS_DMA_DESC_DEC_SEM (1 << 6) +#define MXS_DMA_DESC_WAIT4END (1 << 7) +#define MXS_DMA_DESC_HALT_ON_TERMINATE (1 << 8) +#define MXS_DMA_DESC_TERMINATE_FLUSH (1 << 9) +#define MXS_DMA_DESC_PIO_WORDS_MASK (0xf << 12) +#define MXS_DMA_DESC_PIO_WORDS_OFFSET 12 +#define MXS_DMA_DESC_BYTES_MASK (0xffff << 16) +#define MXS_DMA_DESC_BYTES_OFFSET 16 + +struct mxs_dma_cmd { +unsigned long next; +unsigned long data; +union { +dma_addr_t address; +unsigned long alternate; + }; +unsigned long pio_words[DMA_PIO_WORDS ]; +}; + +/* +* MXS DMA command descriptor. +* +* This structure incorporates an MXS DMA hardware command structure, along +* with metadata. +*/ +#define MXS_DMA_DESC_FIRST (1 << 0) +#define MXS_DMA_DESC_LAST (1 << 1) +#define MXS_DMA_DESC_READY (1 << 31) + +struct mxs_dma_desc { +struct mxs_dma_cmd cmd; +unsigned int flags; +dma_addr_t address; +void *buffer; +struct list_head node; +}; + +/** +* MXS DMA channel +* +* This structure represents a single DMA channel. The MXS platform code +* maintains an array of these structures to represent every DMA channel in the +* system (see mxs_dma_channels). +*/ +#define MXS_DMA_FLAGS_IDLE 0 +#define MXS_DMA_FLAGS_BUSY (1 << 0) +#define MXS_DMA_FLAGS_FREE 0 +#define MXS_DMA_FLAGS_ALLOCATED (1 << 16) +#define MXS_DMA_FLAGS_VALID (1 << 31) + +struct mxs_dma_chan { +const char *name; +unsigned long dev; +struct mxs_dma_device *dma; +unsigned int flags; +unsigned int active_num; +unsigned int pending_num; +struct list_head active; +struct list_head done; +}; + +/* Hardware management ops */ +int mxs_dma_enable (int channel); +int mxs_dma_disable (int channel); +int mxs_dma_reset (int channel); +int mxs_dma_freeze (int channel); +int mxs_dma_unfreeze (int channel); +int mxs_dma_read_semaphore (int channel); +int mxs_dma_enable_irq (int channel,int enable); +int mxs_dma_irq_is_pending (int channel); +int mxs_dma_ack_irq (int channel); + +/* Channel management ops */ +int mxs_dma_request (int channel); +int mxs_dma_release (int channel); + +/* Descriptor management ops */ +struct mxs_dma_desc *mxs_dma_desc_alloc (void ); +void mxs_dma_desc_free (struct mxs_dma_desc *); + +unsigned int mxs_dma_cmd_address (struct mxs_dma_desc *desc); +int mxs_dma_desc_pending (struct mxs_dma_desc *pdesc); + +int mxs_dma_desc_append (int channel,struct mxs_dma_desc *pdesc); + +int mxs_dma_get_finished (int channel,struct list_head *head); +int mxs_dma_finish (int channel,struct list_head *head); + +int mxs_dma_wait_complete (uint32_t timeout,unsigned int chan); +int mxs_dma_go (int chan); + +int mxs_dma_init (void ); + +#endif /* __DMA_H__ */
arch/arm/include/asm/arch-mx28/imx-regs.h +1 -0
@@ -23,6 +23,7 @@#ifndef __IMX_REGS_H__#define __IMX_REGS_H__ +#include <asm/arch/regs-apbh.h> #include <asm/arch/regs-base.h> #include <asm/arch/regs-bch.h> #include <asm/arch/regs-clkctrl.h>
arch/arm/include/asm/arch-mx28/regs-apbh.h new file +466 -0
466 lines not on this page · raw message
drivers/dma/Makefile +1 -0
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk LIB := $(obj)libdma.o COBJS-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o +COBJS-$(CONFIG_APBH_DMA) += apbh_dma.o COBJS-$(CONFIG_FSL_DMA) += fsl_dma.o COBJS := $(COBJS-y)
drivers/dma/apbh_dma.c new file +691 -0
691 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 9/15 iMX28: Add GPMI NAND driver
In reply to Marek Vasut--- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1159 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1160 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/mxs_nand.c
drivers/mtd/nand/Makefile +1 -0
@@ -43,6 +43,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o +COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
drivers/mtd/nand/mxs_nand.c new file +1159 -0
1,159 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 9/15 iMX28: Add GPMI NAND driver
drivers/mtd/nand/mxs_nand.c line 96
Quoted 6 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +6
-0+static void mxs_nand_return_dma_descs (struct mxs_nand_info *info) +{ +int i = info->desc_index; +struct mxs_dma_desc *desc; + +for (--i; i >=0 ; i--) {
This is an awkward construct.
Why not just the usual:
for (i = 0; i < info->desc_index; i++)
drivers/mtd/nand/mxs_nand.c line 108
Quoted 12 lines
drivers/mtd/nand/mxs_nand.c new file +12
-0+ desc = info->desc[i]; +memset (desc,0 ,sizeof (struct mxs_dma_desc )); + desc->address = (dma_addr_t )desc; + } + + info->desc_index =0 ; +} + +static inline uint32_t mxs_nand_ecc_chunk_cnt (uint32_t page_data_size) +{ +return page_data_size /MXS_NAND_CHUNK_DATA_CHUNK_SIZE ; +}
No need for inline in .c files, GCC should take care of this automatically.
Quoted 20 lines
+/*
+ * There are several places in this driver where we have to handle the OOB and
+ * block marks. This is the function where things are the most complicated, so
+ * this is where we try to explain it all. All the other places refer back to
+ * here.
+ *
+ * These are the rules, in order of decreasing importance:
+ *
+ * 1) Nothing the caller does can be allowed to imperil the block mark, so all
+ * write operations take measures to protect it.
+ *
+ * 2) In read operations, the first byte of the OOB we return must reflect the
+ * true state of the block mark, no matter where that block mark appears in
+ * the physical page.
+ *
+ * 3) ECC-based read operations return an OOB full of set bits (since we never
+ * allow ECC-based writes to the OOB, it doesn't matter what ECC-based reads
+ * return).
+ *
+ * 4) "Raw" read operations return a direct view of the physical bytes in the
Quoted 3 lines
+ * page, using the conventional definition of which bytes are data and which + * are OOB. This gives the caller a way to see the actual, physical bytes + * in the page, without the distortions applied by our ECC engine.
Hmm, I thought raw was just supposed to disable ECC, not change the layout from what is used in normal operation.
Quoted 5 lines
+ * It turns out that knowing whether we want an "ECC-based" or "raw" read is not
+ * easy. When reading a page, for example, the NAND Flash MTD code calls our
+ * ecc.read_page or ecc.read_page_raw function. Thus, the fact that MTD wants an
+ * ECC-based or raw view of the page is implicit in which function it calls
+ * (there is a similar pair of ECC-based/raw functions for writing).
This is an issue for the eLBC driver as well -- we need to know whether to enable or disable ECC before we begin the operation (in cmdfunc), not just at the time the buffer is accessed. Currently we just always have ECC on, and raw accesses aren't raw. It would be nice to fix this more generally (starting in Linux, so we don't diverge).
It's too bad we can't rely on chip->ops being used... maybe we could copy the data into there? Or just have a separate mtd_oob_mode_t in nand_chip.
Quoted 7 lines
drivers/mtd/nand/mxs_nand.c new file +7
-0+/* +* Write OOB data to NAND. +*/ +static int mxs_nand_ecc_write_oob (struct mtd_info *mtd,struct nand_chip *nand, +int page) +{ +struct mxs_nand_info *nand_info = nand->priv;
drivers/mtd/nand/mxs_nand.c line 907
Quoted 10 lines
drivers/mtd/nand/mxs_nand.c new file +10
-0+uint8_t block_mark =0 ; + +/* +* There are fundamental incompatibilities between the i.MX GPMI NFC and +* the NAND Flash MTD model that make it essentially impossible to write +* the out-of-band bytes. +* +* We permit *ONE* exception. If the *intent* of writing the OOB is to +* mark a block bad, we can do that. +*/
Is this just an issue with writing OOB separately from the main data (which would also be an issue on MLC chips that don't allow multiple partial programming), or can you not even write user OOB bytes as part of a full page write?
Based on fake_ecc_layout I'm guessing the latter.
drivers/mtd/nand/mxs_nand.c line 912
Quoted 4 lines
drivers/mtd/nand/mxs_nand.c new file +4
-0+if (nand_info->marking_block_bad) { +printf ("NXS NAND: Writing OOB isn't supported\n" ); +return -EIO ; + }
Shouldn't this be if (!nand_info->marking_block_bad)?
Quoted 10 lines
drivers/mtd/nand/mxs_nand.c new file +10
-0+/* +* Claims all blocks are good. +* +* In principle, this function is *only* called when the NAND Flash MTD system +* isn't allowed to keep an in-memory bad block table, so it is forced to ask +* the driver for bad block information. +* +* In fact, we permit the NAND Flash MTD system to have an in-memory BBT, so +* this function is *only* called when we take it away. +*
drivers/mtd/nand/mxs_nand.c line 945
Quoted 10 lines
drivers/mtd/nand/mxs_nand.c new file +10
-0+* We take away the in-memory BBT when the user sets the "ignorebad" parameter, +* which indicates that all blocks should be reported good. +* +* Thus, this function is only called when we want *all* blocks to look good, +* so it *always* return success. +*/ +static int mxs_nand_block_bad (struct mtd_info *mtd,loff_t ofs,int getchip) +{ +return 0 ; +}
What/where is the "ignorebad" parameter?
Other than when scrubbing (which has its own override), when would you want to do this?
Quoted 3 lines
+/*
+ * Nominally, the purpose of this function is to look for or create the bad
+ * block table. In fact, since the HIL calls this function at the very end of
HIL?
Quoted 3 lines
+ * the initialization process started by
nand_scan(), and the HIL doesn't have a
+ * more formal mechanism, everyone "hooks" this function to continue the
+ * initialization process.
Everyone? I only see diskonchip doing this.
The nand_base.c code actually does have a split here (nand_scan_ident/nand_scan_tail), but U-Boot's glue code is too inflexible, and insists on calling nand_scan. The right fix is to let drivers call nand_scan_ident/nand_scan_tail themselves.
-Scott
PATCH v2 9/15 iMX28: Add GPMI NAND driver
Quoted 10 lines · Scott Wood
drivers/mtd/nand/mxs_nand.c line 96
Quoted 6 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +6
-0+static void mxs_nand_return_dma_descs (struct mxs_nand_info *info) +{ +int i = info->desc_index; +struct mxs_dma_desc *desc; + +for (--i; i >=0 ; i--) {This is an awkward construct.
Quoted 3 lines
Why not just the usual:
for (i = 0; i <
info->desc_index; i++)
Good catch.
Quoted 15 lines
drivers/mtd/nand/mxs_nand.c line 108
Quoted 13 lines
drivers/mtd/nand/mxs_nand.c new file +12
-0+ desc = info->desc[i]; +memset (desc,0 ,sizeof (struct mxs_dma_desc )); + desc->address = (dma_addr_t )desc; + } + + info->desc_index =0 ; +} + +static inline uint32_t mxs_nand_ecc_chunk_cnt (uint32_t page_data_size) +{ +return page_data_size /MXS_NAND_CHUNK_DATA_CHUNK_SIZE ; +}No need for inline in .c files, GCC should take care of this automatically.
Does it really ?
Quoted 26 lines
Quoted 17 lines
+/*
+ * There are several places in this driver where we have to handle the OOB and + * block marks. This is the function where things are the most complicated, so + * this is where we try to explain it all. All the other places refer back to + * here.
+ *
+ * These are the rules, in order of decreasing importance:
+ *
+ * 1) Nothing the caller does can be allowed to imperil the block mark,
so all + * write operations take measures to protect it.
+ *
+ * 2) In read operations, the first byte of the OOB we return must
reflect the + * true state of the block mark, no matter where that
block mark appears in + * the physical page.
+ *
+ * 3) ECC-based read operations return an OOB full of set bits (since weQuoted 8 lines
never + * allow ECC-based writes to the OOB, it doesn't matter what
ECC-based reads + * return).
+ *
+ * 4) "Raw" read operations return a direct view of the physical bytes
in the + * page, using the conventional definition of which bytes are
data and which + * are OOB. This gives the caller a way to see the
actual, physical bytes + * in the page, without the distortions
applied by our ECC engine.
Quoted 2 lines
Hmm, I thought raw was just supposed to disable ECC, not change the layout from what is used in normal operation.
You see the page as is ... I see no problem with this part.
Quoted 18 lines
Quoted 7 lines
+ * It turns out that knowing whether we want an "ECC-based" or "raw" read is not + * easy. When reading a page, for example, the NAND Flash MTD code calls our + * ecc.read_page or ecc.read_page_raw function. Thus, the fact that MTD wants an + * ECC-based or raw view of the page is implicit in which function it calls + * (there is a similar pair of ECC-based/raw functions for writing).
This is an issue for the eLBC driver as well -- we need to know whether to enable or disable ECC before we begin the operation (in cmdfunc), not just at the time the buffer is accessed. Currently we just always have ECC on, and raw accesses aren't raw. It would be nice to fix this more generally (starting in Linux, so we don't diverge).
It's too bad we can't rely on
chip->opsbeing used... maybe we could copy the data into there? Or just have a separatemtd_oob_mode_tinnand_chip.
Quoted 12 lines
Quoted 11 lines
drivers/mtd/nand/mxs_nand.c new file +4
-0+/* +* Write OOB data to NAND. +*/ +static int mxs_nand_ecc_write_oob(struct mtd_info *mtd, struct nand_chip*nand, + int page)
drivers/mtd/nand/mxs_nand.c new file +6
-0+{ +struct mxs_nand_info *nand_info = nand->priv; +uint8_t block_mark =0 ; + +/* +* There are fundamental incompatibilities between the i.MX GPMI NFC Quoted 1 line
and + * the NAND Flash MTD model that make it essentially impossible
to
Quoted 11 lines
drivers/mtd/nand/mxs_nand.c line 907
Quoted 5 lines
write + * the out-of-band bytes.
drivers/mtd/nand/mxs_nand.c new file +4
-0+* +* We permit *ONE* exception. If the *intent* of writing the OOB is to +* mark a block bad, we can do that. +*/ Is this just an issue with writing OOB separately from the main data (which would also be an issue on MLC chips that don't allow multiple partial programming), or can you not even write user OOB bytes as part of a full page write?
Quoted 1 line
Based on
fake_ecc_layoutI'm guessing the latter.
My understanding of the original FSL driver is that you should never be allowed to access the physical NAND media at all. Only through the driver, which does the magic.
Quoted 22 lines
drivers/mtd/nand/mxs_nand.c line 912
Quoted 5 lines
drivers/mtd/nand/mxs_nand.c new file +4
-0+if (nand_info->marking_block_bad) { +printf ("NXS NAND: Writing OOB isn't supported\n" ); +return -EIO ; + }Shouldn't this be if (!nand_info->marking_block_bad)?
Quoted 14 lines
+/*
+ * Claims all blocks are good.
+ *
+ * In principle, this function is *only* called when the NAND Flash MTD system + * isn't allowed to keep an in-memory bad block table, so it is forced to ask + * the driver for bad block information.
+ *
+ * In fact, we permit the NAND Flash MTD system to have an in-memory BBT, so + * this function is *only* called when we take it away.
+ *
+ * We take away the in-memory BBT when the user sets the "ignorebad" parameter, + * which indicates that all blocks should be reported good.
+ *
+ * Thus, this function is only called when we want *all* blocks to look
Quoted 8 lines
Review
Quoted 6 lines
good, + * so it *always* return success.
+ */
+static intmxs_nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)+{(quoted diff) +2
-0+ return 0; +}What/where is the "ignorebad" parameter?
Remnant from FSL code.
Quoted 10 lines
Other than when scrubbing (which has its own override), when would you want to do this?
Quoted 4 lines
+/*
+ * Nominally, the purpose of this function is to look for or create the bad + * block table. In fact, since the HIL calls this function at the very end ofHIL?
DTTO
Quoted 6 lines
Quoted 4 lines
+ * the initialization process started by
nand_scan(), and the HIL doesn't have a + * more formal mechanism, everyone "hooks" this function to continue the + * initialization process.Everyone? I only see diskonchip doing this.
DTTO
Quoted 5 lines
The
nand_base.ccode actually does have a split here (nand_scan_ident/nand_scan_tail), but U-Boot's glue code is too inflexible, and insists on callingnand_scan. The right fix is to let drivers call nand_scan_ident/nand_scan_tail themselves.
I can't test now, so this has to wait. I'd prefer to get this mainline and then start poking around fixing this.
Quoted 2 lines
-Scott
PATCH 9/15 iMX28: Add GPMI NAND driver
Quoted 17 lines · Marek Vasut
Quoted 15 lines · Scott Wood
drivers/mtd/nand/mxs_nand.c line 108
Quoted 12 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +12
-0+ desc = info->desc[i]; +memset (desc,0 ,sizeof (struct mxs_dma_desc )); + desc->address = (dma_addr_t )desc; + } + + info->desc_index =0 ; +} + +static inline uint32_t mxs_nand_ecc_chunk_cnt (uint32_t page_data_size) +{ +return page_data_size /MXS_NAND_CHUNK_DATA_CHUNK_SIZE ; +}No need for inline in .c files, GCC should take care of this automatically.
Quoted 1 line
Does it really ?
Very small functions (and anything used only once) get inlined automatically.
It might need the hint if you have a larger function that collapses down to something small due to constant propagation (and of course if it's a header or otherwise *must* be inlined), but usually it does a decent job on its own.
Quoted 4 lines
Quoted 2 lines
Hmm, I thought raw was just supposed to disable ECC, not change the layout from what is used in normal operation.
You see the page as is ... I see no problem with this part.
What if the raw access is being done to e.g. force bit flips for testing?
There seems to be a difference between U-Boot and Linux here.
Linux has this in mtd.h:
Quoted 1 line
*
MTD_OOB_RAW: mode to read oob and data without doing ECC checking
Doesn't say anything about layout.
Whereas U-Boot says:
Quoted 3 lines
* MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data * is inserted into the data. Thats a raw image of the * flash contents.
Linux used to say what U-Boot says, but changed in commit b64d39d8b03fea88417d53715ccbebf71d4dcc9f
This commit message includes the comment "Now MTD_OOB_RAW behaves just like MTD_OOB_PLACE, but doesn't do ECC validation".
So I think if you need something that changes the layout from normal operations, it needs to be a new mode. And it's about time to sync up U-Boot's NAND code with Linux again...
Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
(quoted diff) +2
-0+ /* + * There are fundamental incompatibilities between the i.MX GPMI NFCand + * the NAND Flash MTD model that make it essentially impossible
to
Quoted 11 lines
drivers/mtd/nand/mxs_nand.c line 907
Quoted 5 lines
write + * the out-of-band bytes.
drivers/mtd/nand/mxs_nand.c new file +4
-0+* +* We permit *ONE* exception. If the *intent* of writing the OOB is to +* mark a block bad, we can do that. +*/ Is this just an issue with writing OOB separately from the main data (which would also be an issue on MLC chips that don't allow multiple partial programming), or can you not even write user OOB bytes as part of a full page write?
Quoted 5 lines
Quoted 1 line
Based on
fake_ecc_layoutI'm guessing the latter.My understanding of the original FSL driver is that you should never be allowed to access the physical NAND media at all. Only through the driver, which does the magic.
I'm not talking about circumventing the driver, just accessing some user OOB bytes through it.
Quoted 7 lines
Quoted 4 lines
The
nand_base.ccode actually does have a split here (nand_scan_ident/nand_scan_tail), but U-Boot's glue code is too inflexible, and insists on callingnand_scan. The right fix is to let drivers call nand_scan_ident/nand_scan_tail themselves.I can't test now, so this has to wait. I'd prefer to get this mainline and then start poking around fixing this.
OK. It's been on my TODO list for a while now...
-Scott
PATCH v2 9/15 iMX28: Add GPMI NAND driver
Quoted 52 lines · Scott Wood
Quoted 18 lines · Marek Vasut
Quoted 16 lines · Scott Wood
drivers/mtd/nand/mxs_nand.c line 108
Quoted 12 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +12
-0+ desc = info->desc[i]; +memset (desc,0 ,sizeof (struct mxs_dma_desc )); + desc->address = (dma_addr_t )desc; + } + + info->desc_index =0 ; +} + +static inline uint32_t mxs_nand_ecc_chunk_cnt (uint32_t page_data_size) +{ +return page_data_size /MXS_NAND_CHUNK_DATA_CHUNK_SIZE ; +}No need for inline in .c files, GCC should take care of this automatically.
Quoted 1 line
Does it really ?
Very small functions (and anything used only once) get inlined automatically.
It might need the hint if you have a larger function that collapses down to something small due to constant propagation (and of course if it's a header or otherwise *must* be inlined), but usually it does a decent job on its own.
Quoted 4 lines
Quoted 2 lines
Hmm, I thought raw was just supposed to disable ECC, not change the layout from what is used in normal operation.
You see the page as is ... I see no problem with this part.
What if the raw access is being done to e.g. force bit flips for testing?
There seems to be a difference between U-Boot and Linux here.
Linux has this in
mtd.h:Quoted 2 lines
*
MTD_OOB_RAW: mode to read oob and data without doing ECC
checkingDoesn't say anything about layout.
Whereas U-Boot says:
Quoted 3 lines
*
MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob
data * is inserted into the data. Thats a raw
image of the * flash contents.Linux used to say what U-Boot says, but changed in commit
b64d39d8b03fea88417d53715ccbebf71d4dcc9f
Quoted 6 lines
This commit message includes the comment "Now
MTD_OOB_RAWbehaves just likeMTD_OOB_PLACE, but doesn't do ECC validation".So I think if you need something that changes the layout from normal operations, it needs to be a new mode. And it's about time to sync up U-Boot's NAND code with Linux again...
Well aren't you the maintainer that should take care of it ? ;-)
Quoted 18 lines
Quoted 18 lines
Quoted 4 lines
Quoted 4 lines
(quoted diff) +2
-0+ /* + * There are fundamental incompatibilities between the i.MX GPMI NFCand + * the NAND Flash MTD model that make it essentially impossible
to
Quoted 11 lines
Review
Quoted 5 lines
write + * the out-of-band bytes.
(quoted diff) +2
-0+ * + * We permit *ONE* exception. If the *intent* of writing the OOB isto + * mark a block bad, we can do that.
(quoted diff) +1
-0+ */Is this just an issue with writing OOB separately from the main data (which would also be an issue on MLC chips that don't allow multiple partial programming), or can you not even write user OOB bytes as part of a full page write?
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Based on
fake_ecc_layoutI'm guessing the latter.My understanding of the original FSL driver is that you should never be allowed to access the physical NAND media at all. Only through the driver, which does the magic.
I'm not talking about circumventing the driver, just accessing some user OOB bytes through it.
There are no user OOB bytes, the driver does the ECC so user has no need to write any OOB.
Quoted 12 lines
Quoted 8 lines
Quoted 5 lines
The
nand_base.ccode actually does have a split here (nand_scan_ident/nand_scan_tail), but U-Boot's glue code is too inflexible, and insists on callingnand_scan. The right fix is to let drivers call nand_scan_ident/nand_scan_tail themselves.I can't test now, so this has to wait. I'd prefer to get this mainline and then start poking around fixing this.
OK. It's been on my TODO list for a while now...
-Scott
PATCH 9/15 iMX28: Add GPMI NAND driver
Quoted 6 lines · Marek Vasut
Quoted 3 lines · Scott Wood
So I think if you need something that changes the layout from normal operations, it needs to be a new mode. And it's about time to sync up U-Boot's NAND code with Linux again...
Well aren't you the maintainer that should take care of it ? ;-)
Yes, that note was me adding something to my todo list. :-)
Quoted 5 lines
Quoted 2 lines
I'm not talking about circumventing the driver, just accessing some user OOB bytes through it.
There are no user OOB bytes, the driver does the ECC so user has no need to write any OOB.
By "user OOB bytes" I meant things other than the ECC and the bad-block marker -- the space described by oobavail in ecclayout. This is getting less useful with partial-page restrictions and large ECC that fills up most of the OOB, though, and thus there's a trend away from making use of it. So if it's a pain to provide access to any spare OOB bytes, it's not that big of a deal.
-Scott
PATCH v2 9/15 iMX28: Add GPMI NAND driver
Quoted 16 lines · Scott Wood
Quoted 6 lines · Marek Vasut
Quoted 3 lines · Scott Wood
So I think if you need something that changes the layout from normal operations, it needs to be a new mode. And it's about time to sync up U-Boot's NAND code with Linux again...
Well aren't you the maintainer that should take care of it ? ;-)
Yes, that note was me adding something to my todo list. :-)
Quoted 5 lines
Quoted 2 lines
I'm not talking about circumventing the driver, just accessing some user OOB bytes through it.
There are no user OOB bytes, the driver does the ECC so user has no need to write any OOB.
Quoted 6 lines
By "user OOB bytes" I meant things other than the ECC and the bad-block marker -- the space described by oobavail in ecclayout. This is getting less useful with partial-page restrictions and large ECC that fills up most of the OOB, though, and thus there's a trend away from making use of it. So if it's a pain to provide access to any spare OOB bytes, it's not that big of a deal.
But I don't get it, you're still talking about OOB, but the OOB and the actual page make no difference here. They are used in the same manner. The OOB is spread across the page.
Quoted 2 lines
-Scott
PATCH v2 9/15 iMX28: Add GPMI NAND driver
In reply to Scott WoodQuoted 10 lines · Scott Wood
drivers/mtd/nand/mxs_nand.c line 96
Quoted 6 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +6
-0+static void mxs_nand_return_dma_descs (struct mxs_nand_info *info) +{ +int i = info->desc_index; +struct mxs_dma_desc *desc; + +for (--i; i >=0 ; i--) {This is an awkward construct.
Quoted 4 lines
Why not just the usual:
for (i = 0; i <
info->desc_index; i++)
Checking the driver, this modifies the global data so this is ok
PATCH 9/15 iMX28: Add GPMI NAND driver
Quoted 11 lines · Marek Vasut
Quoted 10 lines · Scott Wood
drivers/mtd/nand/mxs_nand.c line 96
Quoted 6 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +6
-0+static void mxs_nand_return_dma_descs (struct mxs_nand_info *info) +{ +int i = info->desc_index; +struct mxs_dma_desc *desc; + +for (--i; i >=0 ; i--) {This is an awkward construct.
Quoted 6 lines
Quoted 4 lines
Why not just the usual:
for (i = 0; i <
info->desc_index; i++)Checking the driver, this modifies the global data so this is ok
I don't follow... I'm assuming by "this" you mean the original code since you didn't change it, so are you saying that the global data has to be modified in descending order?
If that's really a requirement, put in a comment saying so (and ideally why), and you could still just do:
for (i = info->desc_index - 1; i >= 0; i--)
or
while (--i >= 0)
-Scott
PATCH v2 9/15 iMX28: Add GPMI NAND driver
In reply to Marek Vasut--- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1158 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1159 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/mxs_nand.c
V2: Update comments, drop inlines
drivers/mtd/nand/Makefile +1 -0
@@ -49,6 +49,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o +COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
drivers/mtd/nand/mxs_nand.c new file +1158 -0
1,158 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v3 9/15 iMX28: Add GPMI NAND driver
--- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1158 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1159 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/mxs_nand.c
V2: Update comments, drop inlines
V3: Fix descriptor reclamation loop
drivers/mtd/nand/Makefile +1 -0
@@ -49,6 +49,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o +COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
drivers/mtd/nand/mxs_nand.c new file +1158 -0
1,158 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v4 9/15 iMX28: Add GPMI NAND driver
--- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1127 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1128 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/mxs_nand.c
V2: Update comments, drop inlines
V3: Fix descriptor reclamation loop
V4: Trim bogus comments
drivers/mtd/nand/Makefile +1 -0
@@ -49,6 +49,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o +COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
drivers/mtd/nand/mxs_nand.c new file +1127 -0
1,127 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v5 9/15 iMX28: Add GPMI NAND driver
--- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1118 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1119 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/mxs_nand.c
V2: Update comments, drop inlines
V3: Fix descriptor reclamation loop
V4: Trim bogus comments
V5: Remove redundant mxs_nand_aux_size() function (gcc 4.6 finding)
drivers/mtd/nand/Makefile +1 -0
@@ -49,6 +49,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o +COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
drivers/mtd/nand/mxs_nand.c new file +1118 -0
1,118 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v5 9/15 iMX28: Add GPMI NAND driver
Quoted 20 lines · Marek Vasut
+/*
+ * There are several places in this driver where we have to handle the OOB and
+ * block marks. This is the function where things are the most complicated, so
+ * this is where we try to explain it all. All the other places refer back to
+ * here.
+ *
+ * These are the rules, in order of decreasing importance:
+ *
+ * 1) Nothing the caller does can be allowed to imperil the block mark, so all
+ * write operations take measures to protect it.
+ *
+ * 2) In read operations, the first byte of the OOB we return must reflect the
+ * true state of the block mark, no matter where that block mark appears in
+ * the physical page.
+ *
+ * 3) ECC-based read operations return an OOB full of set bits (since we never
+ * allow ECC-based writes to the OOB, it doesn't matter what ECC-based reads
+ * return).
+ *
+ * 4) "Raw" read operations return a direct view of the physical bytes in the
Quoted 3 lines
+ * page, using the conventional definition of which bytes are data and which + * are OOB. This gives the caller a way to see the actual, physical bytes + * in the page, without the distortions applied by our ECC engine.
As discussed, #4 is not a "rule" of the Linux/U-Boot NAND interface. If it's something you're doing as a hack, then say so -- make it clear that you're deviating from the normal interface.
Otherwise, Acked-By: Scott Wood <[email protected]>
-Scott
PATCH v2 10/15 iMX28: Add driver for internal RTC
In reply to Marek Vasut--- drivers/rtc/Makefile | 1 + drivers/rtc/mxsrtc.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 drivers/rtc/mxsrtc.c
drivers/rtc/Makefile +1 -0
@@ -56,6 +56,7 @@ COBJS-$(CONFIG_RTC_MK48T59) += mk48t59.o COBJS-$(CONFIG_RTC_MPC5200) += mpc5xxx.o COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o COBJS-$(CONFIG_RTC_MV) += mvrtc.o +COBJS-$(CONFIG_RTC_MXS) += mxsrtc.o COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o COBJS-$(CONFIG_RTC_PL031) += pl031.o COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
drivers/rtc/mxsrtc.c new file +86 -0
86 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 11/15 iMX28: Add image header generator tool
In reply to Marek VasutThis tool can now generate proper image for "BootStream" files.
NOTE: This tool now works only for NAND.
--- tools/Makefile | 6 + tools/mxsboot.c | 687 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 693 insertions(+), 0 deletions(-) create mode 100644 tools/mxsboot.c
tools/Makefile +6 -0
@@ -67,6 +67,7 @@ BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX) BIN_FILES-y += mkimage$(SFX) +BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
@@ -90,6 +91,7 @@ NOPED_OBJ_FILES-y += kwbimage.o NOPED_OBJ_FILES-y += imximage.o NOPED_OBJ_FILES-y += omapimage.o NOPED_OBJ_FILES-y += mkimage.o +OBJ_FILES-$(CONFIG_MX28) += mxsboot.o OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o NOPED_OBJ_FILES-y += os_support.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
@@ -204,6 +206,10 @@ $(obj)mpc86x_clk$(SFX): $(obj)mpc86x_clk.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ +$(obj)mxsboot$(SFX): $(obj)mxsboot.o + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + $(obj)ncb$(SFX): $(obj)ncb.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@
tools/mxsboot.c new file +687 -0
687 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 11/15 iMX28: Add image header generator tool
Quoted 5 lines · On Monday, September 12, 2011 00:06:45 Marek Vasut wrote:
tools/Makefile | 6 + tools/mxsboot.c | 687 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 693 insertions(+), 0 deletions(-) create mode 100644 tools/mxsboot.c
missing .gitignore update
tools/mxsboot.c line 34
Quoted 12 lines
tools/mxsboot.c new file +9
-0+#include <fcntl.h> +#include <malloc.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h>
drop the malloc.h and probably add compiler.h
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110912/900353f7/attachment.pgp
PATCH v2 11/15 iMX28: Add image header generator tool
Quoted 10 lines · Mike Frysinger
Quoted 7 lines · On Monday, September 12, 2011 00:06:45 Marek Vasut wrote:
tools/Makefile | 6 + tools/mxsboot.c | 687+++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 693 insertions(+), 0 deletions(-)
create mode 100644 tools/mxsboot.cmissing .gitignore update
Ignore what?
Quoted 4 lines
Quoted 4 lines
tools/mxsboot.c new file +0
-0
Quoted 12 lines
tools/mxsboot.c line 34
Quoted 9 lines
tools/mxsboot.c new file +9
-0+#include <fcntl.h> +#include <malloc.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> drop the
malloc.hand probably addcompiler.h
-mike
Cheers
PATCH 11/15 iMX28: Add image header generator tool
Quoted 5 lines · On Monday, September 12, 2011 13:40:35 Marek Vasut wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Monday, September 12, 2011 00:06:45 Marek Vasut wrote:
tools/Makefile | 6 + tools/mxsboot.c | 687
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
+++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 693 insertions(+), 0 deletions(-)
create mode 100644 tools/mxsboot.cmissing .gitignore update
Ignore what?
the "mxsboot" tool of course
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110912/f6034b8a/attachment.pgp
PATCH v2 11/15 iMX28: Add image header generator tool
Quoted 9 lines · Mike Frysinger
Quoted 8 lines · On Monday, September 12, 2011 13:40:35 Marek Vasut wrote:
Quoted 7 lines · Mike Frysinger
Quoted 6 lines · On Monday, September 12, 2011 00:06:45 Marek Vasut wrote:
tools/Makefile | 6 + tools/mxsboot.c | 687+++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 693 insertions(+), 0 deletions(-)
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
create mode 100644 tools/mxsboot.cmissing .gitignore update
Ignore what?
the "mxsboot" tool of course
-mike
Oh of course ! Thanks ;-)
PATCH v2 11/15 iMX28: Add image header generator tool
In reply to Marek VasutThis tool can now generate proper image for "BootStream" files.
NOTE: This tool now works only for NAND.
--- tools/.gitignore | 1 + tools/Makefile | 6 + tools/mxsboot.c | 684 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 691 insertions(+), 0 deletions(-) create mode 100644 tools/mxsboot.c
V2: Add missing .gitignore entry
tools/.gitignore +1 -0
@@ -4,6 +4,7 @@ /img2srec /mkimage /mpc86x_clk +/mxsboot /ncb /ncp /ubsha1
tools/Makefile +6 -0
@@ -67,6 +67,7 @@ BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX) BIN_FILES-y += mkimage$(SFX) +BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
@@ -90,6 +91,7 @@ NOPED_OBJ_FILES-y += kwbimage.o NOPED_OBJ_FILES-y += imximage.o NOPED_OBJ_FILES-y += omapimage.o NOPED_OBJ_FILES-y += mkimage.o +OBJ_FILES-$(CONFIG_MX28) += mxsboot.o OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o NOPED_OBJ_FILES-y += os_support.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
@@ -204,6 +206,10 @@ $(obj)mpc86x_clk$(SFX): $(obj)mpc86x_clk.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ +$(obj)mxsboot$(SFX): $(obj)mxsboot.o + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + $(obj)ncb$(SFX): $(obj)ncb.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@
tools/mxsboot.c new file +684 -0
684 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 12/15 iMX28: Add u-boot.sb target to Makefile
In reply to Marek Vasut--- Makefile | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
Makefile +5 -0
@@ -398,6 +398,10 @@ $(obj)u-boot.ubl: $(obj)u-boot-nand.bin $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin + elftosb -zdf imx28 -c board/denx/m28evk/u-boot.bd \ + -o $(obj)u-boot.sb + GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
@@ -980,6 +984,7 @@ clobber: clean @rm -f $(obj)u-boot.kwb @rm -f $(obj)u-boot.imx @rm -f $(obj)u-boot.ubl + @rm -f $(obj)u-boot.sb @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
Signature · 1 line
1.7.5.4
PATCH 12/15 iMX28: Add u-boot.sb target to Makefile
Makefile $(obj)u-boot.ubl: $(obj)u-boot-nand.bin · line 403
Quoted 9 lines · On Monday, September 12, 2011 00:06:46 Marek Vasut wrote:
Makefile | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)Makefile +3
-0+$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin + elftosb -zdf imx28 -c board/denx/m28evk/u-boot.bd \ + -o $(obj)u-boot.sb
generated files should probably be in .gitignore too
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110912/de2f5e1c/attachment.pgp
PATCH v2 12/15 iMX28: Add u-boot.sb target to Makefile
Quoted 7 lines · Mike Frysinger
Quoted 6 lines · On Monday, September 12, 2011 00:06:46 Marek Vasut wrote:
Makefile | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)Makefile +0
-0
Quoted 6 lines
Makefile $(obj)u-boot.ubl: $(obj)u-boot-nand.bin · line 403
Quoted 3 lines
+$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
Makefile +2
-0+ elftosb -zdf imx28 -c board/denx/m28evk/u-boot.bd \ + -o $(obj)u-boot.sbgenerated files should probably be in .gitignore too -mike
u-boot.sb added, thanks. Will be in V3
PATCH v2 12/15 iMX28: Add u-boot.sb target to Makefile
In reply to Marek Vasut--- .gitignore | 1 + Makefile | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-)
V2: Add missing .gitignore entry
.gitignore +1 -0
@@ -34,6 +34,7 @@ /u-boot.dis /u-boot.lds /u-boot.ubl +/u-boot.sb # # Generated files
Makefile +5 -0
@@ -398,6 +398,10 @@ $(obj)u-boot.ubl: $(obj)u-boot-nand.bin $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin + elftosb -zdf imx28 -c board/denx/m28evk/u-boot.bd \ + -o $(obj)u-boot.sb + GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
@@ -980,6 +984,7 @@ clobber: clean @rm -f $(obj)u-boot.kwb @rm -f $(obj)u-boot.imx @rm -f $(obj)u-boot.ubl + @rm -f $(obj)u-boot.sb @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
Signature · 1 line
1.7.5.4
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
In reply to Marek VasutThis contains support for the following components:
- DUART
- MMC
- Both FEC interfaces
- NAND
- I2C (RTC, EEPROM)
- SPI (FLASH)
--- MAINTAINERS | 1 + board/denx/m28evk/Makefile | 49 ++++++++ board/denx/m28evk/m28evk.c | 195 ++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/m28evk.h | 281 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 527 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 include/configs/m28evk.h
MAINTAINERS +1 -0
@@ -847,6 +847,7 @@ Marek Vasut <[email protected]> palmtc xscale/pxa vpac270 xscale/pxa zipitz2 xscale/pxa + m28evk i.MX28 efikamx i.MX51 Hugo Villeneuve <[email protected]>
board/denx/m28evk/Makefile new file +49 -0
49 lines not on this page · raw message
board/denx/m28evk/m28evk.c new file +195 -0
195 lines not on this page · raw message
boards.cfg +1 -0
@@ -147,6 +147,7 @@ jadecpu arm arm926ejs jadecpu syteco zmx25 arm arm926ejs zmx25 syteco mx25 imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 +m28evk arm arm926ejs - denx mx28 nhk8815 arm arm926ejs nhk8815 st nomadik nhk8815_onenand arm arm926ejs nhk8815 st nomadik nhk8815:BOOT_ONENAND omap5912osk arm arm926ejs - ti omap
include/configs/m28evk.h new file +281 -0
281 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
This contains support for the following components:
- DUART
- MMC
- Both FEC interfaces
- NAND
- I2C (RTC, EEPROM)
- SPI (FLASH)
--- MAINTAINERS | 1 + board/denx/m28evk/Makefile | 49 ++++++++ board/denx/m28evk/m28evk.c | 195 ++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/m28evk.h | 281 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 527 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 include/configs/m28evk.h
V2: Use scrub -y instead of scrub.quiet in the scripts.
MAINTAINERS +1 -0
@@ -847,6 +847,7 @@ Marek Vasut <[email protected]> palmtc xscale/pxa vpac270 xscale/pxa zipitz2 xscale/pxa + m28evk i.MX28 efikamx i.MX51 Hugo Villeneuve <[email protected]>
board/denx/m28evk/Makefile new file +49 -0
49 lines not on this page · raw message
board/denx/m28evk/m28evk.c new file +195 -0
195 lines not on this page · raw message
boards.cfg +1 -0
@@ -147,6 +147,7 @@ jadecpu arm arm926ejs jadecpu syteco zmx25 arm arm926ejs zmx25 syteco mx25 imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 +m28evk arm arm926ejs - denx mx28 nhk8815 arm arm926ejs nhk8815 st nomadik nhk8815_onenand arm arm926ejs nhk8815 st nomadik nhk8815:BOOT_ONENAND omap5912osk arm arm926ejs - ti omap
include/configs/m28evk.h new file +281 -0
281 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
board/denx/m28evk/Makefile line 40
Quoted 8 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile new file +5
-0+clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend
pretty sure these dont get used anywhere
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110913/f5505875/attachment.pgp
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
Quoted 11 lines · Mike Frysinger
board/denx/m28evk/Makefile line 40
Quoted 8 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile new file +5
-0+clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .dependpretty sure these dont get used anywhere
I suppose make clean would be the thing ?
Quoted 1 line
-mike
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
Quoted 13 lines · On Tuesday, September 13, 2011 23:17:48 Marek Vasut wrote:
Quoted 11 lines · Mike Frysinger
board/denx/m28evk/Makefile line 40
Quoted 8 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile new file +5
-0+clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .dependpretty sure these dont get used anywhere
Quoted 1 line
I suppose make clean would be the thing ?
if you read the top level Makefile, you'll see that there is no recursion for clean or distclean targets
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110913/60493ef8/attachment.pgp
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
Quoted 14 lines · Mike Frysinger
Quoted 13 lines · On Tuesday, September 13, 2011 23:17:48 Marek Vasut wrote:
Quoted 11 lines · Mike Frysinger
board/denx/m28evk/Makefile line 40
Quoted 8 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile new file +5
-0+clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .dependpretty sure these dont get used anywhere
Quoted 5 lines
Quoted 1 line
I suppose make clean would be the thing ?
if you read the top level
Makefile, you'll see that there is no recursion for clean or distclean targets
-mike
It makes sense, but then why does the rest of the boards still define it ? If there was some major cleanup on this matter, this should have been removed from the board Makefiles too.
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
Quoted 15 lines · On Wednesday, September 14, 2011 00:24:48 Marek Vasut wrote:
Quoted 14 lines · Mike Frysinger
Quoted 13 lines · On Tuesday, September 13, 2011 23:17:48 Marek Vasut wrote:
Quoted 11 lines · Mike Frysinger
board/denx/m28evk/Makefile line 40
Quoted 8 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile new file +5
-0+clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .dependpretty sure these dont get used anywhere
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
I suppose make clean would be the thing ?
if you read the top level
Makefile, you'll see that there is no recursion for clean or distclean targetsIt makes sense, but then why does the rest of the boards still define it ?
old cruft
Quoted 2 lines
If there was some major cleanup on this matter, this should have been removed from the board Makefiles too.
i dont know the exact sequence of events, but this is the current state of things. feel free to post a big cleanup patch :).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110914/48eb7cba/attachment.pgp
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
Quoted 24 lines · Mike Frysinger
Quoted 15 lines · On Wednesday, September 14, 2011 00:24:48 Marek Vasut wrote:
Quoted 14 lines · Mike Frysinger
Quoted 13 lines · On Tuesday, September 13, 2011 23:17:48 Marek Vasut wrote:
Quoted 11 lines · Mike Frysinger
board/denx/m28evk/Makefile line 40
Quoted 8 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile new file +5
-0+clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .dependpretty sure these dont get used anywhere
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
I suppose make clean would be the thing ?
if you read the top level
Makefile, you'll see that there is no recursion for clean or distclean targetsIt makes sense, but then why does the rest of the boards still define it ?
Quoted 7 lines
old cruft
Quoted 2 lines
If there was some major cleanup on this matter, this should have been removed from the board Makefiles too.
i dont know the exact sequence of events, but this is the current state of things. feel free to post a big cleanup patch :).
Not until I get confirmation from someone involved it really is an old useless crap.
Quoted 1 line
-mike
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
2011/9/14 Marek Vasut:
Quoted 27 lines · Mike Frysinger
Quoted 26 lines · On Wednesday, September 14, 2011 00:24:48 Marek Vasut wrote:
Quoted 15 lines · Mike Frysinger
Quoted 14 lines · On Tuesday, September 13, 2011 23:17:48 Marek Vasut wrote:
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile
Quoted 8 lines
board/denx/m28evk/Makefile new file +5
-0+clean: + ? rm -f $(OBJS) + +distclean: clean + ? rm -f $(LIB) core *.bak .dependpretty sure these dont get used anywhere
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
I suppose make clean would be the thing ?
if you read the top level
Makefile, you'll see that there is no recursion for clean or distclean targetsIt makes sense, but then why does the rest of the boards still define it ?
old cruft
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
If there was some major cleanup on this matter, this should have been removed from the board Makefiles too.
i dont know the exact sequence of events, but this is the current state of things. ?feel free to post a big cleanup patch :).
Not until I get confirmation from someone involved it really is an old useless crap.
lazy :P. i'll send a patch then.
(when i said "sequence of events", i meant change history which turned this into unused cruft)
-mike
PATCH v2 13/15 iMX28: Add support for DENX M28EVK board
Quoted 31 lines · Mike Frysinger
2011/9/14 Marek Vasut:
Quoted 30 lines · Mike Frysinger
Quoted 29 lines · On Wednesday, September 14, 2011 00:24:48 Marek Vasut wrote:
Quoted 15 lines · Mike Frysinger
Quoted 14 lines · On Tuesday, September 13, 2011 23:17:48 Marek Vasut wrote:
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · On Tuesday, September 13, 2011 18:29:38 Marek Vasut wrote:
board/denx/m28evk/Makefile
Quoted 8 lines
board/denx/m28evk/Makefile new file +5
-0+clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .dependpretty sure these dont get used anywhere
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
I suppose make clean would be the thing ?
if you read the top level
Makefile, you'll see that there is no recursion for clean or distclean targetsIt makes sense, but then why does the rest of the boards still define it ?
old cruft
Quoted 2 lines
If there was some major cleanup on this matter, this should have been removed from the board Makefiles too.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
i dont know the exact sequence of events, but this is the current state of things. feel free to post a big cleanup patch :).
Not until I get confirmation from someone involved it really is an old useless crap.
lazy :P.
Don't get me started ;-D
Quoted 1 line
i'll send a patch then.
Be sure to run it through makeall for all and every platform if necessary.
Quoted 3 lines
(when i said "sequence of events", i meant change history which turned this into unused cruft)
Sure, I got your point.
Quoted 1 line
-mike
PATCH v3 13/15 iMX28: Add support for DENX M28EVK board
In reply to Marek VasutThis contains support for the following components:
- DUART
- MMC
- Both FEC interfaces
- NAND
- I2C (RTC, EEPROM)
- SPI (FLASH)
--- MAINTAINERS | 1 + board/denx/m28evk/Makefile | 49 ++++++++ board/denx/m28evk/m28evk.c | 195 ++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/m28evk.h | 282 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 528 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 include/configs/m28evk.h
V2: Use scrub -y instead of scrub.quiet in the scripts.
V3: Use CONFIG_ENV_RANGE
MAINTAINERS +1 -0
@@ -847,6 +847,7 @@ Marek Vasut <[email protected]> palmtc xscale/pxa vpac270 xscale/pxa zipitz2 xscale/pxa + m28evk i.MX28 efikamx i.MX51 Hugo Villeneuve <[email protected]>
board/denx/m28evk/Makefile new file +49 -0
49 lines not on this page · raw message
board/denx/m28evk/m28evk.c new file +195 -0
195 lines not on this page · raw message
boards.cfg +1 -0
@@ -147,6 +147,7 @@ jadecpu arm arm926ejs jadecpu syteco zmx25 arm arm926ejs zmx25 syteco mx25 imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 +m28evk arm arm926ejs - denx mx28 nhk8815 arm arm926ejs nhk8815 st nomadik nhk8815_onenand arm arm926ejs nhk8815 st nomadik nhk8815:BOOT_ONENAND omap5912osk arm arm926ejs - ti omap
include/configs/m28evk.h new file +282 -0
282 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 14/15 M28: Add MMC SPL
In reply to Marek VasutThis patch adds SPL code for the M28 board.
--- board/denx/m28evk/Makefile | 8 + board/denx/m28evk/m28_init.h | 36 ++ board/denx/m28evk/mem_init.c | 213 +++++++++ board/denx/m28evk/mmc_boot.c | 273 ++++++++++++ board/denx/m28evk/power_init.c | 911 ++++++++++++++++++++++++++++++++++++++ board/denx/m28evk/start.S | 396 +++++++++++++++++ board/denx/m28evk/u-boot-spl.lds | 87 ++++ board/denx/m28evk/u-boot.bd | 14 + include/configs/m28evk.h | 8 + 9 files changed, 1946 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/m28_init.h create mode 100644 board/denx/m28evk/mem_init.c create mode 100644 board/denx/m28evk/mmc_boot.c create mode 100644 board/denx/m28evk/power_init.c create mode 100644 board/denx/m28evk/start.S create mode 100644 board/denx/m28evk/u-boot-spl.lds create mode 100644 board/denx/m28evk/u-boot.bd
board/denx/m28evk/Makefile +8 -0
@@ -25,7 +25,13 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).o +ifndef CONFIG_SPL_BUILD COBJS := m28evk.o +endif + +ifdef CONFIG_SPL_BUILD +COBJS := mem_init.o mmc_boot.o power_init.o +endif SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
@@ -33,6 +39,8 @@ OBJS := $(addprefix $(obj),$(COBJS)) $(LIB): $(obj).depend $(OBJS) $(call cmd_link_o_target, $(OBJS)) +all: $(ALL) + clean: rm -f $(OBJS)
board/denx/m28evk/m28_init.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Freescale i.MX28 SPL functions +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +*/ + +#ifndef __M28_INIT_H__ +#define __M28_INIT_H__ + +void early_delay (int delay); + +void mx28_power_init (void ); +void mx28_power_wait_pswitch (void ); + +void mx28_mem_init (void ); + +#endif /* __M28_INIT_H__ */
board/denx/m28evk/mem_init.c new file +213 -0
213 lines not on this page · raw message
board/denx/m28evk/mmc_boot.c new file +273 -0
273 lines not on this page · raw message
board/denx/m28evk/power_init.c new file +911 -0
911 lines not on this page · raw message
board/denx/m28evk/start.S new file +396 -0
396 lines not on this page · raw message
board/denx/m28evk/u-boot-spl.lds new file +87 -0
87 lines not on this page · raw message
board/denx/m28evk/u-boot.bd new file +14 -0
@@ -0,0 +1,14 @@ +sources { + u_boot_spl="spl/u-boot-spl.bin"; + u_boot="u-boot.bin"; +} + +section (0) { + load u_boot_spl > 0x0000; + load ivt (entry = 0x0014) > 0x8000; + hab call 0x8000; + + load u_boot > 0x40000100; + load ivt (entry = 0x40000100) > 0x8000; + hab call 0x8000; +}
include/configs/m28evk.h +8 -0
@@ -43,6 +43,14 @@#define CONFIG_ARCH_CPU_INIT /* +* SPL +*/ +#define CONFIG_SPL +#define CONFIG_SPL_NO_CPU_SUPPORT_CODE +#define CONFIG_SPL_START_S_PATH "board/denx/m28evk" +#define CONFIG_SPL_LDSCRIPT "board/denx/m28evk/u-boot-spl.lds" + +/* * U-Boot Commands */ #include <config_cmd_default.h>
Signature · 1 line
1.7.5.4
PATCH v2 14/15 M28: Add MMC SPL
This patch adds SPL code for the M28 board.
--- board/denx/m28evk/Makefile | 8 + board/denx/m28evk/m28_init.h | 41 ++ board/denx/m28evk/mem_init.c | 213 +++++++++ board/denx/m28evk/mmc_boot.c | 273 ++++++++++++ board/denx/m28evk/power_init.c | 913 ++++++++++++++++++++++++++++++++++++++ board/denx/m28evk/start.S | 396 +++++++++++++++++ board/denx/m28evk/u-boot-spl.lds | 87 ++++ board/denx/m28evk/u-boot.bd | 14 + include/configs/m28evk.h | 8 + 9 files changed, 1953 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/m28_init.h create mode 100644 board/denx/m28evk/mem_init.c create mode 100644 board/denx/m28evk/mmc_boot.c create mode 100644 board/denx/m28evk/power_init.c create mode 100644 board/denx/m28evk/start.S create mode 100644 board/denx/m28evk/u-boot-spl.lds create mode 100644 board/denx/m28evk/u-boot.bd
V2: Make waiting for powerswitch to be pressed configurable
board/denx/m28evk/Makefile +8 -0
@@ -25,7 +25,13 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).o +ifndef CONFIG_SPL_BUILD COBJS := m28evk.o +endif + +ifdef CONFIG_SPL_BUILD +COBJS := mem_init.o mmc_boot.o power_init.o +endif SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
@@ -33,6 +39,8 @@ OBJS := $(addprefix $(obj),$(COBJS)) $(LIB): $(obj).depend $(OBJS) $(call cmd_link_o_target, $(OBJS)) +all: $(ALL) + clean: rm -f $(OBJS)
board/denx/m28evk/m28_init.h new file +41 -0
41 lines not on this page · raw message
board/denx/m28evk/mem_init.c new file +213 -0
213 lines not on this page · raw message
board/denx/m28evk/mmc_boot.c new file +273 -0
273 lines not on this page · raw message
board/denx/m28evk/power_init.c new file +913 -0
913 lines not on this page · raw message
board/denx/m28evk/start.S new file +396 -0
396 lines not on this page · raw message
board/denx/m28evk/u-boot-spl.lds new file +87 -0
87 lines not on this page · raw message
board/denx/m28evk/u-boot.bd new file +14 -0
@@ -0,0 +1,14 @@ +sources { + u_boot_spl="spl/u-boot-spl.bin"; + u_boot="u-boot.bin"; +} + +section (0) { + load u_boot_spl > 0x0000; + load ivt (entry = 0x0014) > 0x8000; + hab call 0x8000; + + load u_boot > 0x40000100; + load ivt (entry = 0x40000100) > 0x8000; + hab call 0x8000; +}
include/configs/m28evk.h +8 -0
@@ -43,6 +43,14 @@#define CONFIG_ARCH_CPU_INIT /* +* SPL +*/ +#define CONFIG_SPL +#define CONFIG_SPL_NO_CPU_SUPPORT_CODE +#define CONFIG_SPL_START_S_PATH "board/denx/m28evk" +#define CONFIG_SPL_LDSCRIPT "board/denx/m28evk/u-boot-spl.lds" + +/* * U-Boot Commands */ #include <config_cmd_default.h>
Signature · 1 line
1.7.5.4
PATCH v3 14/15 M28: Add MMC SPL
This patch adds SPL code for the M28 board.
--- board/denx/m28evk/Makefile | 8 + board/denx/m28evk/m28_init.h | 41 ++ board/denx/m28evk/mem_init.c | 213 +++++++++ board/denx/m28evk/mmc_boot.c | 274 ++++++++++++ board/denx/m28evk/power_init.c | 913 ++++++++++++++++++++++++++++++++++++++ board/denx/m28evk/start.S | 396 +++++++++++++++++ board/denx/m28evk/u-boot-spl.lds | 87 ++++ board/denx/m28evk/u-boot.bd | 14 + include/configs/m28evk.h | 8 + 9 files changed, 1954 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/m28_init.h create mode 100644 board/denx/m28evk/mem_init.c create mode 100644 board/denx/m28evk/mmc_boot.c create mode 100644 board/denx/m28evk/power_init.c create mode 100644 board/denx/m28evk/start.S create mode 100644 board/denx/m28evk/u-boot-spl.lds create mode 100644 board/denx/m28evk/u-boot.bd
V2: Make waiting for powerswitch to be pressed configurable
V3: Squash checkpatch warning
board/denx/m28evk/Makefile +8 -0
@@ -25,7 +25,13 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).o +ifndef CONFIG_SPL_BUILD COBJS := m28evk.o +endif + +ifdef CONFIG_SPL_BUILD +COBJS := mem_init.o mmc_boot.o power_init.o +endif SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
@@ -33,6 +39,8 @@ OBJS := $(addprefix $(obj),$(COBJS)) $(LIB): $(obj).depend $(OBJS) $(call cmd_link_o_target, $(OBJS)) +all: $(ALL) + clean: rm -f $(OBJS)
board/denx/m28evk/m28_init.h new file +41 -0
41 lines not on this page · raw message
board/denx/m28evk/mem_init.c new file +213 -0
213 lines not on this page · raw message
board/denx/m28evk/mmc_boot.c new file +274 -0
274 lines not on this page · raw message
board/denx/m28evk/power_init.c new file +913 -0
913 lines not on this page · raw message
board/denx/m28evk/start.S new file +396 -0
396 lines not on this page · raw message
board/denx/m28evk/u-boot-spl.lds new file +87 -0
87 lines not on this page · raw message
board/denx/m28evk/u-boot.bd new file +14 -0
@@ -0,0 +1,14 @@ +sources { + u_boot_spl="spl/u-boot-spl.bin"; + u_boot="u-boot.bin"; +} + +section (0) { + load u_boot_spl > 0x0000; + load ivt (entry = 0x0014) > 0x8000; + hab call 0x8000; + + load u_boot > 0x40000100; + load ivt (entry = 0x40000100) > 0x8000; + hab call 0x8000; +}
include/configs/m28evk.h +8 -0
@@ -43,6 +43,14 @@#define CONFIG_ARCH_CPU_INIT /* +* SPL +*/ +#define CONFIG_SPL +#define CONFIG_SPL_NO_CPU_SUPPORT_CODE +#define CONFIG_SPL_START_S_PATH "board/denx/m28evk" +#define CONFIG_SPL_LDSCRIPT "board/denx/m28evk/u-boot-spl.lds" + +/* * U-Boot Commands */ #include <config_cmd_default.h>
Signature · 1 line
1.7.6.3
PATCH v2 15/15 M28: Add doc/README.m28 documentation
In reply to Marek Vasut--- doc/README.m28 | 223 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 223 insertions(+), 0 deletions(-) create mode 100644 doc/README.m28
doc/README.m28 new file +223 -0
@@ -0,0 +1,223 @@ +DENX M28EVK +=========== + +This document describes the DENX M28/M28EVK U-Boot port. This document mostly +covers topics related to making the module/board bootable. + +Terminology +----------- + +The dollar symbol ($) introduces a snipped of shell code. This shall be typed +into the unix command prompt in U-Boot source code root directory. + +The (=>) introduces a snipped of code that should by typed into U-Boot command +prompt. + +Contents +-------- + +0) Files of the M28/M28EVK port +1) Prerequisites +2) Compiling U-Boot for M28 +3) Installation of U-Boot for M28EVK to SD card +4) Installation of U-Boot for M28 to NAND flash + +0) Files of the M28/M28EVK port +------------------------------- + +arch/arm/cpu/arm926ejs/mx28/ - The CPU support code for the Freescale i.MX28 +arch/arm/include/asm/arch-mx28/ - Header files for the Freescale i.MX28 +board/denx/m28evk/ - M28EVK board specific files +include/configs/m28evk.h - M28EVK configuration file + +1) Prerequisites +---------------- + +To make the M28 module or the M28 module or M28EVK board bootable, some tools +are necessary. The first one is the "elftosb" tool distributed by Freescale +Semiconductor. The other tool is the "mxsboot" tool found in U-Boot source tree. + +Firstly, obtain the elftosb archive from the following location: + + http://foss.doredevelopment.dk/mirrors/imx/elftosb-10.12.01.tar.gz + +We use a $VER variable here to denote the current version. At the time of +writing of this document, that is "10.12.01". To obtain the file from command +line, use: + + $ VER="10.12.01" + $ wget http://foss.doredevelopment.dk/mirrors/imx/elftosb-${VER}.tar.gz + +Extract the file: + + $ tar xzf elftosb-${VER}.tar.gz + +Compile the file. We need to manually tell the linker to use also libm: + + $ cd elftosb-${VER}/ + $ make LIBS="-lstdc++ -lm" elftosb + +Optionally, remove debugging symbols from elftosb: + + $ strip bld/linux/elftosb + +Finally, install the "elftosb" binary. The "install" target is missing, so just +copy the binary by hand: + + $ sudo cp bld/linux/elftosb /usr/local/bin/ + +Make sure the "elftosb" binary can be found in your $PATH, in this case this +means "/usr/local/bin/" has to be in your $PATH. + +2) Compiling U-Boot for M28 +--------------------------- + +Compiling the U-Boot for M28 is straightforward and done as compiling U-Boot +for any other ARM device. For cross-compiler setup, please refer to ELDK5.0 +documentation. First, clean up the source code: + + $ make mrproper + +Next, configure U-Boot for M28EVK: + + $ make m28evk_config + +Lastly, compile U-Boot and prepare a "BootStream". The "BootStream" is a special +type of file, which the i.MX28 CPU can boot. This is handled by the following +command: + + $ make u-boot.sb + +HINT: To speed-up the build process, you can add -j<N>, where N is number of + compiler instances that'll run in parallel. + +The code produces "u-boot.sb" file. This file needs to be augmented with a +proper header to allow successful boot from SD or NAND. Adding the header is +discussed in the following chapters. + +3) Installation of U-Boot for M28EVK to SD card +----------------------------------------------- + +To boot an M28 from SD, set the boot mode DIP switches according to i.MX28 +manual chapter 12.2.1 (Table 12-2), PORT=SSP0, SD/MMC master on SSP0, 3.3V. + +An SD card the i.MX28 CPU can use to boot U-Boot must contain a DOS partition +table, which in turn carries a partition of special type and which contains a +special header. The rest of partitions in the DOS partition table can be used +by the user. + +To prepare such partition, use your favourite partitioning tool. The partition +must have the following parameters: + + * Start sector .......... sector 2048 + * Partition size ........ at least 1024 kb + * Partition type ........ 0x53 (sometimes "OnTrack DM6 Aux3") + +For example in Linux fdisk, the sequence for a clear card is the following: + + * o ..................... create a clear partition table + * n ..................... create new partition + * p ............. primary partition + * 1 ............. first partition + * 2048 .......... first sector is 2048 + * +1M ........... make the partition 1Mb big + * t 1 ................... change first partition ID + * 53 ............ change the ID to 0x53 (OnTrack DM6 Aux3) + * <create other partitions> + * w ..................... write partition table to disk + +The partition layout is ready, next the special partition must be filled with +proper contents. The contents is generated by running the following command (see +chapter 2)): + + $ ./tools/mxsboot sd u-boot.sb u-boot.sd + +The resulting file, "u-boot.sd", shall then be written to the partition. In this +case, we assume the first partition of the SD card is /dev/mmcblk0p1: + + $ dd if=u-boot.sd of=/dev/mmcblk0p1 + +Last step is to insert the card into M28EVK and boot. + +NOTE: If the user needs to adjust the start sector, the "mxsboot" tool contains + a "-p" switch for that purpose. The "-p" switch takes the sector number as + an argument. + +4) Installation of U-Boot for M28 to NAND flash +----------------------------------------------- + +To boot an M28 from NAND, set the boot mode DIP switches according to i.MX28 +manual chapter 12.2.1 (Table 12-2), PORT=GPMI, NAND 1.8 V. + +There are two possibilities when preparing an image writable to NAND flash. + + I) The NAND wasn't written at all yet or the BCB is broken + ---------------------------------------------------------- + In this case, both BCB (FCB and DBBT) and firmware needs to be + written to NAND. To generate NAND image containing all these, + there is a tool called "mxsboot" in the "tools/" directory. The tool + is invoked on "u-boot.sb" file from chapter 2): + + $ ./tools/mxsboot nand u-boot.sb u-boot.nand + + NOTE: The above invokation works for NAND flash with geometry of + 2048b per page, 64b OOB data, 128kb erase size. If your chip + has a different geometry, please use: + + -w <size> change page size (default 2048 b) + -o <size> change oob size (default 64 b) + -e <size> change erase size (default 131072 b) + + The geometry information can be obtained from running U-Boot + on M28 by issuing the "nand info" command. + + The resulting file, "u-boot.nand" can be written directly to NAND + from the U-Boot prompt. To simplify the process, the U-Boot default + environment contains script "update_nand_full" to update the system. + + This script expects a working TFTP server containing the file + "u-boot.nand" in it's root directory. This can be changed by + adjusting the "update_nand_full_filename" varible. + + To update the system, run the following in U-Boot prompt: + + => run update_nand_full + + In case you would only need to update the bootloader in future, + see II) below. + + II) The NAND was already written with a good BCB + ------------------------------------------------ + This part applies after the part I) above was done at least once. + + If part I) above was done correctly already, there is no need to + write the FCB and DBBT parts of NAND again. It's possible to upgrade + only the bootloader image. + + To simplify the process of firmware update, the U-Boot default + environment contains script "update_nand_firmware" to update only + the firmware, without rewriting FCB and DBBT. + + This script expects a working TFTP server containing the file + "u-boot.sb" in it's root directory. This can be changed by + adjusting the "update_nand_firmware_filename" varible. + + To update the system, run the following in U-Boot prompt: + + => run update_nand_firmware + + III) Special settings for the update scripts + -------------------------------------------- + There is a slight possibility of the user wanting to adjust the + STRIDE and COUNT options of the NAND boot. For description of these, + see i.MX28 manual section 12.12.1.2 and 12.12.1.3. + + The update scripts take this possibility into account. In case the + user changes STRIDE by blowing fuses, the user also has to change + "update_nand_stride" variable. In case the user changes COUNT by + blowing fuses, the user also has to change "update_nand_count" + variable for the update scripts to work correctly. + + In case the user needs to boot a firmware image bigger than 1Mb, the + user has to adjust the "update_nand_firmware_maxsz" variable for the + update scripts to work properly.
Signature · 1 line
1.7.5.4
v3 cover Support for the DENX M28 SoM
In reply to Marek VasutThis series adds support for DENX M28 SoM and M28EVK kit.
This series depends on previous series:
* Support for both FEC interfaces on i.MX28
* Random NAND fixes and improvements
* SPL modifications
V2: * Convert to SPL framework
* Squash patches together
* Fix pointed out issues
V3: * Add vector handling
* Add memory size detection for i.MX28
* Fix i.MX28 reset issues
* Squash errors in the GPMI NAND driver
* Support M28 V1.1 module
* Rebase to current u-boot-imx/master
9bf11bb55137618bc75aadb59810883bc02bab00
Marek Vasut (17):
iMX28: Initial support for iMX28 CPU
iMX28: Add SSP MMC driver
FEC: Add support for iMX28 quirks
iMX28: Add PINMUX control
iMX28: Add I2C bus driver
iMX28: Add GPIO control
iMX28: Add SPI driver
iMX28: Add APBH DMA driver
iMX28: Add GPMI NAND driver
iMX28: Add driver for internal RTC
iMX28: Add image header generator tool
iMX28: Add u-boot.sb target to Makefile
iMX28: Add support for DENX M28EVK board
M28: Add MMC SPL
M28: Add doc/README.m28 documentation
iMX28: Fix ARM vector handling
M28: Add memory detection into SPL
.gitignore | 1 + MAINTAINERS | 1 + Makefile | 5 + arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/iomux.c | 109 +++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 221 +++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/dma.h | 170 ++++ arch/arm/include/asm/arch-mx28/gpio.h | 32 + arch/arm/include/asm/arch-mx28/imx-regs.h | 39 + arch/arm/include/asm/arch-mx28/iomux-mx28.h | 537 +++++++++++ arch/arm/include/asm/arch-mx28/iomux.h | 168 ++++ arch/arm/include/asm/arch-mx28/regs-apbh.h | 466 +++++++++ arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 32 + board/denx/m28evk/Makefile | 62 ++ board/denx/m28evk/m28_init.h | 41 + board/denx/m28evk/m28evk.c | 209 ++++ board/denx/m28evk/mem_init.c | 240 +++++ board/denx/m28evk/mmc_boot.c | 273 ++++++ board/denx/m28evk/power_init.c | 913 ++++++++++++++++++ board/denx/m28evk/start.S | 234 +++++ board/denx/m28evk/u-boot-spl.lds | 87 ++ board/denx/m28evk/u-boot.bd | 14 + boards.cfg | 1 + doc/README.m28 | 223 +++++ drivers/dma/Makefile | 1 + drivers/dma/apbh_dma.c | 691 +++++++++++++ drivers/gpio/Makefile | 1 + drivers/gpio/mxs_gpio.c | 136 +++ drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 246 +++++ drivers/mmc/Makefile | 1 + drivers/mmc/mxsmmc.c | 351 +++++++ drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1118 +++++++++++++++++++++ drivers/net/fec_mxc.c | 44 +- drivers/rtc/Makefile | 1 + drivers/rtc/mxsrtc.c | 86 ++ drivers/spi/Makefile | 1 + drivers/spi/mxs_spi.c | 186 ++++ include/configs/m28evk.h | 291 ++++++ tools/.gitignore | 1 + tools/Makefile | 6 + tools/mxsboot.c | 684 +++++++++++++ 58 files changed, 12188 insertions(+), 2 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/iomux.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/dma.h create mode 100644 arch/arm/include/asm/arch-mx28/gpio.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/iomux-mx28.h create mode 100644 arch/arm/include/asm/arch-mx28/iomux.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-apbh.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28_init.h create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 board/denx/m28evk/mem_init.c create mode 100644 board/denx/m28evk/mmc_boot.c create mode 100644 board/denx/m28evk/power_init.c create mode 100644 board/denx/m28evk/start.S create mode 100644 board/denx/m28evk/u-boot-spl.lds create mode 100644 board/denx/m28evk/u-boot.bd create mode 100644 doc/README.m28 create mode 100644 drivers/dma/apbh_dma.c create mode 100644 drivers/gpio/mxs_gpio.c create mode 100644 drivers/i2c/mxs_i2c.c create mode 100644 drivers/mmc/mxsmmc.c create mode 100644 drivers/mtd/nand/mxs_nand.c create mode 100644 drivers/rtc/mxsrtc.c create mode 100644 drivers/spi/mxs_spi.c create mode 100644 include/configs/m28evk.h create mode 100644 tools/mxsboot.c
Signature · 1 line
1.7.6.3
PATCH RESEND v5 1/17 iMX28: Initial support for iMX28 CPU
This patch supports:
- Timers
- Debug UART
- Clock
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 46 + arch/arm/cpu/arm926ejs/mx28/clock.c | 355 +++++++ arch/arm/cpu/arm926ejs/mx28/mx28.c | 193 ++++ arch/arm/cpu/arm926ejs/mx28/timer.c | 141 +++ arch/arm/include/asm/arch-mx28/clock.h | 61 ++ arch/arm/include/asm/arch-mx28/imx-regs.h | 38 + arch/arm/include/asm/arch-mx28/regs-base.h | 88 ++ arch/arm/include/asm/arch-mx28/regs-bch.h | 230 +++++ arch/arm/include/asm/arch-mx28/regs-clkctrl.h | 312 ++++++ arch/arm/include/asm/arch-mx28/regs-common.h | 66 ++ arch/arm/include/asm/arch-mx28/regs-gpmi.h | 222 +++++ arch/arm/include/asm/arch-mx28/regs-i2c.h | 207 ++++ arch/arm/include/asm/arch-mx28/regs-ocotp.h | 173 ++++ arch/arm/include/asm/arch-mx28/regs-pinctrl.h | 1284 +++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/regs-power.h | 413 ++++++++ arch/arm/include/asm/arch-mx28/regs-rtc.h | 147 +++ arch/arm/include/asm/arch-mx28/regs-ssp.h | 349 +++++++ arch/arm/include/asm/arch-mx28/regs-timrot.h | 171 ++++ arch/arm/include/asm/arch-mx28/sys_proto.h | 30 + 19 files changed, 4526 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/Makefile create mode 100644 arch/arm/cpu/arm926ejs/mx28/clock.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/mx28.c create mode 100644 arch/arm/cpu/arm926ejs/mx28/timer.c create mode 100644 arch/arm/include/asm/arch-mx28/clock.h create mode 100644 arch/arm/include/asm/arch-mx28/imx-regs.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-base.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-bch.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-clkctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-common.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-gpmi.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-i2c.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ocotp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-pinctrl.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-power.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-rtc.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-ssp.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-timrot.h create mode 100644 arch/arm/include/asm/arch-mx28/sys_proto.h
V2: Use watchdog for reset
V3: Remove redundant power_regs from cpu_reset() (gcc4.6)
V4: Squash checkpatch issue
V5: Drop bogus include directive including so far nonexistent file
arch/arm/cpu/arm926ejs/mx28/Makefile new file +46 -0
@@ -0,0 +1,46 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd 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. +# +# 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$(SOC).o + +COBJS = clock.o mx28.o timer.o + +SRCS := $(START:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(LIB) + +$(LIB): $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
arch/arm/cpu/arm926ejs/mx28/clock.c new file +355 -0
355 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/mx28.c new file +193 -0
193 lines not on this page · raw message
arch/arm/cpu/arm926ejs/mx28/timer.c new file +141 -0
141 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/clock.h new file +61 -0
61 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/imx-regs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Freescale i.MX28 Registers +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __IMX_REGS_H__ +#define __IMX_REGS_H__ + +#include <asm/arch/regs-base.h> +#include <asm/arch/regs-bch.h> +#include <asm/arch/regs-clkctrl.h> +#include <asm/arch/regs-gpmi.h> +#include <asm/arch/regs-i2c.h> +#include <asm/arch/regs-ocotp.h> +#include <asm/arch/regs-pinctrl.h> +#include <asm/arch/regs-power.h> +#include <asm/arch/regs-rtc.h> +#include <asm/arch/regs-ssp.h> +#include <asm/arch/regs-timrot.h> + +#endif /* __IMX_REGS_H__ */
arch/arm/include/asm/arch-mx28/regs-base.h new file +88 -0
88 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-bch.h new file +230 -0
230 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-clkctrl.h new file +312 -0
312 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-common.h new file +66 -0
66 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-gpmi.h new file +222 -0
222 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-i2c.h new file +207 -0
207 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ocotp.h new file +173 -0
173 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-pinctrl.h new file +1284 -0
868 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-power.h new file +413 -0
413 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-rtc.h new file +147 -0
147 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-ssp.h new file +349 -0
349 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/regs-timrot.h new file +171 -0
171 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/sys_proto.h new file +30 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.6.3
Part of the diff is not shown here. View the raw message.
PATCH RESEND v3 2/17 iMX28: Add SSP MMC driver
In reply to Marek Vasut--- arch/arm/include/asm/arch-mx28/sys_proto.h | 2 + drivers/mmc/Makefile | 1 + drivers/mmc/mxsmmc.c | 351 ++++++++++++++++++++++++++++ 3 files changed, 354 insertions(+), 0 deletions(-) create mode 100644 drivers/mmc/mxsmmc.c
arch/arm/include/asm/arch-mx28/sys_proto.h +2 -0
@@ -27,4 +27,6 @@ int mx28_reset_block(struct mx28_register *reg);int mx28_wait_mask_set (struct mx28_register *reg,uint32_t mask,int timeout);int mx28_wait_mask_clr (struct mx28_register *reg,uint32_t mask,int timeout); +int mxsmmc_initialize (bd_t *bis,int id,int (*wp)(int )); +#endif /* __MX28_H__ */
drivers/mmc/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_MMC_SPI) += mmc_spi.o COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o COBJS-$(CONFIG_MV_SDHCI) += mv_sdhci.o COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o +COBJS-$(CONFIG_MXS_MMC) += mxsmmc.o COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o
drivers/mmc/mxsmmc.c new file +351 -0
351 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND 2/17 iMX28: Add SSP MMC driver
Quoted 5 lines · Marek Vasut
Signed-off-by Marek Vasut <[email protected]>Cc Andy Fleming <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>
I can't apply this because of the arch/arm/include/asm/arch-mx28/sys_proto.h change, which is a file that doesn't yet exist in mainline.
PATCH RESEND v3 2/17 iMX28: Add SSP MMC driver
Quoted 7 lines · Marek Vasut
Quoted 5 lines
Signed-off-by Marek Vasut <[email protected]>Cc Andy Fleming <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>
Quoted 5 lines
Acked-by Andy Fleming <[email protected]>I can't apply this because of the
arch/arm/include/asm/arch-mx28/sys_proto.hchange, which is a file that doesn't yet exist in mainline.
Andy, will it be OK to push it all through stefano's tree then ?
M
PATCH RESEND 2/17 iMX28: Add SSP MMC driver
Quoted 7 lines · Marek Vasut
Quoted 7 lines · Marek Vasut
Quoted 5 lines
Signed-off-by Marek Vasut <[email protected]>Cc Andy Fleming <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>
Quoted 7 lines
Quoted 5 lines
Acked-by Andy Fleming <[email protected]>I can't apply this because of the
arch/arm/include/asm/arch-mx28/sys_proto.hchange, which is a file that doesn't yet exist in mainline.Andy, will it be OK to push it all through stefano's tree then ?
Sure. I have actually delegated the patch to him.
Andy
PATCH RESEND 2/17 iMX28: Add SSP MMC driver
Quoted 10 lines · Andy Fleming
Quoted 9 lines · Marek Vasut
Quoted 9 lines · Marek Vasut
Quoted 5 lines
Signed-off-by Marek Vasut <[email protected]>Cc Andy Fleming <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>Acked-by Andy Fleming <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I can't apply this because of the
arch/arm/include/asm/arch-mx28/sys_proto.hchange, which is a file that doesn't yet exist in mainline.Andy, will it be OK to push it all through stefano's tree then ?
Sure. I have actually delegated the patch to him.
Ok, thanks . I will do it.
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH RESEND v3 2/17 iMX28: Add SSP MMC driver
Quoted 3 lines · Andy Fleming
Quoted 2 lines · Marek Vasut
Quoted 1 line
Quoted 1 line
On Fri, Oct 21, 2011 at 5:44 PM, Marek Vasut <[email protected]>
Quoted 12 lines · wrote:
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 5 lines
Signed-off-by Marek Vasut <[email protected]>Cc Andy Fleming <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>Acked-by Andy Fleming <[email protected]>I can't apply this because of the
arch/arm/include/asm/arch-mx28/sys_proto.hchange, which is a file that doesn't yet exist in mainline.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Andy, will it be OK to push it all through stefano's tree then ?
Sure. I have actually delegated the patch to him.
Ok, thanks . I will do it.
Stefano
Stefano, I'll rebase the patches and repost so you can apply. Can you rebase your u-boot-imx/master on top of u-boot-arm/master so I can use that? Thanks!
PATCH RESEND 2/17 iMX28: Add SSP MMC driver
Quoted 2 lines · Marek Vasut
Stefano, I'll rebase the patches and repost so you can apply. Can you rebase your u-boot-imx/master on top of u-boot-arm/master so I can use that? Thanks!
Done - you can take it
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================
PATCH RESEND v3 3/17 FEC: Add support for iMX28 quirks
In reply to Marek Vasut--- drivers/net/fec_mxc.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-)
drivers/net/fec_mxc.c +42 -2
@@ -42,6 +42,14 @@ DECLARE_GLOBAL_DATA_PTR;#define CONFIG_FEC_XCV_TYPE MII100#endif +/* +* The i.MX28 operates with packets in big endian. We need to swap them before +* sending and after receiving. +*/ +#ifdef CONFIG_MX28 +#define CONFIG_FEC_MXC_SWAP_PACKET +#endif +#undef DEBUGstruct nbuf {
@@ -51,6 +59,32 @@ struct nbuf {uint8_t head[16 ];/**< MAC header(6 + 6 + 2) + 2(aligned) */ }; +#ifdef CONFIG_FEC_MXC_SWAP_PACKET +static void swap_packet (uint32_t *packet,int length) +{ +int i; + +for (i =0 ; i <DIV_ROUND_UP (length,4 ); i++) + packet[i] =__swab32 (packet[i]); +} +#endif + +/* +* The i.MX28 has two ethernet interfaces, but they are not equal. +* Only the first one can access the MDIO bus. +*/ +#ifdef CONFIG_MX28 +static inline struct ethernet_regs *fec_miiphy_fec_to_eth (struct fec_priv *fec) +{ +return (struct ethernet_regs *)MXS_ENET0_BASE ; +} +#else +static inline struct ethernet_regs *fec_miiphy_fec_to_eth (struct fec_priv *fec) +{ +return fec->eth; +} +#endif +/* * MII-interface related functions */
@@ -59,7 +93,7 @@ static int fec_miiphy_read(const char *dev, uint8_t phyAddr, uint8_t regAddr, {struct eth_device *edev =eth_get_dev_by_name (dev);struct fec_priv *fec = (struct fec_priv *)edev->priv; -struct ethernet_regs *eth = fec->eth; +struct ethernet_regs *eth =fec_miiphy_fec_to_eth (fec);uint32_t reg;/* convenient holder for the PHY register */ uint32_t phy;/* convenient holder for the PHY */
@@ -117,7 +151,7 @@ static int fec_miiphy_write(const char *dev, uint8_t phyAddr, uint8_t regAddr, {struct eth_device *edev =eth_get_dev_by_name (dev);struct fec_priv *fec = (struct fec_priv *)edev->priv; -struct ethernet_regs *eth = fec->eth; +struct ethernet_regs *eth =fec_miiphy_fec_to_eth (fec);uint32_t reg;/* convenient holder for the PHY register */ uint32_t phy;/* convenient holder for the PHY */
@@ -572,6 +606,9 @@ static int fec_send(struct eth_device *dev, volatile void* packet, int length)* Note: We are always using the first buffer for transmission, * the second will be empty and only used to stop the DMA engine */ +#ifdef CONFIG_FEC_MXC_SWAP_PACKET +swap_packet ((uint32_t *)packet, length); +#endif writew (length, &fec->tbd_base[fec->tbd_index].data_length);writel ((uint32_t )packet, &fec->tbd_base[fec->tbd_index].data_pointer);/*
@@ -668,6 +705,9 @@ static int fec_recv(struct eth_device *dev)/* * Fill the buffer and pass it to upper layers */ +#ifdef CONFIG_FEC_MXC_SWAP_PACKET +swap_packet ((uint32_t *)frame->data, frame_length); +#endif memcpy (buff, frame->data, frame_length);NetReceive (buff, frame_length); len = frame_length;
Signature · 1 line
1.7.6.3
PATCH RESEND v3 4/17 iMX28: Add PINMUX control
In reply to Marek VasutTaken from Linux kernel with minor modifications:
commit bf985969e27b507f734435a99df8bf745a3dbb2b
Author: Shawn Guo <[email protected]> Date: Mon Dec 20 22:57:43 2010 +0800
ARM: mxs: Add iomux support
--- arch/arm/cpu/arm926ejs/mx28/Makefile | 2 +- arch/arm/cpu/arm926ejs/mx28/iomux.c | 109 ++++++ arch/arm/include/asm/arch-mx28/iomux-mx28.h | 537 +++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx28/iomux.h | 168 +++++++++ 4 files changed, 815 insertions(+), 1 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/mx28/iomux.c create mode 100644 arch/arm/include/asm/arch-mx28/iomux-mx28.h create mode 100644 arch/arm/include/asm/arch-mx28/iomux.h
arch/arm/cpu/arm926ejs/mx28/Makefile +1 -1
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).o -COBJS = clock.o mx28.o timer.o +COBJS = clock.o mx28.o iomux.o timer.o SRCS := $(START:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
arch/arm/cpu/arm926ejs/mx28/iomux.c new file +109 -0
109 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/iomux-mx28.h new file +537 -0
537 lines not on this page · raw message
arch/arm/include/asm/arch-mx28/iomux.h new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND v2 5/17 iMX28: Add I2C bus driver
In reply to Marek Vasut--- drivers/i2c/Makefile | 1 + drivers/i2c/mxs_i2c.c | 246 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/mxs_i2c.c
V2: Add "based on" text.
drivers/i2c/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o COBJS-$(CONFIG_I2C_MV) += mv_i2c.o COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o +COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.o COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
drivers/i2c/mxs_i2c.c new file +246 -0
246 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND v3 6/17 iMX28: Add GPIO control
In reply to Marek Vasut--- arch/arm/cpu/arm926ejs/mx28/mx28.c | 6 ++ arch/arm/include/asm/arch-mx28/gpio.h | 32 ++++++++ drivers/gpio/Makefile | 1 + drivers/gpio/mxs_gpio.c | 136 +++++++++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-mx28/gpio.h create mode 100644 drivers/gpio/mxs_gpio.c
arch/arm/cpu/arm926ejs/mx28/mx28.c +6 -0
@@ -31,6 +31,7 @@#include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/gpio.h> +#include <asm/arch/iomux.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h>
@@ -134,6 +135,11 @@ int arch_cpu_init(void)udelay (1000 ); +/* +* Configure GPIO unit +*/ +mxs_gpio_init (); + return 0; }#endif
arch/arm/include/asm/arch-mx28/gpio.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Freescale i.MX28 GPIO +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* 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 +* +*/ + +#ifndef __MX28_GPIO_H__ +#define __MX28_GPIO_H__ + +#ifdef CONFIG_MXS_GPIO +void mxs_gpio_init (void ); +#else +inline void mxs_gpio_init (void ) {} +#endif + +#endif /* __MX28_GPIO_H__ */
drivers/gpio/Makefile +1 -0
@@ -30,6 +30,7 @@ COBJS-$(CONFIG_KIRKWOOD_GPIO) += kw_gpio.o COBJS-$(CONFIG_MARVELL_GPIO) += mvgpio.o COBJS-$(CONFIG_MARVELL_MFP) += mvmfp.o COBJS-$(CONFIG_MXC_GPIO) += mxc_gpio.o +COBJS-$(CONFIG_MXS_GPIO) += mxs_gpio.o COBJS-$(CONFIG_PCA953X) += pca953x.o COBJS-$(CONFIG_S5P) += s5p_gpio.o COBJS-$(CONFIG_TEGRA2_GPIO) += tegra2_gpio.o
drivers/gpio/mxs_gpio.c new file +136 -0
136 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND v2 7/17 iMX28: Add SPI driver
In reply to Marek Vasut--- drivers/spi/Makefile | 1 + drivers/spi/mxs_spi.c | 186 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 0 deletions(-) create mode 100644 drivers/spi/mxs_spi.c
V2: Use the SPI API properly.
drivers/spi/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o +COBJS-$(CONFIG_MXS_SPI) += mxs_spi.o COBJS-$(CONFIG_OC_TINY_SPI) += oc_tiny_spi.o COBJS-$(CONFIG_OMAP3_SPI) += omap3_spi.o COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
drivers/spi/mxs_spi.c new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND v3 8/17 iMX28: Add APBH DMA driver
In reply to Marek Vasut--- arch/arm/include/asm/arch-mx28/dma.h | 170 +++++++ arch/arm/include/asm/arch-mx28/imx-regs.h | 1 + arch/arm/include/asm/arch-mx28/regs-apbh.h | 466 +++++++++++++++++++ drivers/dma/Makefile | 1 + drivers/dma/apbh_dma.c | 691 ++++++++++++++++++++++++++++ 5 files changed, 1329 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-mx28/dma.h create mode 100644 arch/arm/include/asm/arch-mx28/regs-apbh.h create mode 100644 drivers/dma/apbh_dma.c
arch/arm/include/asm/arch-mx28/dma.h new file +170 -0
@@ -0,0 +1,170 @@ +/* +* Freescale i.MX28 APBH DMA +* +* Copyright (C) 2011 Marek Vasut <[email protected]> +* on behalf of DENX Software Engineering GmbH +* +* Based on code from LTIB: +* Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. +* +* 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 +* +*/ + +#ifndef __DMA_H__ +#define __DMA_H__ + +#include <linux/list.h> + +#ifndef CONFIG_ARCH_DMA_PIO_WORDS +#define DMA_PIO_WORDS 15 +#else +#define DMA_PIO_WORDS CONFIG_ARCH_DMA_PIO_WORDS +#endif + +#define MXS_DMA_ALIGNMENT 32 + +/* +* MXS DMA channels +*/ +enum { +MXS_DMA_CHANNEL_AHB_APBH_SSP0 =0 , +MXS_DMA_CHANNEL_AHB_APBH_SSP1 , +MXS_DMA_CHANNEL_AHB_APBH_SSP2 , +MXS_DMA_CHANNEL_AHB_APBH_SSP3 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI0 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI1 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI2 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI3 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI4 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI5 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI6 , +MXS_DMA_CHANNEL_AHB_APBH_GPMI7 , +MXS_DMA_CHANNEL_AHB_APBH_SSP , +MXS_MAX_DMA_CHANNELS , +}; + +/* +* MXS DMA hardware command. +* +* This structure describes the in-memory layout of an entire DMA command, +* including space for the maximum number of PIO accesses. See the appropriate +* reference manual for a detailed description of what these fields mean to the +* DMA hardware. +*/ +#define MXS_DMA_DESC_COMMAND_MASK 0x3 +#define MXS_DMA_DESC_COMMAND_OFFSET 0 +#define MXS_DMA_DESC_COMMAND_NO_DMAXFER 0x0 +#define MXS_DMA_DESC_COMMAND_DMA_WRITE 0x1 +#define MXS_DMA_DESC_COMMAND_DMA_READ 0x2 +#define MXS_DMA_DESC_COMMAND_DMA_SENSE 0x3 +#define MXS_DMA_DESC_CHAIN (1 << 2) +#define MXS_DMA_DESC_IRQ (1 << 3) +#define MXS_DMA_DESC_NAND_LOCK (1 << 4) +#define MXS_DMA_DESC_NAND_WAIT_4_READY (1 << 5) +#define MXS_DMA_DESC_DEC_SEM (1 << 6) +#define MXS_DMA_DESC_WAIT4END (1 << 7) +#define MXS_DMA_DESC_HALT_ON_TERMINATE (1 << 8) +#define MXS_DMA_DESC_TERMINATE_FLUSH (1 << 9) +#define MXS_DMA_DESC_PIO_WORDS_MASK (0xf << 12) +#define MXS_DMA_DESC_PIO_WORDS_OFFSET 12 +#define MXS_DMA_DESC_BYTES_MASK (0xffff << 16) +#define MXS_DMA_DESC_BYTES_OFFSET 16 + +struct mxs_dma_cmd { +unsigned long next; +unsigned long data; +union { +dma_addr_t address; +unsigned long alternate; + }; +unsigned long pio_words[DMA_PIO_WORDS ]; +}; + +/* +* MXS DMA command descriptor. +* +* This structure incorporates an MXS DMA hardware command structure, along +* with metadata. +*/ +#define MXS_DMA_DESC_FIRST (1 << 0) +#define MXS_DMA_DESC_LAST (1 << 1) +#define MXS_DMA_DESC_READY (1 << 31) + +struct mxs_dma_desc { +struct mxs_dma_cmd cmd; +unsigned int flags; +dma_addr_t address; +void *buffer; +struct list_head node; +}; + +/** +* MXS DMA channel +* +* This structure represents a single DMA channel. The MXS platform code +* maintains an array of these structures to represent every DMA channel in the +* system (see mxs_dma_channels). +*/ +#define MXS_DMA_FLAGS_IDLE 0 +#define MXS_DMA_FLAGS_BUSY (1 << 0) +#define MXS_DMA_FLAGS_FREE 0 +#define MXS_DMA_FLAGS_ALLOCATED (1 << 16) +#define MXS_DMA_FLAGS_VALID (1 << 31) + +struct mxs_dma_chan { +const char *name; +unsigned long dev; +struct mxs_dma_device *dma; +unsigned int flags; +unsigned int active_num; +unsigned int pending_num; +struct list_head active; +struct list_head done; +}; + +/* Hardware management ops */ +int mxs_dma_enable (int channel); +int mxs_dma_disable (int channel); +int mxs_dma_reset (int channel); +int mxs_dma_freeze (int channel); +int mxs_dma_unfreeze (int channel); +int mxs_dma_read_semaphore (int channel); +int mxs_dma_enable_irq (int channel,int enable); +int mxs_dma_irq_is_pending (int channel); +int mxs_dma_ack_irq (int channel); + +/* Channel management ops */ +int mxs_dma_request (int channel); +int mxs_dma_release (int channel); + +/* Descriptor management ops */ +struct mxs_dma_desc *mxs_dma_desc_alloc (void ); +void mxs_dma_desc_free (struct mxs_dma_desc *); + +unsigned int mxs_dma_cmd_address (struct mxs_dma_desc *desc); +int mxs_dma_desc_pending (struct mxs_dma_desc *pdesc); + +int mxs_dma_desc_append (int channel,struct mxs_dma_desc *pdesc); + +int mxs_dma_get_finished (int channel,struct list_head *head); +int mxs_dma_finish (int channel,struct list_head *head); + +int mxs_dma_wait_complete (uint32_t timeout,unsigned int chan); +int mxs_dma_go (int chan); + +int mxs_dma_init (void ); + +#endif /* __DMA_H__ */
arch/arm/include/asm/arch-mx28/imx-regs.h +1 -0
@@ -23,6 +23,7 @@#ifndef __IMX_REGS_H__#define __IMX_REGS_H__ +#include <asm/arch/regs-apbh.h> #include <asm/arch/regs-base.h> #include <asm/arch/regs-bch.h> #include <asm/arch/regs-clkctrl.h>
arch/arm/include/asm/arch-mx28/regs-apbh.h new file +466 -0
466 lines not on this page · raw message
drivers/dma/Makefile +1 -0
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk LIB := $(obj)libdma.o COBJS-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o +COBJS-$(CONFIG_APBH_DMA) += apbh_dma.o COBJS-$(CONFIG_FSL_DMA) += fsl_dma.o COBJS := $(COBJS-y)
drivers/dma/apbh_dma.c new file +691 -0
691 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND v5 9/17 iMX28: Add GPMI NAND driver
In reply to Marek Vasut--- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mxs_nand.c | 1118 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1119 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/mxs_nand.c
V2: Update comments, drop inlines
V3: Fix descriptor reclamation loop
V4: Trim bogus comments
V5: Remove redundant mxs_nand_aux_size() function (gcc 4.6 finding)
drivers/mtd/nand/Makefile +1 -0
@@ -51,6 +51,7 @@ COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o +COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
drivers/mtd/nand/mxs_nand.c new file +1118 -0
1,118 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND v5 9/17 iMX28: Add GPMI NAND driver
Hi Marek,
Quoted 5 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +0
-0
<snip>
drivers/mtd/nand/mxs_nand.c line 1086
Quoted 1 line
drivers/mtd/nand/mxs_nand.c new file +1
-0+ nand->options |=NAND_NO_SUBPAGE_WRITE ;
I think we should change this a little bit. Unluckily I don't know what is the best way to fix it. As far as I have understood, the NAND_NO_SUBPAGE_WRITE is a chip option, not for a driver.
At nand_base.c ischip->options &= ~NAND_CHIPOPTIONS_MSK; chip->options |= type->options & NAND_CHIPOPTIONS_MSK; so the bit is masked out anyway and subpages are enabled.
After that UBI tries to read VID header at 512 by default. I had to use "ubi part root 2048" to override it. Besides of that driver seems to work fine.
--
Veli-Pekka Peltola
Bluegiga Technologies
PATCH RESEND v5 9/17 iMX28: Add GPMI NAND driver
Quoted 17 lines
Hi Marek,
Quoted 5 lines · Marek Vasut
drivers/mtd/nand/mxs_nand.c new file +0
-0<snip>
drivers/mtd/nand/mxs_nand.c line 1086
Quoted 1 line
drivers/mtd/nand/mxs_nand.c new file +1
-0+ nand->options |=NAND_NO_SUBPAGE_WRITE ;I think we should change this a little bit. Unluckily I don't know what is the best way to fix it. As far as I have understood, the
NAND_NO_SUBPAGE_WRITEis a chip option, not for a driver.
Quoted 8 lines
At
nand_base.cischip->options&= ~NAND_CHIPOPTIONS_MSK;chip->options|=type->options&NAND_CHIPOPTIONS_MSK; so the bit is masked out anyway and subpages are enabled.After that UBI tries to read VID header at 512 by default. I had to use "ubi part root 2048" to override it. Besides of that driver seems to work fine.
Can you please supply me with the commands that trigger such bug and the resulting problem you then see? So I can reproduce it and fix it? Thanks!
Quoted 4 lines
--
Veli-Pekka Peltola
Bluegiga Technologies
PATCH RESEND v5 9/17 iMX28: Add GPMI NAND driver
Quoted 2 lines · Marek Vasut
Can you please supply me with the commands that trigger such bug and the resulting problem you then see? So I can reproduce it and fix it? Thanks!
This procedure should trigger the problem:
mtdparts default; nand erase.part filesystem; ubi part filesystem; ubi part filesystem
You should see errors with second "ubi part filesystem" command like UBI
error: ubi_io_read: error -74 while reading 64 bytes from PEB 0:0, read 64 bytes.
You can force UBI not to use subpages (change 2048 to full size of your NAND page):
mtdparts default; nand erase.part filesystem; ubi part filesystem 2048; ubi part filesystem 2048
Please let me know if I can help you more somehow. Thanks!
--
Veli-Pekka Peltola
Bluegiga Technologies
PATCH RESEND v5 9/17 iMX28: Add GPMI NAND driver
Quoted 12 lines · Marek Vasut
Quoted 2 lines
Can you please supply me with the commands that trigger such bug and the resulting problem you then see? So I can reproduce it and fix it? Thanks!
This procedure should trigger the problem:
mtdparts default; nand erase.part filesystem; ubi part filesystem; ubi part filesystemYou should see errors with second "ubi part filesystem" command like UBI
error:ubi_io_read: error -74 while reading 64 bytes from PEB 0:0, read 64 bytes.
Quoted 6 lines
You can force UBI not to use subpages (change 2048 to full size of your NAND page):
mtdparts default; nand erase.part filesystem; ubi part filesystem 2048; ubi part filesystem 2048Please let me know if I can help you more somehow. Thanks!
Hi!
please test patch I just submitted, though I assume there'll be a huge discussion around it soon.
Quoted 4 lines
--
Veli-Pekka Peltola
Bluegiga Technologies
PATCH RESEND v3 10/17 iMX28: Add driver for internal RTC
In reply to Marek Vasut--- drivers/rtc/Makefile | 1 + drivers/rtc/mxsrtc.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 drivers/rtc/mxsrtc.c
drivers/rtc/Makefile +1 -0
@@ -57,6 +57,7 @@ COBJS-$(CONFIG_RTC_MK48T59) += mk48t59.o COBJS-$(CONFIG_RTC_MPC5200) += mpc5xxx.o COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o COBJS-$(CONFIG_RTC_MV) += mvrtc.o +COBJS-$(CONFIG_RTC_MXS) += mxsrtc.o COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o COBJS-$(CONFIG_RTC_PL031) += pl031.o COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
drivers/rtc/mxsrtc.c new file +86 -0
86 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH RESEND v2 11/17 iMX28: Add image header generator tool
In reply to Marek VasutThis tool can now generate proper image for "BootStream" files.
NOTE: This tool now works only for NAND.
--- tools/.gitignore | 1 + tools/Makefile | 6 + tools/mxsboot.c | 684 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 691 insertions(+), 0 deletions(-) create mode 100644 tools/mxsboot.c
V2: Add missing .gitignore entry
tools/.gitignore +1 -0
@@ -4,6 +4,7 @@ /img2srec /mkimage /mpc86x_clk +/mxsboot /ncb /ncp /ubsha1
tools/Makefile +6 -0
@@ -67,6 +67,7 @@ BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX) BIN_FILES-y += mkimage$(SFX) +BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
@@ -90,6 +91,7 @@ NOPED_OBJ_FILES-y += kwbimage.o NOPED_OBJ_FILES-y += imximage.o NOPED_OBJ_FILES-y += omapimage.o NOPED_OBJ_FILES-y += mkimage.o +OBJ_FILES-$(CONFIG_MX28) += mxsboot.o OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o NOPED_OBJ_FILES-y += os_support.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
@@ -204,6 +206,10 @@ $(obj)mpc86x_clk$(SFX): $(obj)mpc86x_clk.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ +$(obj)mxsboot$(SFX): $(obj)mxsboot.o + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + $(obj)ncb$(SFX): $(obj)ncb.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@
tools/mxsboot.c new file +684 -0
684 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH v3 12/17 iMX28: Add u-boot.sb target to Makefile
In reply to Marek Vasut--- .gitignore | 1 + Makefile | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-)
V2: Add missing .gitignore entry
V3: Use $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd instead of
board/denx/m28evk/u-boot.bd path in Makefile
.gitignore +1 -0
@@ -35,6 +35,7 @@ /u-boot.dis /u-boot.lds /u-boot.ubl +/u-boot.sb # # Generated files
Makefile +5 -0
@@ -403,6 +403,10 @@ $(obj)u-boot.ubl: $(obj)u-boot-nand.bin $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin + elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \ + -o $(obj)u-boot.sb + ifeq ($(CONFIG_SANDBOX),y) GEN_UBOOT = \ cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
@@ -973,6 +977,7 @@ clobber: clean @rm -f $(obj)u-boot.kwb @rm -f $(obj)u-boot.imx @rm -f $(obj)u-boot.ubl + @rm -f $(obj)u-boot.sb @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
Signature · 1 line
1.7.6.3
PATCH v4 13/17 iMX28: Add support for DENX M28EVK board
In reply to Marek VasutThis contains support for the following components:
- DUART
- MMC
- Both FEC interfaces
- NAND
- I2C (RTC, EEPROM)
- SPI (FLASH)
--- MAINTAINERS | 1 + board/denx/m28evk/Makefile | 49 ++++++++ board/denx/m28evk/m28evk.c | 195 ++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/m28evk.h | 282 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 528 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 include/configs/m28evk.h
V2: Use scrub -y instead of scrub.quiet in the scripts.
V3: Use CONFIG_ENV_RANGE
V4: Configure the RAM size to 128MB for V1.1 module
MAINTAINERS +1 -0
@@ -841,6 +841,7 @@ Marek Vasut <[email protected]> palmtc xscale/pxa vpac270 xscale/pxa zipitz2 xscale/pxa + m28evk i.MX28 efikamx i.MX51 efikasb i.MX51
board/denx/m28evk/Makefile new file +49 -0
49 lines not on this page · raw message
board/denx/m28evk/m28evk.c new file +195 -0
195 lines not on this page · raw message
boards.cfg +1 -0
@@ -152,6 +152,7 @@ tx25 arm arm926ejs tx25 karo zmx25 arm arm926ejs zmx25 syteco mx25 imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 +m28evk arm arm926ejs - denx mx28 nhk8815 arm arm926ejs nhk8815 st nomadik nhk8815_onenand arm arm926ejs nhk8815 st nomadik nhk8815:BOOT_ONENAND omap5912osk arm arm926ejs - ti omap
include/configs/m28evk.h new file +282 -0
282 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH v4 13/17 iMX28: Add support for DENX M28EVK board
Hi Marek,
Quoted 26 lines · Marek Vasut
This contains support for the following components:
- DUART
- MMC
- Both FEC interfaces
- NAND
- I2C (RTC, EEPROM)
- SPI (FLASH)Signed-off-by Marek Vasut <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Detlev Zundel <[email protected]>--- MAINTAINERS | 1 + board/denx/m28evk/Makefile | 49 ++++++++ board/denx/m28evk/m28evk.c | 195 ++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/m28evk.h | 282 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 528 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 include/configs/m28evk.hV2: Use scrub -y instead of scrub.quiet in the scripts.
V3: UseCONFIG_ENV_RANGE
V4: Configure the RAM size to 128MB for V1.1 module
[...]
Quoted 5 lines
board/denx/m28evk/Makefile new file +0
-0
[...]
board/denx/m28evk/Makefile line 40
Quoted 6 lines
board/denx/m28evk/Makefile new file +6
-0+ +clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend
These, should not be here anymore, right?
[...]
Signature · 2 lines
Regards, Igor.
PATCH v5 13/17 iMX28: Add support for DENX M28EVK board
In reply to Marek VasutThis contains support for the following components:
- DUART
- MMC
- Both FEC interfaces
- NAND
- I2C (RTC, EEPROM)
- SPI (FLASH)
--- MAINTAINERS | 1 + board/denx/m28evk/Makefile | 43 +++++++ board/denx/m28evk/m28evk.c | 195 ++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/m28evk.h | 282 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 522 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/Makefile create mode 100644 board/denx/m28evk/m28evk.c create mode 100644 include/configs/m28evk.h
V2: Use scrub -y instead of scrub.quiet in the scripts.
V3: Use CONFIG_ENV_RANGE
V4: Configure the RAM size to 128MB for V1.1 module
V5: Drop clean and distclean targets
MAINTAINERS +1 -0
@@ -841,6 +841,7 @@ Marek Vasut <[email protected]> palmtc xscale/pxa vpac270 xscale/pxa zipitz2 xscale/pxa + m28evk i.MX28 efikamx i.MX51 efikasb i.MX51
board/denx/m28evk/Makefile new file +43 -0
43 lines not on this page · raw message
board/denx/m28evk/m28evk.c new file +195 -0
195 lines not on this page · raw message
boards.cfg +1 -0
@@ -152,6 +152,7 @@ tx25 arm arm926ejs tx25 karo zmx25 arm arm926ejs zmx25 syteco mx25 imx27lite arm arm926ejs imx27lite logicpd mx27 magnesium arm arm926ejs imx27lite logicpd mx27 +m28evk arm arm926ejs - denx mx28 nhk8815 arm arm926ejs nhk8815 st nomadik nhk8815_onenand arm arm926ejs nhk8815 st nomadik nhk8815:BOOT_ONENAND omap5912osk arm arm926ejs - ti omap
include/configs/m28evk.h new file +282 -0
282 lines not on this page · raw message
Signature · 1 line
1.7.6.3
PATCH v4 14/17 M28: Add MMC SPL
In reply to Marek VasutThis patch adds SPL code for the M28 board.
--- board/denx/m28evk/Makefile | 8 + board/denx/m28evk/m28_init.h | 41 ++ board/denx/m28evk/mem_init.c | 213 +++++++++ board/denx/m28evk/mmc_boot.c | 273 ++++++++++++ board/denx/m28evk/power_init.c | 913 ++++++++++++++++++++++++++++++++++++++ board/denx/m28evk/start.S | 396 +++++++++++++++++ board/denx/m28evk/u-boot-spl.lds | 87 ++++ board/denx/m28evk/u-boot.bd | 14 + include/configs/m28evk.h | 8 + 9 files changed, 1953 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/m28_init.h create mode 100644 board/denx/m28evk/mem_init.c create mode 100644 board/denx/m28evk/mmc_boot.c create mode 100644 board/denx/m28evk/power_init.c create mode 100644 board/denx/m28evk/start.S create mode 100644 board/denx/m28evk/u-boot-spl.lds create mode 100644 board/denx/m28evk/u-boot.bd
V2: Make waiting for powerswitch to be pressed configurable
V3: Squash checkpatch warning
V4: Configure DUART on PWM pins for V1.1 module
board/denx/m28evk/Makefile +8 -0
@@ -25,7 +25,13 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).o +ifndef CONFIG_SPL_BUILD COBJS := m28evk.o +endif + +ifdef CONFIG_SPL_BUILD +COBJS := mem_init.o mmc_boot.o power_init.o +endif SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
@@ -33,6 +39,8 @@ OBJS := $(addprefix $(obj),$(COBJS)) $(LIB): $(obj).depend $(OBJS) $(call cmd_link_o_target, $(OBJS)) +all: $(ALL) + clean: rm -f $(OBJS)
board/denx/m28evk/m28_init.h new file +41 -0
41 lines not on this page · raw message
board/denx/m28evk/mem_init.c new file +213 -0
213 lines not on this page · raw message
board/denx/m28evk/mmc_boot.c new file +273 -0
273 lines not on this page · raw message
board/denx/m28evk/power_init.c new file +913 -0
913 lines not on this page · raw message
board/denx/m28evk/start.S new file +396 -0
396 lines not on this page · raw message
board/denx/m28evk/u-boot-spl.lds new file +87 -0
87 lines not on this page · raw message
board/denx/m28evk/u-boot.bd new file +14 -0
@@ -0,0 +1,14 @@ +sources { + u_boot_spl="spl/u-boot-spl.bin"; + u_boot="u-boot.bin"; +} + +section (0) { + load u_boot_spl > 0x0000; + load ivt (entry = 0x0014) > 0x8000; + hab call 0x8000; + + load u_boot > 0x40000100; + load ivt (entry = 0x40000100) > 0x8000; + hab call 0x8000; +}
include/configs/m28evk.h +8 -0
@@ -43,6 +43,14 @@#define CONFIG_ARCH_CPU_INIT /* +* SPL +*/ +#define CONFIG_SPL +#define CONFIG_SPL_NO_CPU_SUPPORT_CODE +#define CONFIG_SPL_START_S_PATH "board/denx/m28evk" +#define CONFIG_SPL_LDSCRIPT "board/denx/m28evk/u-boot-spl.lds" + +/* * U-Boot Commands */ #include <config_cmd_default.h>
Signature · 1 line
1.7.6.3
PATCH v4 14/17 M28: Add MMC SPL
Hi Marek,
Quoted 1 line · Marek Vasut
board/denx/m28evk/power_init.c | 913 ++++++++++++++++++++++++++++++++++++++
Shouldn't the power library functions go into arch/arm/cpu/arm926ejs/mx28/? They are not m28evk specific and should be re-usable by other MX28 boards.
rsc
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v5 14/17 M28: Add MMC SPL
In reply to Marek VasutThis patch adds SPL code for the M28 board.
--- board/denx/m28evk/Makefile | 8 + board/denx/m28evk/m28_init.h | 41 ++ board/denx/m28evk/mem_init.c | 213 +++++++++ board/denx/m28evk/mmc_boot.c | 273 ++++++++++++ board/denx/m28evk/power_init.c | 913 ++++++++++++++++++++++++++++++++++++++ board/denx/m28evk/start.S | 396 +++++++++++++++++ board/denx/m28evk/u-boot-spl.lds | 87 ++++ board/denx/m28evk/u-boot.bd | 14 + include/configs/m28evk.h | 8 + 9 files changed, 1953 insertions(+), 0 deletions(-) create mode 100644 board/denx/m28evk/m28_init.h create mode 100644 board/denx/m28evk/mem_init.c create mode 100644 board/denx/m28evk/mmc_boot.c create mode 100644 board/denx/m28evk/power_init.c create mode 100644 board/denx/m28evk/start.S create mode 100644 board/denx/m28evk/u-boot-spl.lds create mode 100644 board/denx/m28evk/u-boot.bd
V2: Make waiting for powerswitch to be pressed configurable
V3: Squash checkpatch warning
V4: Configure DUART on PWM pins for V1.1 module
V5: Drop clean and distclean targets
board/denx/m28evk/Makefile +8 -0
@@ -25,7 +25,13 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).o +ifndef CONFIG_SPL_BUILD COBJS := m28evk.o +endif + +ifdef CONFIG_SPL_BUILD +COBJS := mem_init.o mmc_boot.o power_init.o +endif SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
@@ -33,6 +39,8 @@ OBJS := $(addprefix $(obj),$(COBJS)) $(LIB): $(obj).depend $(OBJS) $(call cmd_link_o_target, $(OBJS)) +all: $(ALL) + ######################################################################### # defines $(obj).depend target
board/denx/m28evk/m28_init.h new file +41 -0
41 lines not on this page · raw message
board/denx/m28evk/mem_init.c new file +213 -0
213 lines not on this page · raw message
board/denx/m28evk/mmc_boot.c new file +273 -0
273 lines not on this page · raw message
board/denx/m28evk/power_init.c new file +913 -0
913 lines not on this page · raw message
board/denx/m28evk/start.S new file +396 -0
396 lines not on this page · raw message
board/denx/m28evk/u-boot-spl.lds new file +87 -0
87 lines not on this page · raw message
board/denx/m28evk/u-boot.bd new file +14 -0
@@ -0,0 +1,14 @@ +sources { + u_boot_spl="spl/u-boot-spl.bin"; + u_boot="u-boot.bin"; +} + +section (0) { + load u_boot_spl > 0x0000; + load ivt (entry = 0x0014) > 0x8000; + hab call 0x8000; + + load u_boot > 0x40000100; + load ivt (entry = 0x40000100) > 0x8000; + hab call 0x8000; +}
include/configs/m28evk.h +8 -0
@@ -43,6 +43,14 @@#define CONFIG_ARCH_CPU_INIT /* +* SPL +*/ +#define CONFIG_SPL +#define CONFIG_SPL_NO_CPU_SUPPORT_CODE +#define CONFIG_SPL_START_S_PATH "board/denx/m28evk" +#define CONFIG_SPL_LDSCRIPT "board/denx/m28evk/u-boot-spl.lds" + +/* * U-Boot Commands */ #include <config_cmd_default.h>
Signature · 1 line
1.7.6.3
PATCH RESEND v3 15/17 M28: Add doc/README.m28 documentation
In reply to Marek Vasut--- doc/README.m28 | 223 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 223 insertions(+), 0 deletions(-) create mode 100644 doc/README.m28
doc/README.m28 new file +223 -0
@@ -0,0 +1,223 @@ +DENX M28EVK +=========== + +This document describes the DENX M28/M28EVK U-Boot port. This document mostly +covers topics related to making the module/board bootable. + +Terminology +----------- + +The dollar symbol ($) introduces a snipped of shell code. This shall be typed +into the unix command prompt in U-Boot source code root directory. + +The (=>) introduces a snipped of code that should by typed into U-Boot command +prompt. + +Contents +-------- + +0) Files of the M28/M28EVK port +1) Prerequisites +2) Compiling U-Boot for M28 +3) Installation of U-Boot for M28EVK to SD card +4) Installation of U-Boot for M28 to NAND flash + +0) Files of the M28/M28EVK port +------------------------------- + +arch/arm/cpu/arm926ejs/mx28/ - The CPU support code for the Freescale i.MX28 +arch/arm/include/asm/arch-mx28/ - Header files for the Freescale i.MX28 +board/denx/m28evk/ - M28EVK board specific files +include/configs/m28evk.h - M28EVK configuration file + +1) Prerequisites +---------------- + +To make the M28 module or the M28 module or M28EVK board bootable, some tools +are necessary. The first one is the "elftosb" tool distributed by Freescale +Semiconductor. The other tool is the "mxsboot" tool found in U-Boot source tree. + +Firstly, obtain the elftosb archive from the following location: + + http://foss.doredevelopment.dk/mirrors/imx/elftosb-10.12.01.tar.gz + +We use a $VER variable here to denote the current version. At the time of +writing of this document, that is "10.12.01". To obtain the file from command +line, use: + + $ VER="10.12.01" + $ wget http://foss.doredevelopment.dk/mirrors/imx/elftosb-${VER}.tar.gz + +Extract the file: + + $ tar xzf elftosb-${VER}.tar.gz + +Compile the file. We need to manually tell the linker to use also libm: + + $ cd elftosb-${VER}/ + $ make LIBS="-lstdc++ -lm" elftosb + +Optionally, remove debugging symbols from elftosb: + + $ strip bld/linux/elftosb + +Finally, install the "elftosb" binary. The "install" target is missing, so just +copy the binary by hand: + + $ sudo cp bld/linux/elftosb /usr/local/bin/ + +Make sure the "elftosb" binary can be found in your $PATH, in this case this +means "/usr/local/bin/" has to be in your $PATH. + +2) Compiling U-Boot for M28 +--------------------------- + +Compiling the U-Boot for M28 is straightforward and done as compiling U-Boot +for any other ARM device. For cross-compiler setup, please refer to ELDK5.0 +documentation. First, clean up the source code: + + $ make mrproper + +Next, configure U-Boot for M28EVK: + + $ make m28evk_config + +Lastly, compile U-Boot and prepare a "BootStream". The "BootStream" is a special +type of file, which the i.MX28 CPU can boot. This is handled by the following +command: + + $ make u-boot.sb + +HINT: To speed-up the build process, you can add -j<N>, where N is number of + compiler instances that'll run in parallel. + +The code produces "u-boot.sb" file. This file needs to be augmented with a +proper header to allow successful boot from SD or NAND. Adding the header is +discussed in the following chapters. + +3) Installation of U-Boot for M28EVK to SD card +----------------------------------------------- + +To boot an M28 from SD, set the boot mode DIP switches according to i.MX28 +manual chapter 12.2.1 (Table 12-2), PORT=SSP0, SD/MMC master on SSP0, 3.3V. + +An SD card the i.MX28 CPU can use to boot U-Boot must contain a DOS partition +table, which in turn carries a partition of special type and which contains a +special header. The rest of partitions in the DOS partition table can be used +by the user. + +To prepare such partition, use your favourite partitioning tool. The partition +must have the following parameters: + + * Start sector .......... sector 2048 + * Partition size ........ at least 1024 kb + * Partition type ........ 0x53 (sometimes "OnTrack DM6 Aux3") + +For example in Linux fdisk, the sequence for a clear card is the following: + + * o ..................... create a clear partition table + * n ..................... create new partition + * p ............. primary partition + * 1 ............. first partition + * 2048 .......... first sector is 2048 + * +1M ........... make the partition 1Mb big + * t 1 ................... change first partition ID + * 53 ............ change the ID to 0x53 (OnTrack DM6 Aux3) + * <create other partitions> + * w ..................... write partition table to disk + +The partition layout is ready, next the special partition must be filled with +proper contents. The contents is generated by running the following command (see +chapter 2)): + + $ ./tools/mxsboot sd u-boot.sb u-boot.sd + +The resulting file, "u-boot.sd", shall then be written to the partition. In this +case, we assume the first partition of the SD card is /dev/mmcblk0p1: + + $ dd if=u-boot.sd of=/dev/mmcblk0p1 + +Last step is to insert the card into M28EVK and boot. + +NOTE: If the user needs to adjust the start sector, the "mxsboot" tool contains + a "-p" switch for that purpose. The "-p" switch takes the sector number as + an argument. + +4) Installation of U-Boot for M28 to NAND flash +----------------------------------------------- + +To boot an M28 from NAND, set the boot mode DIP switches according to i.MX28 +manual chapter 12.2.1 (Table 12-2), PORT=GPMI, NAND 1.8 V. + +There are two possibilities when preparing an image writable to NAND flash. + + I) The NAND wasn't written at all yet or the BCB is broken + ---------------------------------------------------------- + In this case, both BCB (FCB and DBBT) and firmware needs to be + written to NAND. To generate NAND image containing all these, + there is a tool called "mxsboot" in the "tools/" directory. The tool + is invoked on "u-boot.sb" file from chapter 2): + + $ ./tools/mxsboot nand u-boot.sb u-boot.nand + + NOTE: The above invokation works for NAND flash with geometry of + 2048b per page, 64b OOB data, 128kb erase size. If your chip + has a different geometry, please use: + + -w <size> change page size (default 2048 b) + -o <size> change oob size (default 64 b) + -e <size> change erase size (default 131072 b) + + The geometry information can be obtained from running U-Boot + on M28 by issuing the "nand info" command. + + The resulting file, "u-boot.nand" can be written directly to NAND + from the U-Boot prompt. To simplify the process, the U-Boot default + environment contains script "update_nand_full" to update the system. + + This script expects a working TFTP server containing the file + "u-boot.nand" in it's root directory. This can be changed by + adjusting the "update_nand_full_filename" varible. + + To update the system, run the following in U-Boot prompt: + + => run update_nand_full + + In case you would only need to update the bootloader in future, + see II) below. + + II) The NAND was already written with a good BCB + ------------------------------------------------ + This part applies after the part I) above was done at least once. + + If part I) above was done correctly already, there is no need to + write the FCB and DBBT parts of NAND again. It's possible to upgrade + only the bootloader image. + + To simplify the process of firmware update, the U-Boot default + environment contains script "update_nand_firmware" to update only + the firmware, without rewriting FCB and DBBT. + + This script expects a working TFTP server containing the file + "u-boot.sb" in it's root directory. This can be changed by + adjusting the "update_nand_firmware_filename" varible. + + To update the system, run the following in U-Boot prompt: + + => run update_nand_firmware + + III) Special settings for the update scripts + -------------------------------------------- + There is a slight possibility of the user wanting to adjust the + STRIDE and COUNT options of the NAND boot. For description of these, + see i.MX28 manual section 12.12.1.2 and 12.12.1.3. + + The update scripts take this possibility into account. In case the + user changes STRIDE by blowing fuses, the user also has to change + "update_nand_stride" variable. In case the user changes COUNT by + blowing fuses, the user also has to change "update_nand_count" + variable for the update scripts to work correctly. + + In case the user needs to boot a firmware image bigger than 1Mb, the + user has to adjust the "update_nand_firmware_maxsz" variable for the + update scripts to work properly.
Signature · 1 line
1.7.6.3
PATCH v3 16/17 iMX28: Fix ARM vector handling
In reply to Marek VasutThis patch introduces proper ARM vector handling for i.MX28 CPU. This issue wasn't addressed because the interrupts weren't enabled on any ARMv5 core, therefore the issue wasn't noticed earlier.
In previous implementation, the vectoring code used by i.MX28 CPU when an exception happened was that of the SPL. With this change, the branch target when an exception happens can be reconfigured by U-Boot.
--- arch/arm/cpu/arm926ejs/mx28/mx28.c | 22 +++ board/denx/m28evk/start.S | 264 +++++++----------------------------- include/configs/m28evk.h | 1 + 3 files changed, 74 insertions(+), 213 deletions(-)
arch/arm/cpu/arm926ejs/mx28/mx28.c +22 -0
@@ -35,6 +35,8 @@#include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> +DECLARE_GLOBAL_DATA_PTR ; +/* 1 second delay should be plenty of time for block reset. */ #define RESET_MAX_TIMEOUT 1000000
@@ -116,11 +118,31 @@ int mx28_reset_block(struct mx28_register *reg)return 0 ; } +void mx28_fixup_vt (uint32_t start_addr) +{ +uint32_t *vt = (uint32_t *)0x20 ; +int i; + +for (i =0 ; i <8 ; i++) + vt[i] = start_addr + (4 * i); +} + +#ifdef CONFIG_ARCH_MISC_INIT +int arch_misc_init (void ) +{ +mx28_fixup_vt (gd->relocaddr); +return 0 ; +} +#endif +#ifdef CONFIG_ARCH_CPU_INIT int arch_cpu_init (void ) {struct mx28_clkctrl_regs *clkctrl_regs = (struct mx28_clkctrl_regs *)MXS_CLKCTRL_BASE ; +extern uint32_t _start; + +mx28_fixup_vt ((uint32_t )&_start);/* * Enable NAND clock
board/denx/m28evk/start.S +51 -213
289 lines not on this page · raw message
include/configs/m28evk.h +1 -0
@@ -41,6 +41,7 @@#define CONFIG_SYS_DCACHE_OFF #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_ARCH_CPU_INIT +#define CONFIG_ARCH_MISC_INIT /* * SPL
Signature · 1 line
1.7.6.3
PATCH v3 17/17 M28: Add memory detection into SPL
In reply to Marek VasutThis code allows the DDR DRAM size to be detected at runtime. The RAM size is stored into two scratch registers, from which it is then fetched in U-Boot.
--- board/denx/m28evk/Makefile | 7 ++++++- board/denx/m28evk/m28evk.c | 18 ++++++++++++++++-- board/denx/m28evk/mem_init.c | 27 +++++++++++++++++++++++++++ include/configs/m28evk.h | 2 +- 4 files changed, 50 insertions(+), 4 deletions(-)
board/denx/m28evk/Makefile +6 -1
@@ -30,7 +30,7 @@ COBJS := m28evk.o endif ifdef CONFIG_SPL_BUILD -COBJS := mem_init.o mmc_boot.o power_init.o +COBJS := mem_init.o mmc_boot.o power_init.o memsize.o endif SRCS := $(COBJS:.o=.c)
@@ -47,6 +47,11 @@ clean: distclean: clean rm -f $(LIB) core *.bak .depend +ifdef CONFIG_SPL_BUILD +memsize.c: + ln -sf $(TOPDIR)/common/memsize.c $@ +endif + ######################################################################### # defines $(obj).depend target
board/denx/m28evk/m28evk.c +16 -2
@@ -63,10 +63,24 @@ int board_init(void)return 0 ; } +#define HW_DIGCTRL_SCRATCH0 0x8001c280 +#define HW_DIGCTRL_SCRATCH1 0x8001c290int dram_init (void ) { -/* dram_init must store complete ramsize in gd->ram_size */ - gd->ram_size =get_ram_size ((long *)PHYS_SDRAM_1 ,PHYS_SDRAM_1_SIZE ); +uint32_t sz[2 ]; + + sz[0 ] =readl (HW_DIGCTRL_SCRATCH0 ); + sz[1 ] =readl (HW_DIGCTRL_SCRATCH1 ); + +if (sz[0 ] != sz[1 ]) { +printf ("MX28:\n" +"Error, the RAM size in HW_DIGCTRL_SCRATCH0 and\n" +"HW_DIGCTRL_SCRATCH1 is not the same. Please\n" +"verify these two registers contain valid RAM size!\n" ); +hang (); + } + + gd->ram_size = sz[0 ];return 0 ; }
board/denx/m28evk/mem_init.c +27 -0
@@ -165,6 +165,31 @@ void mx28_mem_setup_vddd(void) &power_regs->hw_power_vdddctrl); } +#define HW_DIGCTRL_SCRATCH0 0x8001c280 +#define HW_DIGCTRL_SCRATCH1 0x8001c290 +void data_abort_memdetect_handler (void ) __attribute__((naked)); +void data_abort_memdetect_handler (void ) +{ + asmvolatile ("subs pc, r14, #4" ); +} + +void mx28_mem_get_size (void ) +{ +uint32_t sz, da; +uint32_t *vt = (uint32_t *)0x20 ; + +/* Replace the DABT handler. */ + da = vt[4 ]; + vt[4 ] = (uint32_t )&data_abort_memdetect_handler; + + sz =get_ram_size ((long *)PHYS_SDRAM_1 ,PHYS_SDRAM_1_SIZE ); +writel (sz,HW_DIGCTRL_SCRATCH0 ); +writel (sz,HW_DIGCTRL_SCRATCH1 ); + +/* Restore the old DABT handler. */ + vt[4 ] = da; +} +void mx28_mem_init (void ) { struct mx28_clkctrl_regs *clkctrl_regs =
@@ -210,4 +235,6 @@ void mx28_mem_init(void)early_delay (10000 );mx28_mem_setup_cpu_and_hbus (); + +mx28_mem_get_size (); }
include/configs/m28evk.h +1 -1
@@ -81,7 +81,7 @@*/ #define CONFIG_NR_DRAM_BANKS 1/* 2 banks of DRAM */ #define PHYS_SDRAM_1 0x40000000/* Base address */ -#define PHYS_SDRAM_1_SIZE 0x08000000/* 128 MB */ +#define PHYS_SDRAM_1_SIZE 0x40000000/* Max 1 GB RAM */ #define CONFIG_STACKSIZE 0x00010000/* 128 KB stack */ #define CONFIG_SYS_MALLOC_LEN 0x00400000/* 4 MB for malloc */ #define CONFIG_SYS_GBL_DATA_SIZE 128/* Initial data */
Signature · 1 line
1.7.6.3
PATCH v2 17/17 M28: Add memory detection into SPL
This code allows the DDR DRAM size to be detected at runtime. The RAM size is stored into two scratch registers, from which it is then fetched in U-Boot.
--- board/denx/m28evk/Makefile | 7 ++++++- board/denx/m28evk/m28evk.c | 18 ++++++++++++++++-- board/denx/m28evk/mem_init.c | 27 +++++++++++++++++++++++++++ include/configs/m28evk.h | 2 +- 4 files changed, 50 insertions(+), 4 deletions(-)
V2: Drop clean and distclean targets
board/denx/m28evk/Makefile +6 -1
@@ -30,7 +30,7 @@ COBJS := m28evk.o endif ifdef CONFIG_SPL_BUILD -COBJS := mem_init.o mmc_boot.o power_init.o +COBJS := mem_init.o mmc_boot.o power_init.o memsize.o endif SRCS := $(COBJS:.o=.c)
@@ -41,6 +41,11 @@ $(LIB): $(obj).depend $(OBJS) all: $(ALL) +ifdef CONFIG_SPL_BUILD +$(obj)/memsize.c: + ln -sf $(TOPDIR)/common/memsize.c $@ +endif + ######################################################################### # defines $(obj).depend target
board/denx/m28evk/m28evk.c +16 -2
@@ -63,10 +63,24 @@ int board_init(void)return 0 ; } +#define HW_DIGCTRL_SCRATCH0 0x8001c280 +#define HW_DIGCTRL_SCRATCH1 0x8001c290int dram_init (void ) { -/* dram_init must store complete ramsize in gd->ram_size */ - gd->ram_size =get_ram_size ((long *)PHYS_SDRAM_1 ,PHYS_SDRAM_1_SIZE ); +uint32_t sz[2 ]; + + sz[0 ] =readl (HW_DIGCTRL_SCRATCH0 ); + sz[1 ] =readl (HW_DIGCTRL_SCRATCH1 ); + +if (sz[0 ] != sz[1 ]) { +printf ("MX28:\n" +"Error, the RAM size in HW_DIGCTRL_SCRATCH0 and\n" +"HW_DIGCTRL_SCRATCH1 is not the same. Please\n" +"verify these two registers contain valid RAM size!\n" ); +hang (); + } + + gd->ram_size = sz[0 ];return 0 ; }
board/denx/m28evk/mem_init.c +27 -0
@@ -165,6 +165,31 @@ void mx28_mem_setup_vddd(void) &power_regs->hw_power_vdddctrl); } +#define HW_DIGCTRL_SCRATCH0 0x8001c280 +#define HW_DIGCTRL_SCRATCH1 0x8001c290 +void data_abort_memdetect_handler (void ) __attribute__((naked)); +void data_abort_memdetect_handler (void ) +{ + asmvolatile ("subs pc, r14, #4" ); +} + +void mx28_mem_get_size (void ) +{ +uint32_t sz, da; +uint32_t *vt = (uint32_t *)0x20 ; + +/* Replace the DABT handler. */ + da = vt[4 ]; + vt[4 ] = (uint32_t )&data_abort_memdetect_handler; + + sz =get_ram_size ((long *)PHYS_SDRAM_1 ,PHYS_SDRAM_1_SIZE ); +writel (sz,HW_DIGCTRL_SCRATCH0 ); +writel (sz,HW_DIGCTRL_SCRATCH1 ); + +/* Restore the old DABT handler. */ + vt[4 ] = da; +} +void mx28_mem_init (void ) { struct mx28_clkctrl_regs *clkctrl_regs =
@@ -210,4 +235,6 @@ void mx28_mem_init(void)early_delay (10000 );mx28_mem_setup_cpu_and_hbus (); + +mx28_mem_get_size (); }
include/configs/m28evk.h +1 -1
@@ -81,7 +81,7 @@*/ #define CONFIG_NR_DRAM_BANKS 1/* 2 banks of DRAM */ #define PHYS_SDRAM_1 0x40000000/* Base address */ -#define PHYS_SDRAM_1_SIZE 0x08000000/* 128 MB */ +#define PHYS_SDRAM_1_SIZE 0x40000000/* Max 1 GB RAM */ #define CONFIG_STACKSIZE 0x00010000/* 128 KB stack */ #define CONFIG_SYS_MALLOC_LEN 0x00400000/* 4 MB for malloc */ #define CONFIG_SYS_GBL_DATA_SIZE 128/* Initial data */
Signature · 1 line
1.7.6.3
PATCH v3 17/17 M28: Add memory detection into SPL
This code allows the DDR DRAM size to be detected at runtime. The RAM size is stored into two scratch registers, from which it is then fetched in U-Boot.
--- board/denx/m28evk/Makefile | 7 ++++++- board/denx/m28evk/m28evk.c | 18 ++++++++++++++++-- board/denx/m28evk/mem_init.c | 27 +++++++++++++++++++++++++++ include/configs/m28evk.h | 2 +- 4 files changed, 50 insertions(+), 4 deletions(-)
V2: Drop clean and distclean targets
V3: Drop $(obj) in front of memsize.c target
board/denx/m28evk/Makefile +6 -1
@@ -30,7 +30,7 @@ COBJS := m28evk.o endif ifdef CONFIG_SPL_BUILD -COBJS := mem_init.o mmc_boot.o power_init.o +COBJS := mem_init.o mmc_boot.o power_init.o memsize.o endif SRCS := $(COBJS:.o=.c)
@@ -41,6 +41,11 @@ $(LIB): $(obj).depend $(OBJS) all: $(ALL) +ifdef CONFIG_SPL_BUILD +memsize.c: + ln -sf $(TOPDIR)/common/memsize.c $@ +endif + ######################################################################### # defines $(obj).depend target
board/denx/m28evk/m28evk.c +16 -2
@@ -63,10 +63,24 @@ int board_init(void)return 0 ; } +#define HW_DIGCTRL_SCRATCH0 0x8001c280 +#define HW_DIGCTRL_SCRATCH1 0x8001c290int dram_init (void ) { -/* dram_init must store complete ramsize in gd->ram_size */ - gd->ram_size =get_ram_size ((long *)PHYS_SDRAM_1 ,PHYS_SDRAM_1_SIZE ); +uint32_t sz[2 ]; + + sz[0 ] =readl (HW_DIGCTRL_SCRATCH0 ); + sz[1 ] =readl (HW_DIGCTRL_SCRATCH1 ); + +if (sz[0 ] != sz[1 ]) { +printf ("MX28:\n" +"Error, the RAM size in HW_DIGCTRL_SCRATCH0 and\n" +"HW_DIGCTRL_SCRATCH1 is not the same. Please\n" +"verify these two registers contain valid RAM size!\n" ); +hang (); + } + + gd->ram_size = sz[0 ];return 0 ; }
board/denx/m28evk/mem_init.c +27 -0
@@ -165,6 +165,31 @@ void mx28_mem_setup_vddd(void) &power_regs->hw_power_vdddctrl); } +#define HW_DIGCTRL_SCRATCH0 0x8001c280 +#define HW_DIGCTRL_SCRATCH1 0x8001c290 +void data_abort_memdetect_handler (void ) __attribute__((naked)); +void data_abort_memdetect_handler (void ) +{ + asmvolatile ("subs pc, r14, #4" ); +} + +void mx28_mem_get_size (void ) +{ +uint32_t sz, da; +uint32_t *vt = (uint32_t *)0x20 ; + +/* Replace the DABT handler. */ + da = vt[4 ]; + vt[4 ] = (uint32_t )&data_abort_memdetect_handler; + + sz =get_ram_size ((long *)PHYS_SDRAM_1 ,PHYS_SDRAM_1_SIZE ); +writel (sz,HW_DIGCTRL_SCRATCH0 ); +writel (sz,HW_DIGCTRL_SCRATCH1 ); + +/* Restore the old DABT handler. */ + vt[4 ] = da; +} +void mx28_mem_init (void ) { struct mx28_clkctrl_regs *clkctrl_regs =
@@ -210,4 +235,6 @@ void mx28_mem_init(void)early_delay (10000 );mx28_mem_setup_cpu_and_hbus (); + +mx28_mem_get_size (); }
include/configs/m28evk.h +1 -1
@@ -81,7 +81,7 @@*/ #define CONFIG_NR_DRAM_BANKS 1/* 2 banks of DRAM */ #define PHYS_SDRAM_1 0x40000000/* Base address */ -#define PHYS_SDRAM_1_SIZE 0x08000000/* 128 MB */ +#define PHYS_SDRAM_1_SIZE 0x40000000/* Max 1 GB RAM */ #define CONFIG_STACKSIZE 0x00010000/* 128 KB stack */ #define CONFIG_SYS_MALLOC_LEN 0x00400000/* 4 MB for malloc */ #define CONFIG_SYS_GBL_DATA_SIZE 128/* Initial data */
Signature · 1 line
1.7.6.3