linux-old/arch/sh/stboards/setup.c
<<
>>
Prefs
   1/*
   2 * arch/sh/stboard/setup.c
   3 *
   4 * Copyright (C) 2001 Stuart Menefy (stuart.menefy@st.com)
   5 *
   6 * May be copied or modified under the terms of the GNU General Public
   7 * License.  See linux/COPYING for more information.
   8 *
   9 * STMicroelectronics ST40STB1 HARP and compatible support.
  10 */
  11
  12#include <linux/config.h>
  13#include <linux/kernel.h>
  14#include <linux/init.h>
  15#include <asm/io.h>
  16#include "harp.h"
  17/*
  18 * Initialize the board
  19 */
  20int __init setup_harp(void)
  21{
  22#ifdef CONFIG_SH_STB1_HARP
  23        unsigned long ic8_version, ic36_version;
  24
  25        ic8_version = ctrl_inl(EPLD_REVID2);
  26        ic36_version = ctrl_inl(EPLD_REVID1);
  27
  28        printk("STMicroelectronics STB1 HARP initialisaton\n");
  29        printk("EPLD versions: IC8: %d.%02d, IC36: %d.%02d\n",
  30               (ic8_version >> 4) & 0xf, ic8_version & 0xf,
  31               (ic36_version >> 4) & 0xf, ic36_version & 0xf);
  32#elif defined(CONFIG_SH_STB1_OVERDRIVE)
  33        unsigned long version;
  34
  35        version = ctrl_inl(EPLD_REVID);
  36
  37        printk("STMicroelectronics STB1 Overdrive initialisaton\n");
  38        printk("EPLD version: %d.%02d\n",
  39               (version >> 4) & 0xf, version & 0xf);
  40#else
  41#error Undefined machine
  42#endif
  43 
  44        /* Currently all STB1 chips have problems with the sleep instruction,
  45         * so disable it here.
  46         */
  47        disable_hlt();
  48
  49        return 0;
  50}
  51
  52#ifdef CONFIG_PCI
  53/*
  54 * PCI based boards need a function that maps IRQ's to given PCI
  55 * slots. This code is used by the st40 pci routines in arch/sh/kernel
  56 */
  57 
  58int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
  59{
  60        switch (slot) {
  61#ifdef CONFIG_SH_STB1_HARP
  62        case 2:         /*This is the PCI slot on the */
  63                return HARP_PCI_IRQ;
  64        case 1:         /* this is the bridge */
  65                return HARP_BRIDGE_IRQ;
  66#elif defined(CONFIG_SH_STB1_OVERDRIVE)
  67        case 1:
  68        case 2:
  69        case 3:
  70                return slot - 1;
  71#else
  72#error Unknown board
  73#endif
  74        default:
  75                return -1;
  76        }
  77}
  78#endif
  79
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.