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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/boot/treeboot-iss4xx.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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 2010 Ben. Herrenschmidt, IBM Corporation.
  4  *
  5  * Based on earlier code:
  6  *   Copyright (C) Paul Mackerras 1997.
  7  *
  8  *   Matt Porter <mporter@kernel.crashing.org>
  9  *   Copyright 2002-2005 MontaVista Software Inc.
 10  *
 11  *   Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
 12  *   Copyright (c) 2003, 2004 Zultys Technologies
 13  *
 14  *    Copyright 2007 David Gibson, IBM Corporation.
 15  */
 16 #include <stdarg.h>
 17 #include <stddef.h>
 18 #include "types.h"
 19 #include "elf.h"
 20 #include "string.h"
 21 #include "stdio.h"
 22 #include "page.h"
 23 #include "ops.h"
 24 #include "reg.h"
 25 #include "io.h"
 26 #include "dcr.h"
 27 #include "4xx.h"
 28 #include "44x.h"
 29 #include "libfdt.h"
 30 
 31 BSS_STACK(4096);
 32 
 33 static u32 ibm4xx_memstart;
 34 
 35 static void iss_4xx_fixups(void)
 36 {
 37         void *memory;
 38         u32 reg[3];
 39 
 40         memory = finddevice("/memory");
 41         if (!memory)
 42                 fatal("Can't find memory node\n");
 43         /* This assumes #address-cells = 2, #size-cells =1 and that */
 44         getprop(memory, "reg", reg, sizeof(reg));
 45         if (reg[2])
 46                 /* If the device tree specifies the memory range, use it */
 47                 ibm4xx_memstart = reg[1];
 48         else
 49                 /* othersize, read it from the SDRAM controller */
 50                 ibm4xx_sdram_fixup_memsize();
 51 }
 52 
 53 static void *iss_4xx_vmlinux_alloc(unsigned long size)
 54 {
 55         return (void *)ibm4xx_memstart;
 56 }
 57 
 58 #define SPRN_PIR        0x11E   /* Processor Identification Register */
 59 void platform_init(void)
 60 {
 61         unsigned long end_of_ram = 0x08000000;
 62         unsigned long avail_ram = end_of_ram - (unsigned long)_end;
 63         u32 pir_reg;
 64 
 65         simple_alloc_init(_end, avail_ram, 128, 64);
 66         platform_ops.fixups = iss_4xx_fixups;
 67         platform_ops.vmlinux_alloc = iss_4xx_vmlinux_alloc;
 68         platform_ops.exit = ibm44x_dbcr_reset;
 69         pir_reg = mfspr(SPRN_PIR);
 70         fdt_set_boot_cpuid_phys(_dtb_start, pir_reg);
 71         fdt_init(_dtb_start);
 72         serial_console_init();
 73 }
 74 

~ [ 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