Thu Mar 31 14:33:17 2016 UTC ()
Ensure enable clocks for omapmputmr.


(kiyohara)
diff -r1.50 -r1.51 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
diff -r1.7 -r1.8 src/sys/arch/evbarm/gumstix/gumstixreg.h

cvs diff -r1.50 -r1.51 src/sys/arch/evbarm/gumstix/gumstix_machdep.c (expand / switch to unified diff)

--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c 2014/06/07 10:30:13 1.50
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c 2016/03/31 14:33:17 1.51
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gumstix_machdep.c,v 1.50 2014/06/07 10:30:13 kiyohara Exp $ */ 1/* $NetBSD: gumstix_machdep.c,v 1.51 2016/03/31 14:33:17 kiyohara Exp $ */
2/* 2/*
3 * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation. 3 * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Written by Takashi Kiyohara and Susumu Miki for WIDE Project and SOUM 6 * Written by Takashi Kiyohara and Susumu Miki for WIDE Project and SOUM
7 * Corporation. 7 * Corporation.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -159,26 +159,27 @@ @@ -159,26 +159,27 @@
159#include <sys/termios.h> 159#include <sys/termios.h>
160#include <sys/bus.h> 160#include <sys/bus.h>
161#include <sys/cpu.h> 161#include <sys/cpu.h>
162 162
163#include <uvm/uvm_extern.h> 163#include <uvm/uvm_extern.h>
164 164
165#include <machine/autoconf.h> 165#include <machine/autoconf.h>
166#include <machine/bootconfig.h> 166#include <machine/bootconfig.h>
167#include <arm/locore.h> 167#include <arm/locore.h>
168 168
169#include <arm/arm32/machdep.h> 169#include <arm/arm32/machdep.h>
170#ifdef OVERO 170#ifdef OVERO
171#include <arm/omap/omap2_gpmcreg.h> 171#include <arm/omap/omap2_gpmcreg.h>
 172#include <arm/omap/omap2_obiovar.h>
172#include <arm/omap/omap2_prcm.h> 173#include <arm/omap/omap2_prcm.h>
173#include <arm/omap/omap2_reg.h> 174#include <arm/omap/omap2_reg.h>
174#include <arm/omap/omap_var.h> 175#include <arm/omap/omap_var.h>
175#include <arm/omap/omap_com.h> 176#include <arm/omap/omap_com.h>
176#endif 177#endif
177#include <arm/xscale/pxa2x0reg.h> 178#include <arm/xscale/pxa2x0reg.h>
178#include <arm/xscale/pxa2x0var.h> 179#include <arm/xscale/pxa2x0var.h>
179#include <arm/xscale/pxa2x0_gpio.h> 180#include <arm/xscale/pxa2x0_gpio.h>
180#include <evbarm/gumstix/gumstixreg.h> 181#include <evbarm/gumstix/gumstixreg.h>
181#include <evbarm/gumstix/gumstixvar.h> 182#include <evbarm/gumstix/gumstixvar.h>
182 183
183#include <dev/cons.h> 184#include <dev/cons.h>
184 185
@@ -325,26 +326,33 @@ static const struct pmap_devmap gumstix_ @@ -325,26 +326,33 @@ static const struct pmap_devmap gumstix_
325 _S(4 * COM_NPORTS), 326 _S(4 * COM_NPORTS),
326 VM_PROT_READ | VM_PROT_WRITE, 327 VM_PROT_READ | VM_PROT_WRITE,
327 PTE_NOCACHE, 328 PTE_NOCACHE,
328 }, 329 },
329 { 330 {
330 GUMSTIX_LCDC_VBASE, 331 GUMSTIX_LCDC_VBASE,
331 _A(PXA2X0_LCDC_BASE), 332 _A(PXA2X0_LCDC_BASE),
332 _S(4 * COM_NPORTS), 333 _S(4 * COM_NPORTS),
333 VM_PROT_READ | VM_PROT_WRITE, 334 VM_PROT_READ | VM_PROT_WRITE,
334 PTE_NOCACHE, 335 PTE_NOCACHE,
335 }, 336 },
336#elif defined(OVERO) 337#elif defined(OVERO)
337 { 338 {
 339 OVERO_L4_CORE_VBASE,
 340 _A(OMAP3530_L4_CORE_BASE),
 341 _S(L1_S_SIZE), /* No need 16MB. Use only first 1MB */
 342 VM_PROT_READ | VM_PROT_WRITE,
 343 PTE_NOCACHE
 344 },
 345 {
338 OVERO_L4_PERIPHERAL_VBASE, 346 OVERO_L4_PERIPHERAL_VBASE,
339 _A(OMAP3530_L4_PERIPHERAL_BASE), 347 _A(OMAP3530_L4_PERIPHERAL_BASE),
340 _S(OMAP3530_L4_PERIPHERAL_SIZE), 348 _S(OMAP3530_L4_PERIPHERAL_SIZE),
341 VM_PROT_READ | VM_PROT_WRITE, 349 VM_PROT_READ | VM_PROT_WRITE,
342 PTE_NOCACHE 350 PTE_NOCACHE
343 }, 351 },
344 { 352 {
345 OVERO_GPMC_VBASE, 353 OVERO_GPMC_VBASE,
346 _A(GPMC_BASE), 354 _A(GPMC_BASE),
347 _S(GPMC_SIZE), 355 _S(GPMC_SIZE),
348 VM_PROT_READ | VM_PROT_WRITE, 356 VM_PROT_READ | VM_PROT_WRITE,
349 PTE_NOCACHE 357 PTE_NOCACHE
350 }, 358 },
@@ -910,14 +918,38 @@ gumstix_device_register(device_t dev, vo @@ -910,14 +918,38 @@ gumstix_device_register(device_t dev, vo
910 " property for %s\n", device_xname(dev)); 918 " property for %s\n", device_xname(dev));
911 } 919 }
912 if (prop_dictionary_set_bool(dict, 920 if (prop_dictionary_set_bool(dict,
913 "Ganged-power-mask-on-port2", 1) == false) { 921 "Ganged-power-mask-on-port2", 1) == false) {
914 printf("WARNING: unable to set power-mask for port2" 922 printf("WARNING: unable to set power-mask for port2"
915 " property for %s\n", device_xname(dev)); 923 " property for %s\n", device_xname(dev));
916 } 924 }
917 if (prop_dictionary_set_bool(dict, 925 if (prop_dictionary_set_bool(dict,
918 "Ganged-power-mask-on-port3", 1) == false) { 926 "Ganged-power-mask-on-port3", 1) == false) {
919 printf("WARNING: unable to set power-mask for port3" 927 printf("WARNING: unable to set power-mask for port3"
920 " property for %s\n", device_xname(dev)); 928 " property for %s\n", device_xname(dev));
921 } 929 }
922 } 930 }
 931 if (device_is_a(dev, "omapmputmr")) {
 932#ifdef OVERO
 933 struct obio_attach_args *obio = aux;
 934 int en;
 935
 936 switch (obio->obio_addr) {
 937 case 0x49032000: /* GPTIMER2 */
 938 case 0x49034000: /* GPTIMER3 */
 939 case 0x49036000: /* GPTIMER4 */
 940 case 0x49038000: /* GPTIMER5 */
 941 case 0x4903a000: /* GPTIMER6 */
 942 case 0x4903c000: /* GPTIMER7 */
 943 case 0x4903e000: /* GPTIMER8 */
 944 case 0x49040000: /* GPTIMER9 */
 945 /* Ensure enable PRCM.CM_[FI]CLKEN_PER[3:10]. */
 946 en = 1 << (((obio->obio_addr >> 13) & 0x3f) - 0x16);
 947 ioreg_write(OVERO_L4_CORE_VBASE + 0x5000,
 948 ioreg_read(OVERO_L4_CORE_VBASE + 0x5000) | en);
 949 ioreg_write(OVERO_L4_CORE_VBASE + 0x5010,
 950 ioreg_read(OVERO_L4_CORE_VBASE + 0x5010) | en);
 951 break;
 952 }
 953#endif
 954 }
