Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/imx i.MX51 support by SHIMIZU Ryo, Hashimoto Ke...
details: https://anonhg.NetBSD.org/src/rev/5d25df82b32a
branches: trunk
changeset: 758692:5d25df82b32a
user: bsh <bsh%NetBSD.org@localhost>
date: Sat Nov 13 07:11:02 2010 +0000
description:
i.MX51 support by SHIMIZU Ryo, Hashimoto Kenichi, and me.
diffstat:
sys/arch/arm/imx/files.imx51 | 105 ++
sys/arch/arm/imx/imx51_axi.c | 159 +++
sys/arch/arm/imx/imx51_intr.h | 304 ++++++
sys/arch/arm/imx/imx51_iomuxreg.h | 1653 +++++++++++++++++++++++++++++++++++++
sys/arch/arm/imx/imx51_tzic.c | 284 ++++++
sys/arch/arm/imx/imx51_tzicreg.h | 53 +
sys/arch/arm/imx/imx51reg.h | 295 ++++++
sys/arch/arm/imx/imx51var.h | 23 +
sys/arch/arm/imx/imx_dma.c | 67 +
sys/arch/arm/imx/imxi2creg.h | 24 +
sys/arch/arm/imx/imxkppreg.h | 53 +
sys/arch/arm/imx/imxsdmareg.h | 120 ++
sys/arch/arm/imx/imxssireg.h | 119 ++
sys/arch/arm/imx/imxwdogreg.h | 102 ++
14 files changed, 3361 insertions(+), 0 deletions(-)
diffs (truncated from 3417 to 300 lines):
diff -r 6ed11c3cc291 -r 5d25df82b32a sys/arch/arm/imx/files.imx51
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/imx/files.imx51 Sat Nov 13 07:11:02 2010 +0000
@@ -0,0 +1,105 @@
+# $NetBSD: files.imx51,v 1.1 2010/11/13 07:11:02 bsh Exp $
+#
+# Configuration info for the Freescale i.MX51
+#
+
+defparam opt_imx.h MEMSIZE
+defflag opt_imx.h IMX51
+
+define bus_dma_generic
+
+file arch/arm/imx/imx_space.c
+file arch/arm/imx/imx_dma.c bus_dma_generic needs-flag
+
+# iMX51 AXI/AHB bus interface and SoC domains
+device axi { [addr=-1], [size=0], [irq=-1], [irqbase=-1]} : bus_space_generic
+attach axi at mainbus
+file arch/arm/imx/imx51_axi.c axi
+
+# iMX51 TrustZone Interrupt Controller
+include "arch/arm/pic/files.pic"
+device tzic: pic
+attach tzic at axi
+file arch/arm/imx/imx51_tzic.c tzic needs-flag
+file arch/arm/arm32/irq_dispatch.S
+
+# iMX51 Enhanced Periodic Interrupt Timer
+device imxclock
+attach imxclock at axi
+file arch/arm/imx/imxclock.c
+file arch/arm/imx/imx51_clock.c
+
+# Clock Control Module
+device imxccm
+attach imxccm at axi
+file arch/arm/imx/imx51_ccm.c imxccm needs-flag
+
+# frequency of external low frequency clock
+# typically 32000, 32768, or 38400.
+defparam opt_imx51clk.h IMX51_CKIL_FREQ
+
+# frequency of on-chip oscillator. typeilcally 24000000.
+defparam opt_imx51clk.h IMX51_OSC_FREQ
+
+# following parameters are used when imxccm is not configured in the kernel.
+defparam opt_imx51clk.h IMX51_AHBCLK_FREQ
+defparam opt_imx51clk.h IMX51_IPGCLK_FREQ
+
+# iMX GPIO
+# device imxgpio: gpiobus
+# attach imxgpio at ahb
+# file arch/arm/imx/imx31_gpio.c imxgpio needs-flag
+
+# iMX IOMUX
+device imxiomux : bus_space_generic
+attach imxiomux at axi
+file arch/arm/imx/imx31_iomux.c imxiomux
+
+# LCD controller
+# device lcd : bus_dma_generic, wsemuldisplaydev, rasops16, rasops8, rasops4, rasops_rotation
+# file arch/arm/imx/imx31_lcd.c lcd needs-flag
+# defflag opt_imx31_lcd.h IMXLCDCONSOLE
+
+# iMX M3IF - Multi Master Memory Interface
+# iMX ESDCTL/MDDRC - Enhanced SDRAM/LPDDR memory controller
+# iMX PCMCIA - PCMCIA memory controller
+# iMX NANDFC - NAND Flash memory controller
+# iMX WEIM - Wireless External Interface Module
+
+# iMX UART
+device imxuart
+attach imxuart at axi
+file arch/arm/imx/imxuart.c imxuart needs-flag
+file arch/arm/imx/imx51_uart.c imxuart
+defflag opt_imxuart.h IMXUARTCONSOLE
+
+# attach ohci at ahb with ohci_ahb : bus_dma_generic
+# file arch/arm/imx/ochi_axi.c ohci_axi
+
+# attach wdc at ahb with wdc_ahb : bus_dma_generic
+# file arch/arm/imx/wdc_axi.c wdc_axi
+
+# SD host controller for SD/MMC
+# device imxmci: sdmmcbus
+# file arch/arm/imx/imx51_mci.c imxmci
+
+# iic Controler
+# device imxi2c: i2cbus
+# file arch/arm/imx/imx51_i2c.c imxi2c
+
+# attach imxi2c at aips with imxi2c_aips
+# file arch/arm/imx/imxi2c_aips.c imxi2c_aips
+
+# spi bus controlloer
+# device imxspi: spibus
+# file arch/arm/imx/imx51_spi.c imxspi
+
+# Smart Direct Memory Access Controller
+# device imxsdma: dmover_service, bus_dma_generic
+# attach imxsdma at ahb
+# file arch/arm/imx/imxsdma.c imxsdma
+# file arch/arm/imx/imxsdmaprog.c imxsdma
+
+# iis sound Controller (SSI module)
+# device imxi2s {} : bus_dma_generic
+# file arch/arm/imx/imx51_i2s.c imxi2s needs-flag
diff -r 6ed11c3cc291 -r 5d25df82b32a sys/arch/arm/imx/imx51_axi.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/imx/imx51_axi.c Sat Nov 13 07:11:02 2010 +0000
@@ -0,0 +1,159 @@
+/* $NetBSD: imx51_axi.c,v 1.1 2010/11/13 07:11:02 bsh Exp $ */
+
+/*-
+ * Copyright (c) 2010 SHIMIZU Ryo <ryo%nerv.org@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: imx51_axi.c,v 1.1 2010/11/13 07:11:02 bsh Exp $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/device.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <arm/imx/imx51reg.h>
+#include <arm/imx/imx51var.h>
+
+#include "locators.h"
+
+struct axi_softc {
+ device_t sc_dev;
+ bus_space_tag_t sc_iot;
+ bus_dma_tag_t sc_dmat;
+};
+
+static int axi_match(device_t, struct cfdata *, void *);
+static void axi_attach(device_t, device_t, void *);
+static int axi_search(device_t, struct cfdata *, const int *, void *);
+static int axi_critical_search(device_t, struct cfdata *, const int *, void *);
+static int axi_search(device_t, struct cfdata *, const int *, void *);
+static int axi_print(void *, const char *);
+
+CFATTACH_DECL_NEW(axi, sizeof(struct axi_softc),
+ axi_match, axi_attach, NULL, NULL);
+
+/* ARGSUSED */
+static int
+axi_match(device_t parent __unused, struct cfdata *match __unused,
+ void *aux __unused)
+{
+ return 1;
+}
+
+/* ARGSUSED */
+static void
+axi_attach(device_t parent __unused, device_t self, void *aux __unused)
+{
+ struct axi_softc *sc;
+ struct axi_attach_args aa;
+
+ aprint_normal(": Advanced eXtensible Interface\n");
+ aprint_naive("\n");
+
+ sc = device_private(self);
+ sc->sc_iot = &imx_bs_tag;
+#if NBUS_DMA_GENERIC > 0
+ sc->sc_dmat = &imx_bus_dma_tag;
+#else
+ sc->sc_dmat = 0;
+#endif
+
+ aa.aa_name = "axi";
+ aa.aa_iot = sc->sc_iot;
+ aa.aa_dmat = sc->sc_dmat;
+ config_search_ia(axi_critical_search, self, "axi", &aa);
+ config_search_ia(axi_search, self, "axi", &aa);
+}
+
+/* ARGSUSED */
+static int
+axi_critical_search(device_t parent, struct cfdata *cf,
+ const int *ldesc __unused, void *aux)
+{
+ struct axi_softc *sc;
+ struct axi_attach_args *aa;
+
+ sc = device_private(parent);
+ aa = aux;
+
+ if ((strcmp(cf->cf_name, "tzic") != 0) &&
+ (strcmp(cf->cf_name, "imxuart") != 0))
+ return 0;
+
+ aa->aa_addr = cf->cf_loc[AXICF_ADDR];
+ aa->aa_size = cf->cf_loc[AXICF_SIZE];
+ aa->aa_irq = cf->cf_loc[AXICF_IRQ];
+ aa->aa_irqbase = cf->cf_loc[AXICF_IRQBASE];
+
+ if (config_match(parent, cf, aux) > 0)
+ config_attach(parent, cf, aux, axi_print);
+
+ return 0;
+}
+
+
+/* ARGSUSED */
+static int
+axi_search(device_t parent, struct cfdata *cf, const int *ldesc __unused,
+ void *aux)
+{
+ struct axi_softc *sc;
+ struct axi_attach_args *aa;
+
+ sc = device_private(parent);
+ aa = aux;
+
+ aa->aa_addr = cf->cf_loc[AXICF_ADDR];
+ aa->aa_size = cf->cf_loc[AXICF_SIZE];
+ aa->aa_irq = cf->cf_loc[AXICF_IRQ];
+ aa->aa_irqbase = cf->cf_loc[AXICF_IRQBASE];
+
+ if (config_match(parent, cf, aux) > 0)
+ config_attach(parent, cf, aux, axi_print);
+
+ return 0;
+}
+
+/* ARGSUSED */
+static int
+axi_print(void *aux, const char *name __unused)
+{
+ struct axi_attach_args *aa = (struct axi_attach_args *)aux;
+
+ if (aa->aa_addr != AXICF_ADDR_DEFAULT) {
+ aprint_normal(" addr 0x%lx", aa->aa_addr);
+ if (aa->aa_size > AXICF_SIZE_DEFAULT)
+ aprint_normal("-0x%lx",
+ aa->aa_addr + aa->aa_size-1);
+ }
+ if (aa->aa_irq != AXICF_IRQ_DEFAULT)
+ aprint_normal(" intr %d", aa->aa_irq);
+ if (aa->aa_irqbase != AXICF_IRQBASE_DEFAULT)
+ aprint_normal(" irqbase %d", aa->aa_irqbase);
+
+ return (UNCONF);
+}
diff -r 6ed11c3cc291 -r 5d25df82b32a sys/arch/arm/imx/imx51_intr.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/imx/imx51_intr.h Sat Nov 13 07:11:02 2010 +0000
@@ -0,0 +1,304 @@
+/* $NetBSD: imx51_intr.h,v 1.1 2010/11/13 07:11:02 bsh Exp $ */
+/*-
+ * Copyright (c) 2009 SHIMIZU Ryo <ryo%nerv.org@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Home |
Main Index |
Thread Index |
Old Index