Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm Support tifb.



details:   https://anonhg.NetBSD.org/src/rev/b16bad700ee3
branches:  trunk
changeset: 348430:b16bad700ee3
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Tue Oct 18 14:39:52 2016 +0000

description:
Support tifb.

diffstat:

 sys/arch/evbarm/beagle/beagle_machdep.c   |  52 ++++++++++++++++++++++++++----
 sys/arch/evbarm/gumstix/gumstix_machdep.c |  12 ++++++-
 sys/arch/evbarm/gumstix/gxio.c            |   5 +-
 3 files changed, 58 insertions(+), 11 deletions(-)

diffs (168 lines):

diff -r 55631478eb61 -r b16bad700ee3 sys/arch/evbarm/beagle/beagle_machdep.c
--- a/sys/arch/evbarm/beagle/beagle_machdep.c   Tue Oct 18 14:14:51 2016 +0000
+++ b/sys/arch/evbarm/beagle/beagle_machdep.c   Tue Oct 18 14:39:52 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: beagle_machdep.c,v 1.64 2016/07/03 11:40:58 kiyohara Exp $ */
+/*     $NetBSD: beagle_machdep.c,v 1.65 2016/10/18 14:39:52 kiyohara Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.64 2016/07/03 11:40:58 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.65 2016/10/18 14:39:52 kiyohara Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -190,6 +190,7 @@
 #  error no prcm device configured.
 # endif
 # include <arm/omap/am335x_prcm.h>
+# include <arm/omap/tifbvar.h>
 # include <dev/i2c/tps65217pmicvar.h>
 # if NSDHC > 0
 #  include <arm/omap/omap2_obiovar.h>
@@ -497,7 +498,13 @@
 
        /* The console is going to try to map things.  Give pmap a devmap. */
        pmap_devmap_register(devmap);
+
+       if (get_bootconf_option(bootargs, "console",
+                   BOOTOPT_TYPE_STRING, &ptr) && strncmp(ptr, "fb", 2) == 0) {
+               use_fb_console = true;
+       }
        consinit();
+
 #ifdef CPU_CORTEXA15
 #ifdef MULTIPROCESSOR
        arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU);
@@ -618,11 +625,6 @@
 
        db_trap_callback = beagle_db_trap;
 
-       if (get_bootconf_option(boot_args, "console",
-                   BOOTOPT_TYPE_STRING, &ptr) && strncmp(ptr, "fb", 2) == 0) {
-               use_fb_console = true;
-       }
-       
        return initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, NULL, 0);
 
 }
@@ -688,7 +690,8 @@
 #endif
 
 #if NUKBD > 0
-       ukbd_cnattach();        /* allow USB keyboard to become console */
+       if (use_fb_console)
+               ukbd_cnattach(); /* allow USB keyboard to become console */
 #endif
 
        beagle_putchar('f');
@@ -1107,6 +1110,39 @@
                return;
        }
        if (device_is_a(self, "tifb")) {
+               static const struct tifb_panel_info default_panel_info = {
+                       .panel_tft = 1,
+                       .panel_mono = false,
+                       .panel_bpp = 24,
+
+                       .panel_pxl_clk = 30000000,
+                       .panel_width = 800,
+                       .panel_height = 600,
+                       .panel_hfp = 0,
+                       .panel_hbp = 47,
+                       .panel_hsw = 47,
+                       .panel_vfp = 0,
+                       .panel_vbp = 10,
+                       .panel_vsw = 2,
+                       .panel_invert_hsync = 1,
+                       .panel_invert_vsync = 1,
+
+                       .panel_ac_bias = 255,
+                       .panel_ac_bias_intrpt = 0,
+                       .panel_dma_burst_sz = 16,
+                       .panel_fdd = 0x80,
+                       .panel_sync_edge = 0,
+                       .panel_sync_ctrl = 1,
+                       .panel_invert_pxl_clk = 0,
+               };
+               prop_data_t panel_info;
+
+               panel_info = prop_data_create_data_nocopy(&default_panel_info,
+                   sizeof(struct tifb_panel_info));
+               KASSERT(panel_info != NULL);
+               prop_dictionary_set(dict, "panel-info", panel_info);
+               prop_object_release(panel_info);
+
                if (use_fb_console)
                        prop_dictionary_set_bool(dict, "is_console", true);
                return;
diff -r 55631478eb61 -r b16bad700ee3 sys/arch/evbarm/gumstix/gumstix_machdep.c
--- a/sys/arch/evbarm/gumstix/gumstix_machdep.c Tue Oct 18 14:14:51 2016 +0000
+++ b/sys/arch/evbarm/gumstix/gumstix_machdep.c Tue Oct 18 14:39:52 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gumstix_machdep.c,v 1.54 2016/10/16 23:07:31 kiyohara Exp $ */
+/*     $NetBSD: gumstix_machdep.c,v 1.55 2016/10/18 14:39:52 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -192,6 +192,7 @@
 #include <arm/omap/omap3_sdmmcreg.h>
 #include <arm/omap/omap_var.h>
 #include <arm/omap/omap_com.h>
+#include <arm/omap/tifbvar.h>
 #include <arm/xscale/pxa2x0reg.h>
 #include <arm/xscale/pxa2x0var.h>
 #include <arm/xscale/pxa2x0_gpio.h>
@@ -262,6 +263,7 @@
 static char console[16];
 #endif
 
+const struct tifb_panel_info *tifb_panel_info = NULL;
 /* Use TPS65217 White LED Driver */
 bool use_tps65217_wled = false;
 
@@ -1164,6 +1166,14 @@
                prop_dictionary_set_bool(dict, "dual-volt", dualvolt);
        }
        if (device_is_a(dev, "tifb")) {
+               prop_data_t panel_info;
+
+               panel_info = prop_data_create_data_nocopy(tifb_panel_info,
+                   sizeof(struct tifb_panel_info));
+               KASSERT(panel_info != NULL);
+               prop_dictionary_set(dict, "panel-info", panel_info);
+               prop_object_release(panel_info);
+
 #if defined(OMAP2)
                /* enable LCD */
                omap2_gpio_ctl(59, GPIO_PIN_OUTPUT);
diff -r 55631478eb61 -r b16bad700ee3 sys/arch/evbarm/gumstix/gxio.c
--- a/sys/arch/evbarm/gumstix/gxio.c    Tue Oct 18 14:14:51 2016 +0000
+++ b/sys/arch/evbarm/gumstix/gxio.c    Tue Oct 18 14:39:52 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gxio.c,v 1.22 2016/10/16 13:54:28 kiyohara Exp $ */
+/*     $NetBSD: gxio.c,v 1.23 2016/10/18 14:39:52 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -31,7 +31,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.22 2016/10/16 13:54:28 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxio.c,v 1.23 2016/10/18 14:39:52 kiyohara Exp $");
 
 #include "opt_cputypes.h"
 #include "opt_gumstix.h"
@@ -58,6 +58,7 @@
 #endif
 #include <arm/omap/omap_var.h>
 #include <arm/omap/ti_iicreg.h>
+#include <arm/omap/tifbvar.h>
 #if defined(CPU_XSCALE)
 #include <arm/xscale/pxa2x0cpu.h>
 #endif



Home | Main Index | Thread Index | Old Index