Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Get the EXYNOS kernel building again with recent FD...



details:   https://anonhg.NetBSD.org/src/rev/7891492d6265
branches:  trunk
changeset: 824592:7891492d6265
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jun 10 15:13:18 2017 +0000

description:
Get the EXYNOS kernel building again with recent FDT changes. Untested.

diffstat:

 sys/arch/arm/samsung/exynos5422_dma.c   |   77 ----
 sys/arch/arm/samsung/exynos_fdt.c       |   80 ----
 sys/arch/arm/samsung/exynos_intr.h      |   18 +-
 sys/arch/arm/samsung/exynos_platform.c  |  143 ++++++++
 sys/arch/arm/samsung/exynos_reg.h       |    6 +-
 sys/arch/arm/samsung/exynos_soc.c       |   48 +-
 sys/arch/arm/samsung/exynos_sscom.c     |  112 ++++-
 sys/arch/arm/samsung/files.exynos       |   35 +-
 sys/arch/arm/samsung/sscom.c            |   18 +-
 sys/arch/evbarm/conf/EXYNOS             |  321 +++--------------
 sys/arch/evbarm/conf/files.exynos       |   18 +-
 sys/arch/evbarm/conf/std.exynos         |   26 +-
 sys/arch/evbarm/exynos/exynos_machdep.c |  567 --------------------------------
 sys/arch/evbarm/exynos/platform.h       |    8 +-
 14 files changed, 345 insertions(+), 1132 deletions(-)

diffs (truncated from 1880 to 300 lines):

diff -r 4ad5b52795c6 -r 7891492d6265 sys/arch/arm/samsung/exynos5422_dma.c
--- a/sys/arch/arm/samsung/exynos5422_dma.c     Sat Jun 10 14:21:01 2017 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*     $NetBSD: exynos5422_dma.c,v 1.1 2015/12/11 04:05:54 marty Exp $ */
-
-/*-
- * Copyright (c) 2012 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Nick Hudson
- *
- * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``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 FOUNDATION OR CONTRIBUTORS
- * 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 "opt_exynos.h"
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos5422_dma.c,v 1.1 2015/12/11 04:05:54 marty Exp $");
-
-#define _ARM32_BUS_DMA_PRIVATE
-
-#include <sys/param.h>
-#include <sys/bus.h>
-
-#include <arm/samsung/exynos_reg.h>
-#include <arm/samsung/exynos_var.h>
-
-struct arm32_bus_dma_tag exynos_bus_dma_tag = {
-       _BUS_DMAMAP_FUNCS,
-       _BUS_DMAMEM_FUNCS,
-       _BUS_DMATAG_FUNCS,
-};
-
-struct arm32_dma_range exynos_coherent_dma_ranges[1] = {
-       [0] = {
-               .dr_sysbase = 0,        /* filled in */
-               .dr_busbase = 0,        /* filled in */
-               .dr_flags = _BUS_DMAMAP_COHERENT,
-       },
-};
-
-struct arm32_bus_dma_tag exynos_coherent_bus_dma_tag = {
-       ._ranges  = exynos_coherent_dma_ranges,
-       ._nranges = __arraycount(exynos_coherent_dma_ranges),
-       _BUS_DMAMAP_FUNCS,
-       _BUS_DMAMEM_FUNCS,
-       _BUS_DMATAG_FUNCS,
-};
-
-void
-exynos_dma_bootstrap(psize_t memsize)
-{
-       bus_addr_t dram_base =  EXYNOS5_SDRAM_PBASE;
-
-       KASSERT(dram_base);
-       exynos_coherent_dma_ranges[0].dr_sysbase = dram_base;
-       exynos_coherent_dma_ranges[0].dr_busbase = dram_base;
-       exynos_coherent_dma_ranges[0].dr_len = memsize;
-}
-
diff -r 4ad5b52795c6 -r 7891492d6265 sys/arch/arm/samsung/exynos_fdt.c
--- a/sys/arch/arm/samsung/exynos_fdt.c Sat Jun 10 14:21:01 2017 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/* $NetBSD: exynos_fdt.c,v 1.4 2017/04/16 15:52:16 jmcneill Exp $ */
-
-/*-
- * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@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 "opt_exynos.h"
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_fdt.c,v 1.4 2017/04/16 15:52:16 jmcneill Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-
-#include <machine/cpu.h>
-#include <sys/bus.h>
-
-#include <arm/mainbus/mainbus.h>
-#include <arm/samsung/exynos_reg.h>
-#include <arm/samsung/exynos_var.h>
-
-#include <dev/fdt/fdtvar.h>
-#include <dev/ofw/openfirm.h>
-
-static int     exynosfdt_match(device_t, cfdata_t, void *);
-static void    exynosfdt_attach(device_t, device_t, void *);
-
-CFATTACH_DECL_NEW(exynos_fdt, 0,
-    exynosfdt_match, exynosfdt_attach, NULL, NULL);
-
-static bool exynosfdt_found = false;
-
-int
-exynosfdt_match(device_t parent, cfdata_t cf, void *aux)
-{
-       if (exynosfdt_found)
-               return 0;
-       return 1;
-}
-
-void
-exynosfdt_attach(device_t parent, device_t self, void *aux)
-{
-       exynosfdt_found = true;
-
-       aprint_naive("\n");
-       aprint_normal("\n");
-
-       struct fdt_attach_args faa = {
-               .faa_name = "",
-               .faa_bst = &armv7_generic_bs_tag,
-               .faa_a4x_bst = &armv7_generic_a4x_bs_tag,
-               .faa_dmat = &exynos_bus_dma_tag,
-               .faa_phandle = OF_peer(0),
-       };
-       config_found(self, &faa, NULL);
-}
diff -r 4ad5b52795c6 -r 7891492d6265 sys/arch/arm/samsung/exynos_intr.h
--- a/sys/arch/arm/samsung/exynos_intr.h        Sat Jun 10 14:21:01 2017 +0000
+++ b/sys/arch/arm/samsung/exynos_intr.h        Sat Jun 10 15:13:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exynos_intr.h,v 1.2 2014/09/05 08:01:05 skrll Exp $    */
+/*     $NetBSD: exynos_intr.h,v 1.3 2017/06/10 15:13:18 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,18 +32,6 @@
 #ifndef _ARM_SAMSUNG_EXYNOS_INTR_H_
 #define _ARM_SAMSUNG_EXYNOS_INTR_H_
 
-#define        PIC_MAXSOURCES                  GIC_MAXSOURCES(224)
-#define        PIC_MAXMAXSOURCES               (PIC_MAXSOURCES + 32)   /* XXX */
-
-/*
- * The Exynos uses a generic interrupt controller
- */
-#include <arm/cortex/gic_intr.h>
-
-#ifdef _KERNEL_OPT
-#include "opt_exynos.h"
-#endif
-
 /*
  * The GIC supports
  *   - 16 Software Generated Interrupts (SGIs)
@@ -61,9 +49,5 @@
 
 #define        IRQ_MCT_LTIMER          IRQ_PPI(12)
 
-#ifdef EXYNOS5
-#include <arm/cortex/gtmr_intr.h>
-#endif
-
 #endif /* _ARM_SAMSUNG_EXYNOS_INTR_H_ */
 
