The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/arm/mv/kirkwood/kirkwood.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * SPDX-License-Identifier: BSD-3-Clause
    3  *
    4  * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
    5  * All rights reserved.
    6  *
    7  * Developed by Semihalf.
    8  *
    9  * Redistribution and use in source and binary forms, with or without
   10  * modification, are permitted provided that the following conditions
   11  * are met:
   12  * 1. Redistributions of source code must retain the above copyright
   13  *    notice, this list of conditions and the following disclaimer.
   14  * 2. Redistributions in binary form must reproduce the above copyright
   15  *    notice, this list of conditions and the following disclaimer in the
   16  *    documentation and/or other materials provided with the distribution.
   17  * 3. Neither the name of MARVELL nor the names of contributors
   18  *    may be used to endorse or promote products derived from this software
   19  *    without specific prior written permission.
   20  *
   21  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   24  * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
   25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   31  * SUCH DAMAGE.
   32  */
   33 
   34 #include <sys/cdefs.h>
   35 __FBSDID("$FreeBSD: releng/12.0/sys/arm/mv/kirkwood/kirkwood.c 326023 2017-11-20 19:43:44Z pfg $");
   36 
   37 #include <sys/param.h>
   38 #include <sys/systm.h>
   39 #include <sys/bus.h>
   40 
   41 #include <machine/bus.h>
   42 
   43 #include <arm/mv/mvreg.h>
   44 #include <arm/mv/mvvar.h>
   45 #include <arm/mv/mvwin.h>
   46 
   47 struct resource_spec mv_gpio_res[] = {
   48         { SYS_RES_MEMORY,       0,      RF_ACTIVE },
   49         { SYS_RES_IRQ,          0,      RF_ACTIVE },
   50         { SYS_RES_IRQ,          1,      RF_ACTIVE },
   51         { SYS_RES_IRQ,          2,      RF_ACTIVE },
   52         { SYS_RES_IRQ,          3,      RF_ACTIVE },
   53         { SYS_RES_IRQ,          4,      RF_ACTIVE },
   54         { SYS_RES_IRQ,          5,      RF_ACTIVE },
   55         { SYS_RES_IRQ,          6,      RF_ACTIVE },
   56         { -1, 0 }
   57 };
   58 
   59 const struct decode_win xor_win_tbl[] = {
   60         { 0 },
   61 };
   62 const struct decode_win *xor_wins = xor_win_tbl;
   63 int xor_wins_no = 0;
   64 
   65 uint32_t
   66 get_tclk(void)
   67 {
   68         uint32_t dev, rev;
   69 
   70         /*
   71          * On Kirkwood TCLK is not configurable and depends on silicon
   72          * revision:
   73          * - A0 and A1 have TCLK hardcoded to 200 MHz.
   74          * - Z0 and others have TCLK hardcoded to 166 MHz.
   75          */
   76         soc_id(&dev, &rev);
   77         if (dev == MV_DEV_88F6281 && (rev == 2 || rev == 3))
   78                 return (TCLK_200MHZ);
   79         if (dev == MV_DEV_88F6282)
   80                 return (TCLK_200MHZ);
   81 
   82         return (TCLK_166MHZ);
   83 }
   84 
   85 uint32_t
   86 get_cpu_freq(void)
   87 {
   88 
   89         return (0);
   90 }

Cache object: 45314910aa1ef8cb62479ef26813b37b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.