~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/sibyte/bcm1480/setup.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation
  4  */
  5 #include <linux/init.h>
  6 #include <linux/kernel.h>
  7 #include <linux/export.h>
  8 #include <linux/reboot.h>
  9 #include <linux/string.h>
 10 
 11 #include <asm/bootinfo.h>
 12 #include <asm/cpu.h>
 13 #include <asm/mipsregs.h>
 14 #include <asm/io.h>
 15 #include <asm/sibyte/sb1250.h>
 16 
 17 #include <asm/sibyte/bcm1480_regs.h>
 18 #include <asm/sibyte/bcm1480_scd.h>
 19 #include <asm/sibyte/sb1250_scd.h>
 20 
 21 unsigned int sb1_pass;
 22 unsigned int soc_pass;
 23 unsigned int soc_type;
 24 EXPORT_SYMBOL(soc_type);
 25 unsigned int periph_rev;
 26 EXPORT_SYMBOL_GPL(periph_rev);
 27 unsigned int zbbus_mhz;
 28 EXPORT_SYMBOL(zbbus_mhz);
 29 
 30 static unsigned int part_type;
 31 
 32 static char *soc_str;
 33 static char *pass_str;
 34 
 35 static int __init setup_bcm1x80_bcm1x55(void)
 36 {
 37         switch (soc_pass) {
 38         case K_SYS_REVISION_BCM1480_S0:
 39                 periph_rev = 1;
 40                 pass_str = "S0 (pass1)";
 41                 break;
 42         case K_SYS_REVISION_BCM1480_A1:
 43                 periph_rev = 1;
 44                 pass_str = "A1 (pass1)";
 45                 break;
 46         case K_SYS_REVISION_BCM1480_A2:
 47                 periph_rev = 1;
 48                 pass_str = "A2 (pass1)";
 49                 break;
 50         case K_SYS_REVISION_BCM1480_A3:
 51                 periph_rev = 1;
 52                 pass_str = "A3 (pass1)";
 53                 break;
 54         case K_SYS_REVISION_BCM1480_B0:
 55                 periph_rev = 1;
 56                 pass_str = "B0 (pass2)";
 57                 break;
 58         default:
 59                 printk("Unknown %s rev %x\n", soc_str, soc_pass);
 60                 periph_rev = 1;
 61                 pass_str = "Unknown Revision";
 62                 break;
 63         }
 64 
 65         return 0;
 66 }
 67 
 68 /* Setup code likely to be common to all SiByte platforms */
 69 
 70 static int __init sys_rev_decode(void)
 71 {
 72         int ret = 0;
 73 
 74         switch (soc_type) {
 75         case K_SYS_SOC_TYPE_BCM1x80:
 76                 if (part_type == K_SYS_PART_BCM1480)
 77                     soc_str = "BCM1480";
 78                 else if (part_type == K_SYS_PART_BCM1280)
 79                     soc_str = "BCM1280";
 80                 else
 81                     soc_str = "BCM1x80";
 82                 ret = setup_bcm1x80_bcm1x55();
 83                 break;
 84 
 85         case K_SYS_SOC_TYPE_BCM1x55:
 86                 if (part_type == K_SYS_PART_BCM1455)
 87                     soc_str = "BCM1455";
 88                 else if (part_type == K_SYS_PART_BCM1255)
 89                     soc_str = "BCM1255";
 90                 else
 91                     soc_str = "BCM1x55";
 92                 ret = setup_bcm1x80_bcm1x55();
 93                 break;
 94 
 95         default:
 96                 printk("Unknown part type %x\n", part_type);
 97                 ret = 1;
 98                 break;
 99         }
100 
101         return ret;
102 }
103 
104 void __init bcm1480_setup(void)
105 {
106         uint64_t sys_rev;
107         int plldiv;
108 
109         sb1_pass = read_c0_prid() & PRID_REV_MASK;
110         sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
111         soc_type = SYS_SOC_TYPE(sys_rev);
112         part_type = G_SYS_PART(sys_rev);
113         soc_pass = G_SYS_REVISION(sys_rev);
114 
115         if (sys_rev_decode()) {
116                 printk("Restart after failure to identify SiByte chip\n");
117                 machine_restart(NULL);
118         }
119 
120         plldiv = G_BCM1480_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG)));
121         zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25);
122 
123         printk("Broadcom SiByte %s %s @ %d MHz (SB-1A rev %d)\n",
124                     soc_str, pass_str, zbbus_mhz * 2, sb1_pass);
125         printk("Board type: %s\n", get_system_type());
126 }
127 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php