-#define MAX_PHB (32 * 6) /* 32 drawers * 6 PHBs/drawer */
-struct of_tce_table of_tce_table[MAX_PHB + 1];
-
-char *bootpath = 0;
-char *bootdevice = 0;
-
-int boot_cpuid = 0;
-#define MAX_CPU_THREADS 2
-
-struct device_node *allnodes = 0;
-/* use when traversing tree through the allnext, child, sibling,
- * or parent members of struct device_node.
- */
-static rwlock_t devtree_lock = RW_LOCK_UNLOCKED;
-
-extern unsigned long reloc_offset(void);
-
-extern void enter_prom(struct prom_args *args);
-extern void copy_and_flush(unsigned long dest, unsigned long src,
- unsigned long size, unsigned long offset);
-
-unsigned long dev_tree_size;
-unsigned long _get_PIR(void);
-
-#ifdef CONFIG_HMT
-struct {
- unsigned int pir;
- unsigned int threadid;
-} hmt_thread_data[NR_CPUS];
-#endif /* CONFIG_HMT */
-
-char testString[] = "LINUX\n";
-
-
-/* This is the one and *ONLY* place where we actually call open
- * firmware from, since we need to make sure we're running in 32b
- * mode when we do. We switch back to 64b mode upon return.
- */
-
-#define PROM_ERROR (0x00000000fffffffful)
-
-static unsigned long __init call_prom(const char *service, int nargs, int nret, ...)
-{
- int i;
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
- va_list list;
-
- _prom->args.service = (u32)LONG_LSW(service);
- _prom->args.nargs = nargs;
- _prom->args.nret = nret;
- _prom->args.rets = (prom_arg_t *)&(_prom->args.args[nargs]);
-
- va_start(list, nret);
- for (i=0; i < nargs ;i++)
- _prom->args.args[i] = (prom_arg_t)LONG_LSW(va_arg(list, unsigned long));
- va_end(list);
-
- for (i=0; i < nret ;i++)
- _prom->args.rets[i] = 0;
-
- enter_prom(&_prom->args);
-
- return (unsigned long)((nret > 0) ? _prom->args.rets[0] : 0);
-}
-
-
-static void __init prom_print(const char *msg)
-{
- const char *p, *q;
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
-
- if (_prom->stdout == 0)
- return;
-
- for (p = msg; *p != 0; p = q) {
- for (q = p; *q != 0 && *q != '\n'; ++q)
- ;
- if (q > p)
- call_prom(RELOC("write"), 3, 1, _prom->stdout,
- p, q - p);
- if (*q != 0) {
- ++q;
- call_prom(RELOC("write"), 3, 1, _prom->stdout,
- RELOC("\r\n"), 2);
- }
- }
-}
-
-
-static void __init prom_print_hex(unsigned long val)
-{
- int i, nibbles = sizeof(val)*2;
- char buf[sizeof(val)*2+1];
-
- for (i = nibbles-1; i >= 0; i--) {
- buf[i] = (val & 0xf) + '0';
- if (buf[i] > '9')
- buf[i] += ('a'-'0'-10);
- val >>= 4;
- }
- buf[nibbles] = '\0';
- prom_print(buf);
-}
-
-
-static void __init prom_print_nl(void)
-{
- unsigned long offset = reloc_offset();
- prom_print(RELOC("\n"));
-}
-
-
-static void __init prom_panic(const char *reason)
-{
- unsigned long offset = reloc_offset();
-
- prom_print(reason);
- /* ToDo: should put up an SRC here */
- call_prom(RELOC("exit"), 0, 0);
-
- for (;;) /* should never get here */
- ;
-}
-
-
-static int __init prom_next_node(phandle *nodep)
-{
- phandle node;
- unsigned long offset = reloc_offset();
-
- if ((node = *nodep) != 0
- && (*nodep = call_prom(RELOC("child"), 1, 1, node)) != 0)
- return 1;
- if ((*nodep = call_prom(RELOC("peer"), 1, 1, node)) != 0)
- return 1;
- for (;;) {
- if ((node = call_prom(RELOC("parent"), 1, 1, node)) == 0)
- return 0;
- if ((*nodep = call_prom(RELOC("peer"), 1, 1, node)) != 0)
- return 1;
- }
-}
-
-
-static void __init prom_initialize_naca(void)
-{
- phandle node;
- char type[64];
- unsigned long num_cpus = 0;
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
- struct naca_struct *_naca = RELOC(naca);
- struct systemcfg *_systemcfg = RELOC(systemcfg);
-
- /* NOTE: _naca->debug_switch is already initialized. */
-#ifdef DEBUG_PROM
- prom_print(RELOC("prom_initialize_naca: start...\n"));
-#endif
-
- _naca->pftSize = 0; /* ilog2 of htab size. computed below. */
-
- for (node = 0; prom_next_node(&node); ) {
- type[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
- type, sizeof(type));
-
- if (!strcmp(type, RELOC("cpu"))) {
- num_cpus += 1;
-
- /* We're assuming *all* of the CPUs have the same
- * d-cache and i-cache sizes... -Peter
- */
- if ( num_cpus == 1 ) {
- u32 size, lsize;
-
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("d-cache-size"),
- &size, sizeof(size));
-
- if (_systemcfg->platform == PLATFORM_POWERMAC)
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("d-cache-block-size"),
- &lsize, sizeof(lsize));
- else
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("d-cache-line-size"),
- &lsize, sizeof(lsize));
-
- _systemcfg->dCacheL1Size = size;
- _systemcfg->dCacheL1LineSize = lsize;
- _naca->dCacheL1LogLineSize = __ilog2(lsize);
- _naca->dCacheL1LinesPerPage = PAGE_SIZE/lsize;
-
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("i-cache-size"),
- &size, sizeof(size));
-
- if (_systemcfg->platform == PLATFORM_POWERMAC)
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("i-cache-block-size"),
- &lsize, sizeof(lsize));
- else
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("i-cache-line-size"),
- &lsize, sizeof(lsize));
-
- _systemcfg->iCacheL1Size = size;
- _systemcfg->iCacheL1LineSize = lsize;
- _naca->iCacheL1LogLineSize = __ilog2(lsize);
- _naca->iCacheL1LinesPerPage = PAGE_SIZE/lsize;
-
- if (_systemcfg->platform == PLATFORM_PSERIES_LPAR) {
- u32 pft_size[2];
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("ibm,pft-size"),
- &pft_size, sizeof(pft_size));
- /* pft_size[0] is the NUMA CEC cookie */
- _naca->pftSize = pft_size[1];
- }
- }
- } else if (!strcmp(type, RELOC("serial"))) {
- phandle isa, pci;
- struct isa_reg_property reg;
- union pci_range ranges;
-
- if (_systemcfg->platform == PLATFORM_POWERMAC)
- continue;
- type[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("ibm,aix-loc"), type, sizeof(type));
-
- if (strcmp(type, RELOC("S1")))
- continue;
-
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
- ®, sizeof(reg));
-
- isa = call_prom(RELOC("parent"), 1, 1, node);
- if (!isa)
- PROM_BUG();
- pci = call_prom(RELOC("parent"), 1, 1, isa);
- if (!pci)
- PROM_BUG();
-
- call_prom(RELOC("getprop"), 4, 1, pci, RELOC("ranges"),
- &ranges, sizeof(ranges));
-
- if ( _prom->encode_phys_size == 32 )
- _naca->serialPortAddr = ranges.pci32.phys+reg.address;
- else {
- _naca->serialPortAddr =
- ((((unsigned long)ranges.pci64.phys_hi) << 32) |
- (ranges.pci64.phys_lo)) + reg.address;
- }
- }
- }
-
- if (_systemcfg->platform == PLATFORM_POWERMAC)
- _naca->interrupt_controller = IC_OPEN_PIC;
- else {
- _naca->interrupt_controller = IC_INVALID;
- for (node = 0; prom_next_node(&node); ) {
- type[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("name"),
- type, sizeof(type));
- if (strcmp(type, RELOC("interrupt-controller")))
- continue;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("compatible"),
- type, sizeof(type));
- if (strstr(type, RELOC("open-pic")))
- _naca->interrupt_controller = IC_OPEN_PIC;
- else if (strstr(type, RELOC("ppc-xicp")))
- _naca->interrupt_controller = IC_PPC_XIC;
- else
- prom_print(RELOC("prom: failed to recognize"
- " interrupt-controller\n"));
- break;
- }
- }
-
- if (_naca->interrupt_controller == IC_INVALID) {
- prom_print(RELOC("prom: failed to find interrupt-controller\n"));
- PROM_BUG();
- }
-
- /* We gotta have at least 1 cpu... */
- if ( (_systemcfg->processorCount = num_cpus) < 1 )
- PROM_BUG();
-
- _systemcfg->physicalMemorySize = lmb_phys_mem_size();
-
- if (_systemcfg->platform == PLATFORM_PSERIES ||
- _systemcfg->platform == PLATFORM_POWERMAC) {
- unsigned long rnd_mem_size, pteg_count;
-
- /* round mem_size up to next power of 2 */
- rnd_mem_size = 1UL << __ilog2(_systemcfg->physicalMemorySize);
- if (rnd_mem_size < _systemcfg->physicalMemorySize)
- rnd_mem_size <<= 1;
-
- /* # pages / 2 */
- pteg_count = (rnd_mem_size >> (12 + 1));
-
- _naca->pftSize = __ilog2(pteg_count << 7);
- }
-
- if (_naca->pftSize == 0) {
- prom_print(RELOC("prom: failed to compute pftSize!\n"));
- PROM_BUG();
- }
-
- /*
- * Hardcode to GP size. I am not sure where to get this info
- * in general, as there does not appear to be a slb-size OF
- * entry. At least in Condor and earlier. DRENG
- */
- _naca->slb_size = 64;
-
- /* Add an eye catcher and the systemcfg layout version number */
- strcpy(_systemcfg->eye_catcher, RELOC("SYSTEMCFG:PPC64"));
- _systemcfg->version.major = SYSTEMCFG_MAJOR;
- _systemcfg->version.minor = SYSTEMCFG_MINOR;
- _systemcfg->processor = _get_PVR();
-
-#ifdef DEBUG_PROM
- prom_print(RELOC("systemcfg->processorCount = 0x"));
- prom_print_hex(_systemcfg->processorCount);
- prom_print_nl();
-
- prom_print(RELOC("systemcfg->physicalMemorySize = 0x"));
- prom_print_hex(_systemcfg->physicalMemorySize);
- prom_print_nl();
-
- prom_print(RELOC("naca->pftSize = 0x"));
- prom_print_hex(_naca->pftSize);
- prom_print_nl();
-
- prom_print(RELOC("systemcfg->dCacheL1LineSize = 0x"));
- prom_print_hex(_systemcfg->dCacheL1LineSize);
- prom_print_nl();
-
- prom_print(RELOC("systemcfg->iCacheL1LineSize = 0x"));
- prom_print_hex(_systemcfg->iCacheL1LineSize);
- prom_print_nl();
-
- prom_print(RELOC("naca->serialPortAddr = 0x"));
- prom_print_hex(_naca->serialPortAddr);
- prom_print_nl();
-
- prom_print(RELOC("naca->interrupt_controller = 0x"));
- prom_print_hex(_naca->interrupt_controller);
- prom_print_nl();
-
- prom_print(RELOC("systemcfg->platform = 0x"));
- prom_print_hex(_systemcfg->platform);
- prom_print_nl();
-
- prom_print(RELOC("prom_initialize_naca: end...\n"));
-#endif
-}
-
-
-static void __init early_cmdline_parse(void)
-{
- unsigned long offset = reloc_offset();
- char *opt;
-#ifndef CONFIG_PMAC_DART
- struct systemcfg *_systemcfg = RELOC(systemcfg);
-#endif
-
- opt = strstr(RELOC(cmd_line), RELOC("iommu="));
- if (opt) {
- prom_print(RELOC("opt is:"));
- prom_print(opt);
- prom_print(RELOC("\n"));
- opt += 6;
- while (*opt && *opt == ' ')
- opt++;
- if (!strncmp(opt, RELOC("off"), 3))
- RELOC(ppc64_iommu_off) = 1;
- else if (!strncmp(opt, RELOC("force"), 5))
- RELOC(iommu_force_on) = 1;
- }
-
-#ifndef CONFIG_PMAC_DART
- if (_systemcfg->platform == PLATFORM_POWERMAC) {
- RELOC(ppc64_iommu_off) = 1;
- prom_print(RELOC("DART disabled on PowerMac !\n"));
- }
-#endif
-}
-
-#ifdef DEBUG_PROM
-void prom_dump_lmb(void)
-{
- unsigned long i;
- unsigned long offset = reloc_offset();
- struct lmb *_lmb = PTRRELOC(&lmb);
-
- prom_print(RELOC("\nprom_dump_lmb:\n"));
- prom_print(RELOC(" memory.cnt = 0x"));
- prom_print_hex(_lmb->memory.cnt);
- prom_print_nl();
- prom_print(RELOC(" memory.size = 0x"));
- prom_print_hex(_lmb->memory.size);
- prom_print_nl();
- for (i=0; i < _lmb->memory.cnt ;i++) {
- prom_print(RELOC(" memory.region[0x"));
- prom_print_hex(i);
- prom_print(RELOC("].base = 0x"));
- prom_print_hex(_lmb->memory.region[i].base);
- prom_print_nl();
- prom_print(RELOC(" .physbase = 0x"));
- prom_print_hex(_lmb->memory.region[i].physbase);
- prom_print_nl();
- prom_print(RELOC(" .size = 0x"));
- prom_print_hex(_lmb->memory.region[i].size);
- prom_print_nl();
- }
-
- prom_print_nl();
- prom_print(RELOC(" reserved.cnt = 0x"));
- prom_print_hex(_lmb->reserved.cnt);
- prom_print_nl();
- prom_print(RELOC(" reserved.size = 0x"));
- prom_print_hex(_lmb->reserved.size);
- prom_print_nl();
- for (i=0; i < _lmb->reserved.cnt ;i++) {
- prom_print(RELOC(" reserved.region[0x"));
- prom_print_hex(i);
- prom_print(RELOC("].base = 0x"));
- prom_print_hex(_lmb->reserved.region[i].base);
- prom_print_nl();
- prom_print(RELOC(" .physbase = 0x"));
- prom_print_hex(_lmb->reserved.region[i].physbase);
- prom_print_nl();
- prom_print(RELOC(" .size = 0x"));
- prom_print_hex(_lmb->reserved.region[i].size);
- prom_print_nl();
- }
-}
-#endif /* DEBUG_PROM */
-
-static void __init prom_initialize_lmb(void)
-{
- phandle node;
- char type[64];
- unsigned long i, offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
- struct systemcfg *_systemcfg = RELOC(systemcfg);
- union lmb_reg_property reg;
- unsigned long lmb_base, lmb_size;
- unsigned long num_regs, bytes_per_reg = (_prom->encode_phys_size*2)/8;
-
- lmb_init();
-
- /* XXX Quick HACK. Proper fix is to drop those structures and properly use
- * #address-cells. PowerMac has #size-cell set to 1 and #address-cells to 2
- */
- if (_systemcfg->platform == PLATFORM_POWERMAC)
- bytes_per_reg = 12;
-
- for (node = 0; prom_next_node(&node); ) {
- type[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
- type, sizeof(type));
-
- if (strcmp(type, RELOC("memory")))
- continue;
-
- num_regs = call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
- ®, sizeof(reg)) / bytes_per_reg;
-
- for (i=0; i < num_regs ;i++) {
- if (_systemcfg->platform == PLATFORM_POWERMAC) {
- lmb_base = ((unsigned long)reg.addrPM[i].address_hi) << 32;
- lmb_base |= (unsigned long)reg.addrPM[i].address_lo;
- lmb_size = reg.addrPM[i].size;
- } else if (_prom->encode_phys_size == 32) {
- lmb_base = reg.addr32[i].address;
- lmb_size = reg.addr32[i].size;
- } else {
- lmb_base = reg.addr64[i].address;
- lmb_size = reg.addr64[i].size;
- }
-
- /* We limit memory to 2GB if the IOMMU is off */
- if (RELOC(ppc64_iommu_off)) {
- if (lmb_base >= 0x80000000UL)
- continue;
-
- if ((lmb_base + lmb_size) > 0x80000000UL)
- lmb_size = 0x80000000UL - lmb_base;
- }
-
- if (lmb_add(lmb_base, lmb_size) < 0)
- prom_print(RELOC("Too many LMB's, discarding this one...\n"));
- }
-
- }
-
- lmb_analyze();
-#ifdef DEBUG_PROM
- prom_dump_lmb();
-#endif /* DEBUG_PROM */
-}
-
-static char hypertas_funcs[1024];
-
-static void __init
-prom_instantiate_rtas(void)
-{
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
- struct rtas_t *_rtas = PTRRELOC(&rtas);
- struct systemcfg *_systemcfg = RELOC(systemcfg);
- ihandle prom_rtas;
- u32 getprop_rval;
-
-#ifdef DEBUG_PROM
- prom_print(RELOC("prom_instantiate_rtas: start...\n"));
-#endif
- prom_rtas = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/rtas"));
- if (prom_rtas != (ihandle) -1) {
- unsigned long x;
- x = call_prom(RELOC("getprop"),
- 4, 1, prom_rtas,
- RELOC("ibm,hypertas-functions"),
- hypertas_funcs,
- sizeof(hypertas_funcs));
-
- if (x != PROM_ERROR) {
- prom_print(RELOC("Hypertas detected, assuming LPAR !\n"));
- _systemcfg->platform = PLATFORM_PSERIES_LPAR;
- }
-
- call_prom(RELOC("getprop"),
- 4, 1, prom_rtas,
- RELOC("rtas-size"),
- &getprop_rval,
- sizeof(getprop_rval));
- _rtas->size = getprop_rval;
- prom_print(RELOC("instantiating rtas"));
- if (_rtas->size != 0) {
- unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
-
- /* Grab some space within the first RTAS_INSTANTIATE_MAX bytes
- * of physical memory (or within the RMO region) because RTAS
- * runs in 32-bit mode and relocate off.
- */
- if ( _systemcfg->platform == PLATFORM_PSERIES_LPAR ) {
- struct lmb *_lmb = PTRRELOC(&lmb);
- rtas_region = min(_lmb->rmo_size, RTAS_INSTANTIATE_MAX);
- }
-
- _rtas->base = lmb_alloc_base(_rtas->size, PAGE_SIZE, rtas_region);
-
- prom_print(RELOC(" at 0x"));
- prom_print_hex(_rtas->base);
-
- prom_rtas = (ihandle)call_prom(RELOC("open"),
- 1, 1, RELOC("/rtas"));
- prom_print(RELOC("..."));
-
- if (call_prom(RELOC("call-method"), 3, 2,
- RELOC("instantiate-rtas"),
- prom_rtas,
- _rtas->base) != PROM_ERROR) {
- _rtas->entry = (long)_prom->args.rets[1];
- }
- RELOC(rtas_rmo_buf)
- = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE,
- rtas_region);
- }
-
- if (_rtas->entry <= 0) {
- prom_print(RELOC(" failed\n"));
- } else {
- prom_print(RELOC(" done\n"));
- }
-
-#ifdef DEBUG_PROM
- prom_print(RELOC("rtas->base = 0x"));
- prom_print_hex(_rtas->base);
- prom_print_nl();
- prom_print(RELOC("rtas->entry = 0x"));
- prom_print_hex(_rtas->entry);
- prom_print_nl();
- prom_print(RELOC("rtas->size = 0x"));
- prom_print_hex(_rtas->size);
- prom_print_nl();
-#endif
- }
-#ifdef DEBUG_PROM
- prom_print(RELOC("prom_instantiate_rtas: end...\n"));
-#endif
-}
-
-
-#ifdef CONFIG_PMAC_DART
-static void __init prom_initialize_dart_table(void)
-{
- unsigned long offset = reloc_offset();
- extern unsigned long dart_tablebase;
- extern unsigned long dart_tablesize;
-
- /* Only reserve DART space if machine has more than 2GB of RAM
- * or if requested with iommu=on on cmdline.
- */
- if (lmb_end_of_DRAM() <= 0x80000000ull && !RELOC(iommu_force_on))
- return;
-
- /* 512 pages (2MB) is max DART tablesize. */
- RELOC(dart_tablesize) = 1UL << 21;
- /* 16MB (1 << 24) alignment. We allocate a full 16Mb chuck since we
- * will blow up an entire large page anyway in the kernel mapping
- */
- RELOC(dart_tablebase) = (unsigned long)
- abs_to_virt(lmb_alloc_base(1UL<<24, 1UL<<24, 0x80000000L));
-
- prom_print(RELOC("Dart at: "));
- prom_print_hex(RELOC(dart_tablebase));
- prom_print(RELOC("\n"));
-}
-#endif /* CONFIG_PMAC_DART */
-
-static void __init prom_initialize_tce_table(void)
-{
- phandle node;
- ihandle phb_node;
- unsigned long offset = reloc_offset();
- char compatible[64], path[64], type[64], model[64];
- unsigned long i, table = 0;
- unsigned long base, vbase, align;
- unsigned int minalign, minsize;
- struct of_tce_table *prom_tce_table = RELOC(of_tce_table);
- unsigned long tce_entry, *tce_entryp;
-
- if (RELOC(ppc64_iommu_off))
- return;
-
-#ifdef DEBUG_PROM
- prom_print(RELOC("starting prom_initialize_tce_table\n"));
-#endif
-
- /* Search all nodes looking for PHBs. */
- for (node = 0; prom_next_node(&node); ) {
- if (table == MAX_PHB) {
- prom_print(RELOC("WARNING: PCI host bridge ignored, "
- "need to increase MAX_PHB\n"));
- continue;
- }
-
- compatible[0] = 0;
- type[0] = 0;
- model[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("compatible"),
- compatible, sizeof(compatible));
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
- type, sizeof(type));
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("model"),
- model, sizeof(model));
-
- /* Keep the old logic in tack to avoid regression. */
- if (compatible[0] != 0) {
- if((strstr(compatible, RELOC("python")) == NULL) &&
- (strstr(compatible, RELOC("Speedwagon")) == NULL) &&
- (strstr(compatible, RELOC("Winnipeg")) == NULL))
- continue;
- } else if (model[0] != 0) {
- if ((strstr(model, RELOC("ython")) == NULL) &&
- (strstr(model, RELOC("peedwagon")) == NULL) &&
- (strstr(model, RELOC("innipeg")) == NULL))
- continue;
- }
-
- if ((type[0] == 0) || (strstr(type, RELOC("pci")) == NULL)) {
- continue;
- }
-
- if (call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("tce-table-minalign"), &minalign,
- sizeof(minalign)) == PROM_ERROR) {
- minalign = 0;
- }
-
- if (call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("tce-table-minsize"), &minsize,
- sizeof(minsize)) == PROM_ERROR) {
- minsize = 4UL << 20;
- }
-
- /*
- * Even though we read what OF wants, we just set the table
- * size to 4 MB. This is enough to map 2GB of PCI DMA space.
- * By doing this, we avoid the pitfalls of trying to DMA to
- * MMIO space and the DMA alias hole.
- *
- * On POWER4, firmware sets the TCE region by assuming
- * each TCE table is 8MB. Using this memory for anything
- * else will impact performance, so we always allocate 8MB.
- * Anton
- */
- if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p))
- minsize = 8UL << 20;
- else
- minsize = 4UL << 20;
-
- /* Align to the greater of the align or size */
- align = max(minalign, minsize);
-
- /* Carve out storage for the TCE table. */
- base = lmb_alloc(minsize, align);
-
- if ( !base ) {
- prom_panic(RELOC("ERROR, cannot find space for TCE table.\n"));
- }
-
- vbase = (unsigned long)abs_to_virt(base);
-
- /* Save away the TCE table attributes for later use. */
- prom_tce_table[table].node = node;
- prom_tce_table[table].base = vbase;
- prom_tce_table[table].size = minsize;
-
-#ifdef DEBUG_PROM
- prom_print(RELOC("TCE table: 0x"));
- prom_print_hex(table);
- prom_print_nl();
-
- prom_print(RELOC("\tnode = 0x"));
- prom_print_hex(node);
- prom_print_nl();
-
- prom_print(RELOC("\tbase = 0x"));
- prom_print_hex(vbase);
- prom_print_nl();
-
- prom_print(RELOC("\tsize = 0x"));
- prom_print_hex(minsize);
- prom_print_nl();
-#endif
-
- /* Initialize the table to have a one-to-one mapping
- * over the allocated size.
- */
- tce_entryp = (unsigned long *)base;
- for (i = 0; i < (minsize >> 3) ;tce_entryp++, i++) {
- tce_entry = (i << PAGE_SHIFT);
- tce_entry |= 0x3;
- *tce_entryp = tce_entry;
- }
-
- /* It seems OF doesn't null-terminate the path :-( */
- memset(path, 0, sizeof(path));
- /* Call OF to setup the TCE hardware */
- if (call_prom(RELOC("package-to-path"), 3, 1, node,
- path, sizeof(path)-1) == PROM_ERROR) {
- prom_print(RELOC("package-to-path failed\n"));
- } else {
- prom_print(RELOC("opening PHB "));
- prom_print(path);
- }
-
- phb_node = (ihandle)call_prom(RELOC("open"), 1, 1, path);
- if ( (long)phb_node <= 0) {
- prom_print(RELOC("... failed\n"));
- } else {
- prom_print(RELOC("... done\n"));
- }
- call_prom(RELOC("call-method"), 6, 0,
- RELOC("set-64-bit-addressing"),
- phb_node,
- -1,
- minsize,
- base & 0xffffffff,
- (base >> 32) & 0xffffffff);
- call_prom(RELOC("close"), 1, 0, phb_node);
-
- table++;
- }
-
- /* Flag the first invalid entry */
- prom_tce_table[table].node = 0;
-#ifdef DEBUG_PROM
- prom_print(RELOC("ending prom_initialize_tce_table\n"));
-#endif
-}
-
-/*
- * With CHRP SMP we need to use the OF to start the other
- * processors so we can't wait until smp_boot_cpus (the OF is
- * trashed by then) so we have to put the processors into
- * a holding pattern controlled by the kernel (not OF) before
- * we destroy the OF.
- *
- * This uses a chunk of low memory, puts some holding pattern
- * code there and sends the other processors off to there until
- * smp_boot_cpus tells them to do something. The holding pattern
- * checks that address until its cpu # is there, when it is that
- * cpu jumps to __secondary_start(). smp_boot_cpus() takes care
- * of setting those values.
- *
- * We also use physical address 0x4 here to tell when a cpu
- * is in its holding pattern code.
- *
- * Fixup comment... DRENG / PPPBBB - Peter
- *
- * -- Cort
- */
-static void __init prom_hold_cpus(unsigned long mem)
-{
- unsigned long i;
- unsigned int reg;
- phandle node;
- unsigned long offset = reloc_offset();
- char type[64], *path;
- int cpuid = 0;
- unsigned int interrupt_server[MAX_CPU_THREADS];
- unsigned int cpu_threads, hw_cpu_num;
- int propsize;
- extern void __secondary_hold(void);
- extern unsigned long __secondary_hold_spinloop;
- extern unsigned long __secondary_hold_acknowledge;
- unsigned long *spinloop
- = (void *)virt_to_abs(&__secondary_hold_spinloop);
- unsigned long *acknowledge
- = (void *)virt_to_abs(&__secondary_hold_acknowledge);
- unsigned long secondary_hold
- = virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold));
- struct systemcfg *_systemcfg = RELOC(systemcfg);
- struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
- struct prom_t *_prom = PTRRELOC(&prom);
-#ifdef CONFIG_SMP
- struct naca_struct *_naca = RELOC(naca);
-#endif
-
- /* On pmac, we just fill out the various global bitmasks and
- * arrays indicating our CPUs are here, they are actually started
- * later on from pmac_smp
- */
- if (_systemcfg->platform == PLATFORM_POWERMAC) {
- for (node = 0; prom_next_node(&node); ) {
- type[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
- type, sizeof(type));
- if (strcmp(type, RELOC("cpu")) != 0)
- continue;
- reg = -1;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
- ®, sizeof(reg));
- _xPaca[cpuid].xHwProcNum = reg;
-
-#ifdef CONFIG_SMP
- cpu_set(cpuid, RELOC(cpu_available_map));
- cpu_set(cpuid, RELOC(cpu_possible_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
- if (reg == 0)
- cpu_set(cpuid, RELOC(cpu_online_map));
-#endif /* CONFIG_SMP */
- cpuid++;
- }
- return;
- }
-
- /* Initially, we must have one active CPU. */
- _systemcfg->processorCount = 1;
-
-#ifdef DEBUG_PROM
- prom_print(RELOC("prom_hold_cpus: start...\n"));
- prom_print(RELOC(" 1) spinloop = 0x"));
- prom_print_hex((unsigned long)spinloop);
- prom_print_nl();
- prom_print(RELOC(" 1) *spinloop = 0x"));
- prom_print_hex(*spinloop);
- prom_print_nl();
- prom_print(RELOC(" 1) acknowledge = 0x"));
- prom_print_hex((unsigned long)acknowledge);
- prom_print_nl();
- prom_print(RELOC(" 1) *acknowledge = 0x"));
- prom_print_hex(*acknowledge);
- prom_print_nl();
- prom_print(RELOC(" 1) secondary_hold = 0x"));
- prom_print_hex(secondary_hold);
- prom_print_nl();
-#endif
-
- /* Set the common spinloop variable, so all of the secondary cpus
- * will block when they are awakened from their OF spinloop.
- * This must occur for both SMP and non SMP kernels, since OF will
- * be trashed when we move the kernel.
- */
- *spinloop = 0;
-
-#ifdef CONFIG_HMT
- for (i=0; i < NR_CPUS; i++) {
- RELOC(hmt_thread_data)[i].pir = 0xdeadbeef;
- }
-#endif
- /* look for cpus */
- for (node = 0; prom_next_node(&node); ) {
- type[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
- type, sizeof(type));
- if (strcmp(type, RELOC("cpu")) != 0)
- continue;
-
- /* Skip non-configured cpus. */
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("status"),
- type, sizeof(type));
- if (strcmp(type, RELOC("okay")) != 0)
- continue;
-
- reg = -1;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
- ®, sizeof(reg));
-
- path = (char *) mem;
- memset(path, 0, 256);
- if ((long) call_prom(RELOC("package-to-path"), 3, 1,
- node, path, 255) == PROM_ERROR)
- continue;
-
-#ifdef DEBUG_PROM
- prom_print_nl();
- prom_print(RELOC("cpuid = 0x"));
- prom_print_hex(cpuid);
- prom_print_nl();
- prom_print(RELOC("cpu hw idx = 0x"));
- prom_print_hex(reg);
- prom_print_nl();
-#endif
- _xPaca[cpuid].xHwProcNum = reg;
-
- /* Init the acknowledge var which will be reset by
- * the secondary cpu when it awakens from its OF
- * spinloop.
- */
- *acknowledge = (unsigned long)-1;
-
- propsize = call_prom(RELOC("getprop"), 4, 1, node,
- RELOC("ibm,ppc-interrupt-server#s"),
- &interrupt_server,
- sizeof(interrupt_server));
- if (propsize < 0) {
- /* no property. old hardware has no SMT */
- cpu_threads = 1;
- interrupt_server[0] = reg; /* fake it with phys id */
- } else {
- /* We have a threaded processor */
- cpu_threads = propsize / sizeof(u32);
- if (cpu_threads > MAX_CPU_THREADS) {
- prom_print(RELOC("SMT: too many threads!\nSMT: found "));
- prom_print_hex(cpu_threads);
- prom_print(RELOC(", max is "));
- prom_print_hex(MAX_CPU_THREADS);
- prom_print_nl();
- cpu_threads = 1; /* ToDo: panic? */
- }
- }
-
- hw_cpu_num = interrupt_server[0];
- if (hw_cpu_num != _prom->cpu) {
- /* Primary Thread of non-boot cpu */
- prom_print_hex(cpuid);
- prom_print(RELOC(" : starting cpu "));
- prom_print(path);
- prom_print(RELOC("... "));
- call_prom(RELOC("start-cpu"), 3, 0, node,
- secondary_hold, cpuid);
-
- for ( i = 0 ; (i < 100000000) &&
- (*acknowledge == ((unsigned long)-1)); i++ ) ;
-
- if (*acknowledge == cpuid) {
- prom_print(RELOC("... done\n"));
- /* We have to get every CPU out of OF,
- * even if we never start it. */
- if (cpuid >= NR_CPUS)
- goto next;
-#ifdef CONFIG_SMP
- /* Set the number of active processors. */
- _systemcfg->processorCount++;
- cpu_set(cpuid, RELOC(cpu_available_map));
- cpu_set(cpuid, RELOC(cpu_possible_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
-#endif
- } else {
- prom_print(RELOC("... failed: "));
- prom_print_hex(*acknowledge);
- prom_print_nl();
- }
- }
-#ifdef CONFIG_SMP
- else {
- prom_print_hex(cpuid);
- prom_print(RELOC(" : booting cpu "));
- prom_print(path);
- prom_print_nl();
- cpu_set(cpuid, RELOC(cpu_available_map));
- cpu_set(cpuid, RELOC(cpu_possible_map));
- cpu_set(cpuid, RELOC(cpu_online_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
- }
-#endif
-next:
-#ifdef CONFIG_SMP
- /* Init paca for secondary threads. They start later. */
- for (i=1; i < cpu_threads; i++) {
- cpuid++;
- if (cpuid >= NR_CPUS)
- continue;
- _xPaca[cpuid].xHwProcNum = interrupt_server[i];
- prom_print_hex(interrupt_server[i]);
- prom_print(RELOC(" : preparing thread ... "));
- if (_naca->smt_state) {
- cpu_set(cpuid, RELOC(cpu_available_map));
- cpu_set(cpuid, RELOC(cpu_present_at_boot));
- prom_print(RELOC("available"));
- } else {
- prom_print(RELOC("not available"));
- }
- prom_print_nl();
- }
-#endif
- cpuid++;
- }
-#ifdef CONFIG_HMT
- /* Only enable HMT on processors that provide support. */
- if (__is_processor(PV_PULSAR) ||
- __is_processor(PV_ICESTAR) ||
- __is_processor(PV_SSTAR)) {
- prom_print(RELOC(" starting secondary threads\n"));
-
- for (i = 0; i < NR_CPUS; i += 2) {
- if (!cpu_online(i))
- continue;
-
- if (i == 0) {
- unsigned long pir = _get_PIR();
- if (__is_processor(PV_PULSAR)) {
- RELOC(hmt_thread_data)[i].pir =
- pir & 0x1f;
- } else {
- RELOC(hmt_thread_data)[i].pir =
- pir & 0x3ff;
- }
- }
-/* cpu_set(i+1, cpu_online_map); */
- cpu_set(i+1, RELOC(cpu_possible_map));
- }
- _systemcfg->processorCount *= 2;
- } else {
- prom_print(RELOC("Processor is not HMT capable\n"));
- }
-#endif
-
- if (cpuid >= NR_CPUS)
- prom_print(RELOC("WARNING: maximum CPUs (" __stringify(NR_CPUS)
- ") exceeded: ignoring extras\n"));
-
-#ifdef DEBUG_PROM
- prom_print(RELOC("prom_hold_cpus: end...\n"));
-#endif
-}
-
-static void __init smt_setup(void)
-{
- char *p, *q;
- char my_smt_enabled = SMT_DYNAMIC;
- ihandle prom_options = NULL;
- char option[9];
- unsigned long offset = reloc_offset();
- struct naca_struct *_naca = RELOC(naca);
- char found = 0;
-
- if (strstr(RELOC(cmd_line), RELOC("smt-enabled="))) {
- for (q = RELOC(cmd_line); (p = strstr(q, RELOC("smt-enabled="))) != 0; ) {
- q = p + 12;
- if (p > RELOC(cmd_line) && p[-1] != ' ')
- continue;
- found = 1;
- if (q[0] == 'o' && q[1] == 'f' &&
- q[2] == 'f' && (q[3] == ' ' || q[3] == '\0')) {
- my_smt_enabled = SMT_OFF;
- } else if (q[0]=='o' && q[1] == 'n' &&
- (q[2] == ' ' || q[2] == '\0')) {
- my_smt_enabled = SMT_ON;
- } else {
- my_smt_enabled = SMT_DYNAMIC;
- }
- }
- }
- if (!found) {
- prom_options = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/options"));
- if (prom_options != (ihandle) -1) {
- call_prom(RELOC("getprop"),
- 4, 1, prom_options,
- RELOC("ibm,smt-enabled"),
- option,
- sizeof(option));
- if (option[0] != 0) {
- found = 1;
- if (!strcmp(option, RELOC("off")))
- my_smt_enabled = SMT_OFF;
- else if (!strcmp(option, RELOC("on")))
- my_smt_enabled = SMT_ON;
- else
- my_smt_enabled = SMT_DYNAMIC;
- }
- }
- }
-
- if (!found )
- my_smt_enabled = SMT_DYNAMIC; /* default to on */
-
- _naca->smt_state = my_smt_enabled;
-}
-
-
-#ifdef CONFIG_BOOTX_TEXT
-
-/* This function will enable the early boot text when doing OF booting. This
- * way, xmon output should work too
- */
-static void __init setup_disp_fake_bi(ihandle dp)
-{
- int width = 640, height = 480, depth = 8, pitch;
- unsigned address;
- struct pci_reg_property addrs[8];
- int i, naddrs;
- char name[64];
- unsigned long offset = reloc_offset();
- char *getprop = RELOC("getprop");
-
- prom_print(RELOC("Initializing fake screen: "));
-
- memset(name, 0, sizeof(name));
- call_prom(getprop, 4, 1, dp, RELOC("name"), name, sizeof(name));
- name[sizeof(name)-1] = 0;
- prom_print(name);
- prom_print(RELOC("\n"));
- call_prom(getprop, 4, 1, dp, RELOC("width"), &width, sizeof(width));
- call_prom(getprop, 4, 1, dp, RELOC("height"), &height, sizeof(height));
- call_prom(getprop, 4, 1, dp, RELOC("depth"), &depth, sizeof(depth));
- pitch = width * ((depth + 7) / 8);
- call_prom(getprop, 4, 1, dp, RELOC("linebytes"),
- &pitch, sizeof(pitch));
- if (pitch == 1)
- pitch = 0x1000; /* for strange IBM display */
- address = 0;
-
- prom_print(RELOC("width "));
- prom_print_hex(width);
- prom_print(RELOC(" height "));
- prom_print_hex(height);
- prom_print(RELOC(" depth "));
- prom_print_hex(depth);
- prom_print(RELOC(" linebytes "));
- prom_print_hex(pitch);
- prom_print(RELOC("\n"));
-
-
- call_prom(getprop, 4, 1, dp, RELOC("address"),
- &address, sizeof(address));
- if (address == 0) {
- /* look for an assigned address with a size of >= 1MB */
- naddrs = (int) call_prom(getprop, 4, 1, dp,
- RELOC("assigned-addresses"),
- addrs, sizeof(addrs));
- naddrs /= sizeof(struct pci_reg_property);
- for (i = 0; i < naddrs; ++i) {
- if (addrs[i].size_lo >= (1 << 20)) {
- address = addrs[i].addr.a_lo;
- /* use the BE aperture if possible */
- if (addrs[i].size_lo >= (16 << 20))
- address += (8 << 20);
- break;
- }
- }
- if (address == 0) {
- prom_print(RELOC("Failed to get address of frame buffer\n"));
- return;
- }
- }
- btext_setup_display(width, height, depth, pitch, address);
- prom_print(RELOC("Addr of fb: "));
- prom_print_hex(address);
- prom_print_nl();
- RELOC(boot_text_mapped) = 0;
-}
-#endif /* CONFIG_BOOTX_TEXT */
-
-static void __init prom_init_client_services(unsigned long pp)
-{
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
-
- /* Get a handle to the prom entry point before anything else */
- _prom->entry = pp;
-
- /* Init default value for phys size */
- _prom->encode_phys_size = 32;
-
- /* get a handle for the stdout device */
- _prom->chosen = (ihandle)call_prom(RELOC("finddevice"), 1, 1,
- RELOC("/chosen"));
- if ((long)_prom->chosen <= 0)
- prom_panic(RELOC("cannot find chosen")); /* msg won't be printed :( */
-
- /* get device tree root */
- _prom->root = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/"));
- if ((long)_prom->root <= 0)
- prom_panic(RELOC("cannot find device tree root")); /* msg won't be printed :( */
-}
-
-static void __init prom_init_stdout(void)
-{
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
- u32 val;
-
- if ((long)call_prom(RELOC("getprop"), 4, 1, _prom->chosen,
- RELOC("stdout"), &val,
- sizeof(val)) <= 0)
- prom_panic(RELOC("cannot find stdout"));
-
- _prom->stdout = (ihandle)(unsigned long)val;
-}
-
-static int __init prom_find_machine_type(void)
-{
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
- char compat[256];
- int len, i = 0;
-
- len = (int)(long)call_prom(RELOC("getprop"), 4, 1, _prom->root,
- RELOC("compatible"),
- compat, sizeof(compat)-1);
- if (len > 0) {
- compat[len] = 0;
- while (i < len) {
- char *p = &compat[i];
- int sl = strlen(p);
- if (sl == 0)
- break;
- if (strstr(p, RELOC("Power Macintosh")) ||
- strstr(p, RELOC("MacRISC4")))
- return PLATFORM_POWERMAC;
- i += sl + 1;
- }
- }
- /* Default to pSeries */
- return PLATFORM_PSERIES;
-}
-
-static int __init prom_set_color(ihandle ih, int i, int r, int g, int b)
-{
- unsigned long offset = reloc_offset();
-
- return (int)(long)call_prom(RELOC("call-method"), 6, 1,
- RELOC("color!"),
- ih,
- (void *)(long) i,
- (void *)(long) b,
- (void *)(long) g,
- (void *)(long) r );
-}
-
-/*
- * If we have a display that we don't know how to drive,
- * we will want to try to execute OF's open method for it
- * later. However, OF will probably fall over if we do that
- * we've taken over the MMU.
- * So we check whether we will need to open the display,
- * and if so, open it now.
- */
-static unsigned long __init check_display(unsigned long mem)
-{
- phandle node;
- ihandle ih;
- int i, j;
- unsigned long offset = reloc_offset();
- struct prom_t *_prom = PTRRELOC(&prom);
- char type[16], *path;
- static unsigned char default_colors[] = {
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xaa,
- 0x00, 0xaa, 0x00,
- 0x00, 0xaa, 0xaa,
- 0xaa, 0x00, 0x00,
- 0xaa, 0x00, 0xaa,
- 0xaa, 0xaa, 0x00,
- 0xaa, 0xaa, 0xaa,
- 0x55, 0x55, 0x55,
- 0x55, 0x55, 0xff,
- 0x55, 0xff, 0x55,
- 0x55, 0xff, 0xff,
- 0xff, 0x55, 0x55,
- 0xff, 0x55, 0xff,
- 0xff, 0xff, 0x55,
- 0xff, 0xff, 0xff
- };
- const unsigned char *clut;
-
- _prom->disp_node = 0;
-
- prom_print(RELOC("Looking for displays\n"));
- if (RELOC(of_stdout_device) != 0) {
- prom_print(RELOC("OF stdout is : "));
- prom_print(PTRRELOC(RELOC(of_stdout_device)));
- prom_print(RELOC("\n"));
- }
- for (node = 0; prom_next_node(&node); ) {
- type[0] = 0;
- call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
- type, sizeof(type));
- if (strcmp(type, RELOC("display")) != 0)
- continue;
- /* It seems OF doesn't null-terminate the path :-( */
- path = (char *) mem;
- memset(path, 0, 256);
-
- /*
- * leave some room at the end of the path for appending extra
- * arguments
- */
- if ((long) call_prom(RELOC("package-to-path"), 3, 1,
- node, path, 250) < 0)
- continue;
- prom_print(RELOC("found display : "));
- prom_print(path);
- prom_print(RELOC("\n"));
-
- /*
- * If this display is the device that OF is using for stdout,
- * move it to the front of the list.
- */
- mem += strlen(path) + 1;
- i = RELOC(prom_num_displays);
- RELOC(prom_num_displays) = i + 1;
- if (RELOC(of_stdout_device) != 0 && i > 0
- && strcmp(PTRRELOC(RELOC(of_stdout_device)), path) == 0) {
- for (; i > 0; --i) {
- RELOC(prom_display_paths[i])
- = RELOC(prom_display_paths[i-1]);
- RELOC(prom_display_nodes[i])
- = RELOC(prom_display_nodes[i-1]);
- }
- _prom->disp_node = (ihandle)(unsigned long)node;
- }
- RELOC(prom_display_paths[i]) = PTRUNRELOC(path);
- RELOC(prom_display_nodes[i]) = node;
- if (_prom->disp_node == 0)
- _prom->disp_node = (ihandle)(unsigned long)node;
- if (RELOC(prom_num_displays) >= FB_MAX)
- break;
- }
- prom_print(RELOC("Opening displays...\n"));
- for (j = RELOC(prom_num_displays) - 1; j >= 0; j--) {
- path = PTRRELOC(RELOC(prom_display_paths[j]));
- prom_print(RELOC("opening display : "));
- prom_print(path);
- ih = (ihandle)call_prom(RELOC("open"), 1, 1, path);
- if (ih == (ihandle)0 || ih == (ihandle)-1) {
- prom_print(RELOC("... failed\n"));
- continue;
- }
-
- prom_print(RELOC("... done\n"));
-
- /* Setup a useable color table when the appropriate
- * method is available. Should update this to set-colors */
- clut = RELOC(default_colors);
- for (i = 0; i < 32; i++, clut += 3)
- if (prom_set_color(ih, i, clut[0], clut[1],
- clut[2]) != 0)
- break;
-
-#ifdef CONFIG_LOGO_LINUX_CLUT224
- clut = PTRRELOC(RELOC(logo_linux_clut224.clut));
- for (i = 0; i < RELOC(logo_linux_clut224.clutsize); i++, clut += 3)
- if (prom_set_color(ih, i + 32, clut[0], clut[1],
- clut[2]) != 0)
- break;
-#endif /* CONFIG_LOGO_LINUX_CLUT224 */
- }
-
- return DOUBLEWORD_ALIGN(mem);
-}