diff -r 4ad5b52795c6 -r 7891492d6265 sys/arch/arm/samsung/exynos_platform.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/samsung/exynos_platform.c    Sat Jun 10 15:13:18 2017 +0000
@@ -0,0 +1,143 @@
+/* $NetBSD: exynos_platform.c,v 1.1 2017/06/10 15:13:18 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@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 "opt_exynos.h"
+#include "opt_multiprocessor.h"
+#include "opt_fdt_arm.h"
+
+#include "ukbd.h"
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.1 2017/06/10 15:13:18 jmcneill Exp $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/device.h>
+#include <sys/termios.h>
+
+#include <dev/fdt/fdtvar.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <machine/bootconfig.h>
+#include <arm/cpufunc.h>
+
+#include <arm/samsung/exynos_reg.h>
+#include <arm/samsung/exynos_var.h>
+
+#include <arm/cortex/gtmr_var.h>
+
+#include <arm/fdt/arm_fdtvar.h>
+
+#define        EXYNOS_CORE_VBASE       0xf0000000
+
+#define        DEVMAP_ALIGN(a) ((a) & ~L1_S_OFFSET)
+#define        DEVMAP_SIZE(s)  roundup2((s), L1_S_SIZE)
+#define        DEVMAP_ENTRY(va, pa, sz)                        \
+       {                                               \
+               .pd_va = DEVMAP_ALIGN(va),              \
+               .pd_pa = DEVMAP_ALIGN(pa),              \
+               .pd_size = DEVMAP_SIZE(sz),             \
+               .pd_prot = VM_PROT_READ|VM_PROT_WRITE,  \
+               .pd_cache = PTE_NOCACHE                 \
+       }
+#define        DEVMAP_ENTRY_END        { 0 }
+
+static const struct pmap_devmap *
+exynos_platform_devmap(void)
+{
+       static const struct pmap_devmap devmap[] = {
+               DEVMAP_ENTRY(EXYNOS_CORE_VBASE,
+                            EXYNOS_CORE_PBASE,
+                            EXYNOS_CORE_SIZE),
+               DEVMAP_ENTRY_END
+       };      
+
+       return devmap;
+}
+
+static void
+exynos_platform_bootstrap(void)
+{
+       exynos_bootstrap(EXYNOS_CORE_PBASE, 0 /* XXX */);
+}
+
+static void
+exynos_platform_init_attach_args(struct fdt_attach_args *faa)
+{



Home | Main Index | Thread Index | Old Index