| @@ -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 | } |