| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: bcm53xx_board.c,v 1.17 2013/10/28 22:51:16 matt Exp $ */ | | 1 | /* $NetBSD: bcm53xx_board.c,v 1.18 2014/02/19 22:20:45 matt Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to The NetBSD Foundation | | 6 | * This code is derived from software contributed to The NetBSD Foundation |
7 | * by Matt Thomas of 3am Software Foundry. | | 7 | * by Matt Thomas of 3am Software Foundry. |
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 |
| @@ -19,32 +19,33 @@ | | | @@ -19,32 +19,33 @@ |
19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | * POSSIBILITY OF SUCH DAMAGE. | | 28 | * POSSIBILITY OF SUCH DAMAGE. |
29 | */ | | 29 | */ |
30 | | | 30 | |
31 | #include "opt_broadcom.h" | | 31 | #include "opt_broadcom.h" |
| | | 32 | #include "arml2cc.h" |
32 | | | 33 | |
33 | #define _ARM32_BUS_DMA_PRIVATE | | 34 | #define _ARM32_BUS_DMA_PRIVATE |
34 | | | 35 | |
35 | #include <sys/cdefs.h> | | 36 | #include <sys/cdefs.h> |
36 | | | 37 | |
37 | __KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.17 2013/10/28 22:51:16 matt Exp $"); | | 38 | __KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.18 2014/02/19 22:20:45 matt Exp $"); |
38 | | | 39 | |
39 | #include <sys/param.h> | | 40 | #include <sys/param.h> |
40 | #include <sys/bus.h> | | 41 | #include <sys/bus.h> |
41 | #include <sys/cpu.h> | | 42 | #include <sys/cpu.h> |
42 | #include <sys/device.h> | | 43 | #include <sys/device.h> |
43 | | | 44 | |
44 | #include <prop/proplib.h> | | 45 | #include <prop/proplib.h> |
45 | | | 46 | |
46 | #include <net/if.h> | | 47 | #include <net/if.h> |
47 | #include <net/if_ether.h> | | 48 | #include <net/if_ether.h> |
48 | | | 49 | |
49 | #define CCA_PRIVATE | | 50 | #define CCA_PRIVATE |
50 | #define CRU_PRIVATE | | 51 | #define CRU_PRIVATE |
| @@ -544,28 +545,30 @@ bcm53xx_bootstrap(vaddr_t iobase) | | | @@ -544,28 +545,30 @@ bcm53xx_bootstrap(vaddr_t iobase) |
544 | bcm53xx_clock_init(clk); | | 545 | bcm53xx_clock_init(clk); |
545 | bcm53xx_lcpll_clock_init(clk, bcs.bcs_lcpll_control1, | | 546 | bcm53xx_lcpll_clock_init(clk, bcs.bcs_lcpll_control1, |
546 | bcs.bcs_lcpll_control2); | | 547 | bcs.bcs_lcpll_control2); |
547 | bcm53xx_genpll_clock_init(clk, bcs.bcs_genpll_control5, | | 548 | bcm53xx_genpll_clock_init(clk, bcs.bcs_genpll_control5, |
548 | bcs.bcs_genpll_control6, bcs.bcs_genpll_control7); | | 549 | bcs.bcs_genpll_control6, bcs.bcs_genpll_control7); |
549 | bcm53xx_usb_clock_init(clk, bcs.bcs_usb2_control); | | 550 | bcm53xx_usb_clock_init(clk, bcs.bcs_usb2_control); |
550 | bcm53xx_get_ddr_freq(clk, bcs.bcs_ddr_phy_ctl_pll_status, | | 551 | bcm53xx_get_ddr_freq(clk, bcs.bcs_ddr_phy_ctl_pll_status, |
551 | bcs.bcs_ddr_phy_ctl_pll_dividers); | | 552 | bcs.bcs_ddr_phy_ctl_pll_dividers); |
552 | bcm53xx_get_cpu_freq(clk, bcs.bcs_armcore_clk_pllarma, | | 553 | bcm53xx_get_cpu_freq(clk, bcs.bcs_armcore_clk_pllarma, |
553 | bcs.bcs_armcore_clk_pllarmb, bcs.bcs_armcore_clk_policy); | | 554 | bcs.bcs_armcore_clk_pllarmb, bcs.bcs_armcore_clk_policy); |
554 | | | 555 | |
555 | curcpu()->ci_data.cpu_cc_freq = clk->clk_cpu; | | 556 | curcpu()->ci_data.cpu_cc_freq = clk->clk_cpu; |
556 | | | 557 | |
| | | 558 | #if NARML2CC > 0 |
557 | arml2cc_init(bcm53xx_armcore_bst, bcm53xx_armcore_bsh, | | 559 | arml2cc_init(bcm53xx_armcore_bst, bcm53xx_armcore_bsh, |
558 | ARMCORE_L2C_BASE); | | 560 | ARMCORE_L2C_BASE); |
| | | 561 | #endif |
559 | } | | 562 | } |
560 | | | 563 | |
561 | void | | 564 | void |
562 | bcm53xx_dma_bootstrap(psize_t memsize) | | 565 | bcm53xx_dma_bootstrap(psize_t memsize) |
563 | { | | 566 | { |
564 | if (memsize <= 256*1024*1024) { | | 567 | if (memsize <= 256*1024*1024) { |
565 | bcm53xx_dma_ranges[0].dr_len = memsize; | | 568 | bcm53xx_dma_ranges[0].dr_len = memsize; |
566 | bcm53xx_coherent_dma_ranges[0].dr_len = memsize; | | 569 | bcm53xx_coherent_dma_ranges[0].dr_len = memsize; |
567 | bcm53xx_dma_tag._nranges = 1; | | 570 | bcm53xx_dma_tag._nranges = 1; |
568 | bcm53xx_coherent_dma_tag._nranges = 1; | | 571 | bcm53xx_coherent_dma_tag._nranges = 1; |
569 | } else { | | 572 | } else { |
570 | /* | | 573 | /* |
571 | * By setting up two ranges, bus_dmamem_alloc will always | | 574 | * By setting up two ranges, bus_dmamem_alloc will always |