923} 955}

cvs diff -r1.7 -r1.8 src/sys/arch/evbarm/gumstix/gumstixreg.h (expand / switch to unified diff)

--- src/sys/arch/evbarm/gumstix/gumstixreg.h 2012/12/24 06:49:41 1.7
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h 2016/03/31 14:33:17 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gumstixreg.h,v 1.7 2012/12/24 06:49:41 kiyohara Exp $ */ 1/* $NetBSD: gumstixreg.h,v 1.8 2016/03/31 14:33:17 kiyohara Exp $ */
2/* 2/*
3 * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation. 3 * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Written by Takashi Kiyohara and Susumu Miki for WIDE Project and SOUM 6 * Written by Takashi Kiyohara and Susumu Miki for WIDE Project and SOUM
7 * Corporation. 7 * Corporation.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -37,27 +37,28 @@ @@ -37,27 +37,28 @@
37 * Logical mapping for onboard/integrated peripherals 37 * Logical mapping for onboard/integrated peripherals
38 * that are used while bootstrapping. 38 * that are used while bootstrapping.
39 */ 39 */
40#define GUMSTIX_IO_AREA_VBASE 0xfd000000 40#define GUMSTIX_IO_AREA_VBASE 0xfd000000
41#define GUMSTIX_INTCTL_VBASE 0xfd000000 41#define GUMSTIX_INTCTL_VBASE 0xfd000000
42#define GUMSTIX_CLKMAN_VBASE 0xfd100000 42#define GUMSTIX_CLKMAN_VBASE 0xfd100000
43#define GUMSTIX_GPIO_VBASE 0xfd200000 43#define GUMSTIX_GPIO_VBASE 0xfd200000
44#define GUMSTIX_FFUART_VBASE 0xfd300000 44#define GUMSTIX_FFUART_VBASE 0xfd300000
45#define GUMSTIX_STUART_VBASE 0xfd400000 45#define GUMSTIX_STUART_VBASE 0xfd400000
46#define GUMSTIX_BTUART_VBASE 0xfd500000 46#define GUMSTIX_BTUART_VBASE 0xfd500000
47#define GUMSTIX_HWUART_VBASE 0xfd600000 47#define GUMSTIX_HWUART_VBASE 0xfd600000
48#define GUMSTIX_LCDC_VBASE 0xfd700000 48#define GUMSTIX_LCDC_VBASE 0xfd700000
49 49
50#define OVERO_L4_PERIPHERAL_VBASE 0xc0000000 50#define OVERO_L4_CORE_VBASE 0xc0000000
51#define OVERO_GPMC_VBASE 0xc0100000 51#define OVERO_L4_PERIPHERAL_VBASE 0xc0100000
 52#define OVERO_GPMC_VBASE 0xc0200000
52 53
53 54
54#define ioreg_read(a) (*(volatile unsigned *)(a)) 55#define ioreg_read(a) (*(volatile unsigned *)(a))
55#define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v)) 56#define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v))
56 57
57#define ioreg16_read(a) (*(volatile uint16_t *)(a)) 58#define ioreg16_read(a) (*(volatile uint16_t *)(a))
58#define ioreg16_write(a,v) (*(volatile uint16_t *)(a)=(v)) 59#define ioreg16_write(a,v) (*(volatile uint16_t *)(a)=(v))
59 60
60#define ioreg8_read(a) (*(volatile uint8_t *)(a)) 61#define ioreg8_read(a) (*(volatile uint8_t *)(a))
61#define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v)) 62#define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v))
62 63
63#endif /* _EVBARM_GUMSTIXREG_H_ */ 64#endif /* _EVBARM_GUMSTIXREG_H_ */