···11-CONFIG_PMC_YOSEMITE=y22-CONFIG_HIGHMEM=y33-CONFIG_SMP=y44-CONFIG_NR_CPUS=255-CONFIG_HZ_1000=y66-CONFIG_SYSVIPC=y77-CONFIG_IKCONFIG=y88-CONFIG_IKCONFIG_PROC=y99-CONFIG_LOG_BUF_SHIFT=141010-CONFIG_RELAY=y1111-CONFIG_EXPERT=y1212-CONFIG_SLAB=y1313-CONFIG_MODULES=y1414-CONFIG_MODULE_UNLOAD=y1515-CONFIG_PCI=y1616-CONFIG_PM=y1717-CONFIG_NET=y1818-CONFIG_PACKET=m1919-CONFIG_UNIX=y2020-CONFIG_XFRM_USER=m2121-CONFIG_INET=y2222-CONFIG_IP_PNP=y2323-CONFIG_IP_PNP_BOOTP=y2424-CONFIG_INET_XFRM_MODE_TRANSPORT=m2525-CONFIG_INET_XFRM_MODE_TUNNEL=m2626-CONFIG_INET_XFRM_MODE_BEET=m2727-CONFIG_IPV6_PRIVACY=y2828-CONFIG_IPV6_ROUTER_PREF=y2929-CONFIG_INET6_AH=m3030-CONFIG_INET6_ESP=m3131-CONFIG_INET6_IPCOMP=m3232-CONFIG_IPV6_TUNNEL=m3333-CONFIG_NETWORK_SECMARK=y3434-CONFIG_FW_LOADER=m3535-CONFIG_CONNECTOR=m3636-CONFIG_CDROM_PKTCDVD=m3737-CONFIG_ATA_OVER_ETH=m3838-CONFIG_SGI_IOC4=m3939-CONFIG_RAID_ATTRS=m4040-CONFIG_NETDEVICES=y4141-CONFIG_PHYLIB=m4242-CONFIG_MARVELL_PHY=m4343-CONFIG_DAVICOM_PHY=m4444-CONFIG_QSEMI_PHY=m4545-CONFIG_LXT_PHY=m4646-CONFIG_CICADA_PHY=m4747-CONFIG_VITESSE_PHY=m4848-CONFIG_SMSC_PHY=m4949-CONFIG_NET_ETHERNET=y5050-CONFIG_MII=y5151-CONFIG_QLA3XXX=m5252-CONFIG_CHELSIO_T3=m5353-CONFIG_NETXEN_NIC=m5454-# CONFIG_INPUT is not set5555-# CONFIG_SERIO is not set5656-# CONFIG_VT is not set5757-CONFIG_SERIAL_8250=y5858-CONFIG_SERIAL_8250_CONSOLE=y5959-# CONFIG_HW_RANDOM is not set6060-# CONFIG_HWMON is not set6161-CONFIG_FUSE_FS=m6262-CONFIG_PROC_KCORE=y6363-CONFIG_TMPFS=y6464-CONFIG_TMPFS_POSIX_ACL=y6565-CONFIG_NFS_FS=y6666-CONFIG_ROOT_NFS=y6767-CONFIG_DEBUG_KERNEL=y6868-CONFIG_DEBUG_MUTEXES=y6969-CONFIG_KEYS=y7070-CONFIG_KEYS_DEBUG_PROC_KEYS=y7171-CONFIG_CRYPTO_NULL=m7272-CONFIG_CRYPTO_ECB=m7373-CONFIG_CRYPTO_PCBC=m7474-CONFIG_CRYPTO_HMAC=y7575-CONFIG_CRYPTO_MD4=m7676-CONFIG_CRYPTO_MICHAEL_MIC=m7777-CONFIG_CRYPTO_SHA256=m7878-CONFIG_CRYPTO_SHA512=m7979-CONFIG_CRYPTO_TGR192=m8080-CONFIG_CRYPTO_WP512=m8181-CONFIG_CRYPTO_ANUBIS=m8282-CONFIG_CRYPTO_ARC4=m8383-CONFIG_CRYPTO_BLOWFISH=m8484-CONFIG_CRYPTO_CAMELLIA=m8585-CONFIG_CRYPTO_CAST5=m8686-CONFIG_CRYPTO_CAST6=m8787-CONFIG_CRYPTO_FCRYPT=m8888-CONFIG_CRYPTO_KHAZAD=m8989-CONFIG_CRYPTO_SERPENT=m9090-CONFIG_CRYPTO_TEA=m9191-CONFIG_CRYPTO_TWOFISH=m9292-CONFIG_CRC16=m9393-CONFIG_CRC32=m9494-CONFIG_LIBCRC32C=m
-25
arch/mips/include/asm/hazards.h
···161161 )162162#define instruction_hazard() do { } while (0)163163164164-#elif defined(CONFIG_CPU_RM9000)165165-166166-/*167167- * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent168168- * use of the JTLB for instructions should not occur for 4 cpu cycles and use169169- * for data translations should not occur for 3 cpu cycles.170170- */171171-172172-ASMMACRO(mtc0_tlbw_hazard,173173- _ssnop; _ssnop; _ssnop; _ssnop174174- )175175-ASMMACRO(tlbw_use_hazard,176176- _ssnop; _ssnop; _ssnop; _ssnop177177- )178178-ASMMACRO(tlb_probe_hazard,179179- _ssnop; _ssnop; _ssnop; _ssnop180180- )181181-ASMMACRO(irq_enable_hazard,182182- )183183-ASMMACRO(irq_disable_hazard,184184- )185185-ASMMACRO(back_to_back_c0_hazard,186186- )187187-#define instruction_hazard() do { } while (0)188188-189164#elif defined(CONFIG_CPU_SB1)190165191166/*
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)77- */88-#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H99-#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H1010-1111-/*1212- * Momentum Jaguar ATX always has the RM9000 processor.1313- */1414-#define cpu_has_watch 11515-#define cpu_has_mips16 01616-#define cpu_has_divec 01717-#define cpu_has_vce 01818-#define cpu_has_cache_cdex_p 01919-#define cpu_has_cache_cdex_s 02020-#define cpu_has_prefetch 12121-#define cpu_has_mcheck 02222-#define cpu_has_ejtag 02323-2424-#define cpu_has_llsc 12525-#define cpu_has_vtag_icache 02626-#define cpu_has_dc_aliases 02727-#define cpu_has_ic_fills_f_dc 02828-#define cpu_has_dsp 02929-#define cpu_has_dsp2 03030-#define cpu_has_mipsmt 03131-#define cpu_has_userlocal 03232-#define cpu_icache_snoops_remote_store 03333-3434-#define cpu_has_nofpuex 03535-#define cpu_has_64bits 13636-3737-#define cpu_has_inclusive_pcaches 03838-3939-#define cpu_dcache_line_size() 324040-#define cpu_icache_line_size() 324141-#define cpu_scache_line_size() 324242-4343-#define cpu_has_mips32r1 04444-#define cpu_has_mips32r2 04545-#define cpu_has_mips64r1 04646-#define cpu_has_mips64r2 04747-4848-#endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */
-25
arch/mips/include/asm/mach-yosemite/war.h
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>77- */88-#ifndef __ASM_MIPS_MACH_YOSEMITE_WAR_H99-#define __ASM_MIPS_MACH_YOSEMITE_WAR_H1010-1111-#define R4600_V1_INDEX_ICACHEOP_WAR 01212-#define R4600_V1_HIT_CACHEOP_WAR 01313-#define R4600_V2_HIT_CACHEOP_WAR 01414-#define R5432_CP0_INTERRUPT_WAR 01515-#define BCM1250_M3_WAR 01616-#define SIBYTE_1956_WAR 01717-#define MIPS4K_ICACHE_REFILL_WAR 01818-#define MIPS_CACHE_SYNC_WAR 01919-#define TX49XX_ICACHE_INDEX_INV_WAR 02020-#define RM9000_CDEX_SMP_WAR 12121-#define ICACHE_REFILLS_WORKAROUND_WAR 12222-#define R10000_LLSC_WAR 02323-#define MIPS34K_MISSED_ITLB_WAR 02424-2525-#endif /* __ASM_MIPS_MACH_YOSEMITE_WAR_H */
···209209#endif210210211211/*212212- * On the RM9000 there is a problem which makes the CreateDirtyExclusive213213- * eache operation unusable on SMP systems.214214- */215215-#ifndef RM9000_CDEX_SMP_WAR216216-#error Check setting of RM9000_CDEX_SMP_WAR for your platform217217-#endif218218-219219-/*220212 * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra221213 * opposes it being called that) where invalid instructions in the same222214 * I-cache line worth of instructions being fetched may case spurious
···11-/*22- * Copyright (C) 2003 Ralf Baechle33- *44- * This program is free software; you can redistribute it and/or modify it55- * under the terms of the GNU General Public License as published by the66- * Free Software Foundation; either version 2 of the License, or (at your77- * option) any later version.88- *99- * Handler for RM9000 extended interrupts. These are a non-standard1010- * feature so we handle them separately from standard interrupts.1111- */1212-#include <linux/init.h>1313-#include <linux/interrupt.h>1414-#include <linux/irq.h>1515-#include <linux/kernel.h>1616-#include <linux/module.h>1717-1818-#include <asm/irq_cpu.h>1919-#include <asm/mipsregs.h>2020-2121-static inline void unmask_rm9k_irq(struct irq_data *d)2222-{2323- set_c0_intcontrol(0x1000 << (d->irq - RM9K_CPU_IRQ_BASE));2424-}2525-2626-static inline void mask_rm9k_irq(struct irq_data *d)2727-{2828- clear_c0_intcontrol(0x1000 << (d->irq - RM9K_CPU_IRQ_BASE));2929-}3030-3131-static inline void rm9k_cpu_irq_enable(struct irq_data *d)3232-{3333- unsigned long flags;3434-3535- local_irq_save(flags);3636- unmask_rm9k_irq(d);3737- local_irq_restore(flags);3838-}3939-4040-/*4141- * Performance counter interrupts are global on all processors.4242- */4343-static void local_rm9k_perfcounter_irq_startup(void *args)4444-{4545- rm9k_cpu_irq_enable(args);4646-}4747-4848-static unsigned int rm9k_perfcounter_irq_startup(struct irq_data *d)4949-{5050- on_each_cpu(local_rm9k_perfcounter_irq_startup, d, 1);5151-5252- return 0;5353-}5454-5555-static void local_rm9k_perfcounter_irq_shutdown(void *args)5656-{5757- unsigned long flags;5858-5959- local_irq_save(flags);6060- mask_rm9k_irq(args);6161- local_irq_restore(flags);6262-}6363-6464-static void rm9k_perfcounter_irq_shutdown(struct irq_data *d)6565-{6666- on_each_cpu(local_rm9k_perfcounter_irq_shutdown, d, 1);6767-}6868-6969-static struct irq_chip rm9k_irq_controller = {7070- .name = "RM9000",7171- .irq_ack = mask_rm9k_irq,7272- .irq_mask = mask_rm9k_irq,7373- .irq_mask_ack = mask_rm9k_irq,7474- .irq_unmask = unmask_rm9k_irq,7575- .irq_eoi = unmask_rm9k_irq7676-};7777-7878-static struct irq_chip rm9k_perfcounter_irq = {7979- .name = "RM9000",8080- .irq_startup = rm9k_perfcounter_irq_startup,8181- .irq_shutdown = rm9k_perfcounter_irq_shutdown,8282- .irq_ack = mask_rm9k_irq,8383- .irq_mask = mask_rm9k_irq,8484- .irq_mask_ack = mask_rm9k_irq,8585- .irq_unmask = unmask_rm9k_irq,8686-};8787-8888-unsigned int rm9000_perfcount_irq;8989-9090-EXPORT_SYMBOL(rm9000_perfcount_irq);9191-9292-void __init rm9k_cpu_irq_init(void)9393-{9494- int base = RM9K_CPU_IRQ_BASE;9595- int i;9696-9797- clear_c0_intcontrol(0x0000f000); /* Mask all */9898-9999- for (i = base; i < base + 4; i++)100100- irq_set_chip_and_handler(i, &rm9k_irq_controller,101101- handle_level_irq);102102-103103- rm9000_perfcount_irq = base + 1;104104- irq_set_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq,105105- handle_percpu_irq);106106-}
···140140 pref_bias_copy_load = 256;141141 break;142142143143- case CPU_RM9000:144144- /*145145- * As a workaround for erratum G105 which make the146146- * PrepareForStore hint unusable we fall back to147147- * StoreRetained on the RM9000. Once it is known which148148- * versions of the RM9000 we'll be able to condition-149149- * alize this.150150- */151151-152143 case CPU_R10000:153144 case CPU_R12000:154145 case CPU_R14000:
-18
arch/mips/mm/tlbex.c
···603603 tlbw(p);604604 break;605605606606- case CPU_RM9000:607607- /*608608- * When the JTLB is updated by tlbwi or tlbwr, a subsequent609609- * use of the JTLB for instructions should not occur for 4610610- * cpu cycles and use for data translations should not occur611611- * for 3 cpu cycles.612612- */613613- uasm_i_ssnop(p);614614- uasm_i_ssnop(p);615615- uasm_i_ssnop(p);616616- uasm_i_ssnop(p);617617- tlbw(p);618618- uasm_i_ssnop(p);619619- uasm_i_ssnop(p);620620- uasm_i_ssnop(p);621621- uasm_i_ssnop(p);622622- break;623623-624606 case CPU_VR4111:625607 case CPU_VR4121:626608 case CPU_VR4122:
···11-/*22- * Copyright 2003 PMC-Sierra33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * This program is free software; you can redistribute it and/or modify it66- * under the terms of the GNU General Public License as published by the77- * Free Software Foundation; either version 2 of the License, or (at your88- * option) any later version.99- *1010- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1111- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1212- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1313- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1414- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1515- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1616- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1717- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1818- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1919- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2020- *2121- * You should have received a copy of the GNU General Public License along2222- * with this program; if not, write to the Free Software Foundation, Inc.,2323- * 675 Mass Ave, Cambridge, MA 02139, USA.2424- */2525-#include <linux/kernel.h>2626-#include <linux/init.h>2727-#include <linux/pci.h>2828-2929-int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)3030-{3131- if (pin == 0)3232- return -1;3333-3434- return 3; /* Everything goes to one irq bit */3535-}3636-3737-/* Do platform specific device initialization at pci_enable_device() time */3838-int pcibios_plat_dev_init(struct pci_dev *dev)3939-{4040- return 0;4141-}
-124
arch/mips/pci/ops-titan-ht.c
···11-/*22- * Copyright 2003 PMC-Sierra33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * This program is free software; you can redistribute it and/or modify it66- * under the terms of the GNU General Public License as published by the77- * Free Software Foundation; either version 2 of the License, or (at your88- * option) any later version.99- *1010- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1111- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1212- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1313- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1414- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1515- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1616- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1717- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1818- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1919- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2020- *2121- * You should have received a copy of the GNU General Public License along2222- * with this program; if not, write to the Free Software Foundation, Inc.,2323- * 675 Mass Ave, Cambridge, MA 02139, USA.2424- */2525-2626-#include <linux/types.h>2727-#include <linux/pci.h>2828-#include <linux/kernel.h>2929-#include <linux/delay.h>3030-#include <asm/io.h>3131-3232-#include <asm/titan_dep.h>3333-3434-static int titan_ht_config_read_dword(struct pci_bus *bus, unsigned int devfn,3535- int offset, u32 *val)3636-{3737- volatile uint32_t address;3838- int busno;3939-4040- busno = bus->number;4141-4242- address = (busno << 16) | (devfn << 8) | (offset & 0xfc) | 0x80000000;4343- if (busno != 0)4444- address |= 1;4545-4646- /*4747- * RM9000 HT Errata: Issue back to back HT config4848- * transcations. Issue a BIU sync before and4949- * after the HT cycle5050- */5151-5252- *(volatile int32_t *) 0xfb0000f0 |= 0x2;5353-5454- udelay(30);5555-5656- *(volatile int32_t *) 0xfb0006f8 = address;5757- *(val) = *(volatile int32_t *) 0xfb0006fc;5858-5959- udelay(30);6060-6161- * (volatile int32_t *) 0xfb0000f0 |= 0x2;6262-6363- return PCIBIOS_SUCCESSFUL;6464-}6565-6666-static int titan_ht_config_read(struct pci_bus *bus, unsigned int devfn,6767- int offset, int size, u32 *val)6868-{6969- uint32_t dword;7070-7171- titan_ht_config_read_dword(bus, devfn, offset, &dword);7272-7373- dword >>= ((offset & 3) << 3);7474- dword &= (0xffffffffU >> ((4 - size) << 8));7575-7676- return PCIBIOS_SUCCESSFUL;7777-}7878-7979-static inline int titan_ht_config_write_dword(struct pci_bus *bus,8080- unsigned int devfn, int offset, u32 val)8181-{8282- volatile uint32_t address;8383- int busno;8484-8585- busno = bus->number;8686-8787- address = (busno << 16) | (devfn << 8) | (offset & 0xfc) | 0x80000000;8888- if (busno != 0)8989- address |= 1;9090-9191- *(volatile int32_t *) 0xfb0000f0 |= 0x2;9292-9393- udelay(30);9494-9595- *(volatile int32_t *) 0xfb0006f8 = address;9696- *(volatile int32_t *) 0xfb0006fc = val;9797-9898- udelay(30);9999-100100- *(volatile int32_t *) 0xfb0000f0 |= 0x2;101101-102102- return PCIBIOS_SUCCESSFUL;103103-}104104-105105-static int titan_ht_config_write(struct pci_bus *bus, unsigned int devfn,106106- int offset, int size, u32 val)107107-{108108- uint32_t val1, val2, mask;109109-110110- titan_ht_config_read_dword(bus, devfn, offset, &val2);111111-112112- val1 = val << ((offset & 3) << 3);113113- mask = ~(0xffffffffU >> ((4 - size) << 8));114114- val2 &= ~(mask << ((offset & 3) << 8));115115-116116- titan_ht_config_write_dword(bus, devfn, offset, val1 | val2);117117-118118- return PCIBIOS_SUCCESSFUL;119119-}120120-121121-struct pci_ops titan_ht_pci_ops = {122122- .read = titan_ht_config_read,123123- .write = titan_ht_config_write,124124-};
-111
arch/mips/pci/ops-titan.c
···11-/*22- * Copyright 2003 PMC-Sierra33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * This program is free software; you can redistribute it and/or modify it66- * under the terms of the GNU General Public License as published by the77- * Free Software Foundation; either version 2 of the License, or (at your88- * option) any later version.99- *1010- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1111- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1212- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1313- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1414- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1515- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1616- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1717- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1818- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1919- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2020- *2121- * You should have received a copy of the GNU General Public License along2222- * with this program; if not, write to the Free Software Foundation, Inc.,2323- * 675 Mass Ave, Cambridge, MA 02139, USA.2424- */2525-#include <linux/types.h>2626-#include <linux/pci.h>2727-#include <linux/kernel.h>2828-2929-#include <asm/pci.h>3030-#include <asm/io.h>3131-#include <asm/rm9k-ocd.h>3232-3333-/*3434- * PCI specific defines3535- */3636-#define TITAN_PCI_0_CONFIG_ADDRESS 0x7803737-#define TITAN_PCI_0_CONFIG_DATA 0x7843838-3939-/*4040- * Titan PCI Config Read Byte4141- */4242-static int titan_read_config(struct pci_bus *bus, unsigned int devfn, int reg,4343- int size, u32 * val)4444-{4545- uint32_t address, tmp;4646- int dev, busno, func;4747-4848- busno = bus->number;4949- dev = PCI_SLOT(devfn);5050- func = PCI_FUNC(devfn);5151-5252- address = (busno << 16) | (dev << 11) | (func << 8) |5353- (reg & 0xfc) | 0x80000000;5454-5555-5656- /* start the configuration cycle */5757- ocd_writel(address, TITAN_PCI_0_CONFIG_ADDRESS);5858- tmp = ocd_readl(TITAN_PCI_0_CONFIG_DATA) >> ((reg & 3) << 3);5959-6060- switch (size) {6161- case 1:6262- tmp &= 0xff;6363- case 2:6464- tmp &= 0xffff;6565- }6666- *val = tmp;6767-6868- return PCIBIOS_SUCCESSFUL;6969-}7070-7171-static int titan_write_config(struct pci_bus *bus, unsigned int devfn, int reg,7272- int size, u32 val)7373-{7474- uint32_t address;7575- int dev, busno, func;7676-7777- busno = bus->number;7878- dev = PCI_SLOT(devfn);7979- func = PCI_FUNC(devfn);8080-8181- address = (busno << 16) | (dev << 11) | (func << 8) |8282- (reg & 0xfc) | 0x80000000;8383-8484- /* start the configuration cycle */8585- ocd_writel(address, TITAN_PCI_0_CONFIG_ADDRESS);8686-8787- /* write the data */8888- switch (size) {8989- case 1:9090- ocd_writeb(val, TITAN_PCI_0_CONFIG_DATA + (~reg & 0x3));9191- break;9292-9393- case 2:9494- ocd_writew(val, TITAN_PCI_0_CONFIG_DATA + (~reg & 0x2));9595- break;9696-9797- case 4:9898- ocd_writel(val, TITAN_PCI_0_CONFIG_DATA);9999- break;100100- }101101-102102- return PCIBIOS_SUCCESSFUL;103103-}104104-105105-/*106106- * Titan PCI structure107107- */108108-struct pci_ops titan_pci_ops = {109109- titan_read_config,110110- titan_write_config,111111-};
-67
arch/mips/pci/pci-yosemite.c
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)77- */88-#include <linux/init.h>99-#include <linux/kernel.h>1010-#include <linux/types.h>1111-#include <linux/pci.h>1212-#include <asm/titan_dep.h>1313-1414-extern struct pci_ops titan_pci_ops;1515-1616-static struct resource py_mem_resource = {1717- .start = 0xe0000000UL,1818- .end = 0xe3ffffffUL,1919- .name = "Titan PCI MEM",2020- .flags = IORESOURCE_MEM2121-};2222-2323-/*2424- * PMON really reserves 16MB of I/O port space but that's stupid, nothing2525- * needs that much since allocations are limited to 256 bytes per device2626- * anyway. So we just claim 64kB here.2727- */2828-#define TITAN_IO_SIZE 0x0000ffffUL2929-#define TITAN_IO_BASE 0xe8000000UL3030-3131-static struct resource py_io_resource = {3232- .start = 0x00001000UL,3333- .end = TITAN_IO_SIZE - 1,3434- .name = "Titan IO MEM",3535- .flags = IORESOURCE_IO,3636-};3737-3838-static struct pci_controller py_controller = {3939- .pci_ops = &titan_pci_ops,4040- .mem_resource = &py_mem_resource,4141- .mem_offset = 0x00000000UL,4242- .io_resource = &py_io_resource,4343- .io_offset = 0x00000000UL4444-};4545-4646-static char ioremap_failed[] __initdata = "Could not ioremap I/O port range";4747-4848-static int __init pmc_yosemite_setup(void)4949-{5050- unsigned long io_v_base;5151-5252- io_v_base = (unsigned long) ioremap(TITAN_IO_BASE, TITAN_IO_SIZE);5353- if (!io_v_base)5454- panic(ioremap_failed);5555-5656- set_io_port_base(io_v_base);5757- py_controller.io_map_base = io_v_base;5858- TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1);5959-6060- ioport_resource.end = TITAN_IO_SIZE - 1;6161-6262- register_pci_controller(&py_controller);6363-6464- return 0;6565-}6666-6767-arch_initcall(pmc_yosemite_setup);
-4
arch/mips/pmc-sierra/Kconfig
···34343535endchoice36363737-config HYPERTRANSPORT3838- bool "Hypertransport Support for PMC-Sierra Yosemite"3939- depends on PMC_YOSEMITE4040-4137config MSP_HAS_USB4238 boolean4339 depends on PMC_MSP
···11-#22-# Makefile for the PMC-Sierra Titan33-#44-55-obj-y += irq.o prom.o py-console.o setup.o66-77-obj-$(CONFIG_SMP) += smp.o
-169
arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
···11-/*22- * Copyright (C) 2003 PMC-Sierra Inc.33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * This program is free software; you can redistribute it and/or modify it66- * under the terms of the GNU General Public License as published by the77- * Free Software Foundation; either version 2 of the License, or (at your88- * option) any later version.99- *1010- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1111- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1212- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1313- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1414- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1515- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1616- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1717- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1818- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1919- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2020- *2121- * You should have received a copy of the GNU General Public License along2222- * with this program; if not, write to the Free Software Foundation, Inc.,2323- * 675 Mass Ave, Cambridge, MA 02139, USA.2424- */2525-2626-/*2727- * Description:2828- *2929- * This code reads the ATMEL 24CXX EEPROM. The PMC-Sierra Yosemite board uses the ATMEL3030- * 24C32/24C64 which uses two byte addressing as compared to 24C16. Note that this program3131- * uses the serial port like /dev/ttyS0, to communicate with the EEPROM. Hence, you are3232- * expected to have a connectivity from the EEPROM to the serial port. This program does3333- * __not__ communicate using the I2C protocol3434- */3535-3636-#include "atmel_read_eeprom.h"3737-3838-static void delay(int delay)3939-{4040- while (delay--);4141-}4242-4343-static void send_bit(unsigned char bit)4444-{4545- scl_lo;4646- delay(TXX);4747- if (bit)4848- sda_hi;4949- else5050- sda_lo;5151-5252- delay(TXX);5353- scl_hi;5454- delay(TXX);5555-}5656-5757-static void send_ack(void)5858-{5959- send_bit(0);6060-}6161-6262-static void send_byte(unsigned char byte)6363-{6464- int i = 0;6565-6666- for (i = 7; i >= 0; i--)6767- send_bit((byte >> i) & 0x01);6868-}6969-7070-static void send_start(void)7171-{7272- sda_hi;7373- delay(TXX);7474- scl_hi;7575- delay(TXX);7676- sda_lo;7777- delay(TXX);7878-}7979-8080-static void send_stop(void)8181-{8282- sda_lo;8383- delay(TXX);8484- scl_hi;8585- delay(TXX);8686- sda_hi;8787- delay(TXX);8888-}8989-9090-static void do_idle(void)9191-{9292- sda_hi;9393- scl_hi;9494- vcc_off;9595-}9696-9797-static int recv_bit(void)9898-{9999- int status;100100-101101- scl_lo;102102- delay(TXX);103103- sda_hi;104104- delay(TXX);105105- scl_hi;106106- delay(TXX);107107-108108- return 1;109109-}110110-111111-static unsigned char recv_byte(void) {112112- int i;113113- unsigned char byte=0;114114-115115- for (i=7;i>=0;i--)116116- byte |= (recv_bit() << i);117117-118118- return byte;119119-}120120-121121-static int recv_ack(void)122122-{123123- unsigned int ack;124124-125125- ack = (unsigned int)recv_bit();126126- scl_lo;127127-128128- if (ack) {129129- do_idle();130130- printk(KERN_ERR "Error reading the Atmel 24C32/24C64 EEPROM\n");131131- return -1;132132- }133133-134134- return ack;135135-}136136-137137-/*138138- * This function does the actual read of the EEPROM. It needs the buffer into which the139139- * read data is copied, the size of the EEPROM being read and the buffer size140140- */141141-int read_eeprom(char *buffer, int eeprom_size, int size)142142-{143143- int i = 0, err;144144-145145- send_start();146146- send_byte(W_HEADER);147147- recv_ack();148148-149149- /* EEPROM with size of more than 2K need two byte addressing */150150- if (eeprom_size > 2048) {151151- send_byte(0x00);152152- recv_ack();153153- }154154-155155- send_start();156156- send_byte(R_HEADER);157157- err = recv_ack();158158- if (err == -1)159159- return err;160160-161161- for (i = 0; i < size; i++) {162162- *buffer++ = recv_byte();163163- send_ack();164164- }165165-166166- /* Note : We should do some check if the buffer contains correct information */167167-168168- send_stop();169169-}
-67
arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.h
···11-/*22- * arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c33- *44- * Copyright (C) 2003 PMC-Sierra Inc.55- * Author: Manish Lachwani (lachwani@pmc-sierra.com)66- * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)77- *88- * This program is free software; you can redistribute it and/or modify it99- * under the terms of the GNU General Public License as published by the1010- * Free Software Foundation; either version 2 of the License, or (at your1111- * option) any later version.1212- *1313- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1414- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1515- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1616- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1717- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1818- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1919- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON2020- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT2121- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF2222- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2323- *2424- * You should have received a copy of the GNU General Public License along2525- * with this program; if not, write to the Free Software Foundation, Inc.,2626- * 675 Mass Ave, Cambridge, MA 02139, USA.2727- */2828-2929-/*3030- * Header file for atmel_read_eeprom.c3131- */3232-3333-#include <linux/types.h>3434-#include <linux/pci.h>3535-#include <linux/kernel.h>3636-#include <linux/slab.h>3737-#include <asm/pci.h>3838-#include <asm/io.h>3939-#include <linux/init.h>4040-#include <asm/termios.h>4141-#include <asm/ioctls.h>4242-#include <linux/ioctl.h>4343-#include <linux/fcntl.h>4444-4545-#define DEFAULT_PORT "/dev/ttyS0" /* Port to open */4646-#define TXX 0 /* Dummy loop for spinning */4747-4848-#define BLOCK_SEL 0x004949-#define SLAVE_ADDR 0xa05050-#define READ_BIT 0x015151-#define WRITE_BIT 0x005252-#define R_HEADER SLAVE_ADDR + BLOCK_SEL + READ_BIT5353-#define W_HEADER SLAVE_ADDR + BLOCK_SEL + WRITE_BIT5454-5555-/*5656- * Clock, Voltages and Data5757- */5858-#define vcc_off (ioctl(fd, TIOCSBRK, 0))5959-#define vcc_on (ioctl(fd, TIOCCBRK, 0))6060-#define sda_hi (ioctl(fd, TIOCMBIS, &dtr))6161-#define sda_lo (ioctl(fd, TIOCMBIC, &dtr))6262-#define scl_lo (ioctl(fd, TIOCMBIC, &rts))6363-#define scl_hi (ioctl(fd, TIOCMBIS, &rts))6464-6565-const char rts = TIOCM_RTS;6666-const char dtr = TIOCM_DTR;6767-int fd;
-41
arch/mips/pmc-sierra/yosemite/ht-irq.c
···11-/*22- * Copyright 2003 PMC-Sierra33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * This program is free software; you can redistribute it and/or modify it66- * under the terms of the GNU General Public License as published by the77- * Free Software Foundation; either version 2 of the License, or (at your88- * option) any later version.99- *1010- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1111- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1212- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1313- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1414- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1515- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1616- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1717- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1818- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1919- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2020- *2121- * You should have received a copy of the GNU General Public License along2222- * with this program; if not, write to the Free Software Foundation, Inc.,2323- * 675 Mass Ave, Cambridge, MA 02139, USA.2424- */2525-2626-#include <linux/types.h>2727-#include <linux/pci.h>2828-#include <linux/kernel.h>2929-#include <linux/init.h>3030-#include <asm/pci.h>3131-3232-/*3333- * HT Bus fixup for the Titan3434- * XXX IRQ values need to change based on the board layout3535- */3636-void __init titan_ht_pcibios_fixup_bus(struct pci_bus *bus)3737-{3838- /*3939- * PLX and SPKT related changes go here4040- */4141-}
-404
arch/mips/pmc-sierra/yosemite/ht.c
···11-/*22- * Copyright 2003 PMC-Sierra33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * This program is free software; you can redistribute it and/or modify it66- * under the terms of the GNU General Public License as published by the77- * Free Software Foundation; either version 2 of the License, or (at your88- * option) any later version.99- *1010- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1111- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1212- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1313- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1414- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1515- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1616- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1717- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT1818- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF1919- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2020- *2121- * You should have received a copy of the GNU General Public License along2222- * with this program; if not, write to the Free Software Foundation, Inc.,2323- * 675 Mass Ave, Cambridge, MA 02139, USA.2424- */2525-2626-#include <linux/types.h>2727-#include <linux/pci.h>2828-#include <linux/kernel.h>2929-#include <asm/pci.h>3030-#include <asm/io.h>3131-3232-#include <linux/init.h>3333-#include <asm/titan_dep.h>3434-3535-#ifdef CONFIG_HYPERTRANSPORT3636-3737-3838-/*3939- * This function check if the Hypertransport Link Initialization completed. If4040- * it did, then proceed further with scanning bus #24141- */4242-static __inline__ int check_titan_htlink(void)4343-{4444- u32 val;4545-4646- val = *(volatile uint32_t *)(RM9000x2_HTLINK_REG);4747- if (val & 0x00000020)4848- /* HT Link Initialization completed */4949- return 1;5050- else5151- return 0;5252-}5353-5454-static int titan_ht_config_read_dword(struct pci_dev *device,5555- int offset, u32* val)5656-{5757- int dev, bus, func;5858- uint32_t address_reg, data_reg;5959- uint32_t address;6060-6161- bus = device->bus->number;6262- dev = PCI_SLOT(device->devfn);6363- func = PCI_FUNC(device->devfn);6464-6565- /* XXX Need to change the Bus # */6666- if (bus > 2)6767- address = (bus << 16) | (dev << 11) | (func << 8) | (offset & 0xfc) |6868- 0x80000000 | 0x1;6969- else7070- address = (dev << 11) | (func << 8) | (offset & 0xfc) | 0x80000000;7171-7272- address_reg = RM9000x2_OCD_HTCFGA;7373- data_reg = RM9000x2_OCD_HTCFGD;7474-7575- RM9K_WRITE(address_reg, address);7676- RM9K_READ(data_reg, val);7777-7878- return PCIBIOS_SUCCESSFUL;7979-}8080-8181-8282-static int titan_ht_config_read_word(struct pci_dev *device,8383- int offset, u16* val)8484-{8585- int dev, bus, func;8686- uint32_t address_reg, data_reg;8787- uint32_t address;8888-8989- bus = device->bus->number;9090- dev = PCI_SLOT(device->devfn);9191- func = PCI_FUNC(device->devfn);9292-9393- /* XXX Need to change the Bus # */9494- if (bus > 2)9595- address = (bus << 16) | (dev << 11) | (func << 8) | (offset & 0xfc) |9696- 0x80000000 | 0x1;9797- else9898- address = (dev << 11) | (func << 8) | (offset & 0xfc) | 0x80000000;9999-100100- address_reg = RM9000x2_OCD_HTCFGA;101101- data_reg = RM9000x2_OCD_HTCFGD;102102-103103- if ((offset & 0x3) == 0)104104- offset = 0x2;105105- else106106- offset = 0x0;107107-108108- RM9K_WRITE(address_reg, address);109109- RM9K_READ_16(data_reg + offset, val);110110-111111- return PCIBIOS_SUCCESSFUL;112112-}113113-114114-115115-u32 longswap(unsigned long l)116116-{117117- unsigned char b1, b2, b3, b4;118118-119119- b1 = l&255;120120- b2 = (l>>8)&255;121121- b3 = (l>>16)&255;122122- b4 = (l>>24)&255;123123-124124- return ((b1<<24) + (b2<<16) + (b3<<8) + b4);125125-}126126-127127-128128-static int titan_ht_config_read_byte(struct pci_dev *device,129129- int offset, u8* val)130130-{131131- int dev, bus, func;132132- uint32_t address_reg, data_reg;133133- uint32_t address;134134- int offset1;135135-136136- bus = device->bus->number;137137- dev = PCI_SLOT(device->devfn);138138- func = PCI_FUNC(device->devfn);139139-140140- /* XXX Need to change the Bus # */141141- if (bus > 2)142142- address = (bus << 16) | (dev << 11) | (func << 8) | (offset & 0xfc) |143143- 0x80000000 | 0x1;144144- else145145- address = (dev << 11) | (func << 8) | (offset & 0xfc) | 0x80000000;146146-147147- address_reg = RM9000x2_OCD_HTCFGA;148148- data_reg = RM9000x2_OCD_HTCFGD;149149-150150- RM9K_WRITE(address_reg, address);151151-152152- if ((offset & 0x3) == 0) {153153- offset1 = 0x3;154154- }155155- if ((offset & 0x3) == 1) {156156- offset1 = 0x2;157157- }158158- if ((offset & 0x3) == 2) {159159- offset1 = 0x1;160160- }161161- if ((offset & 0x3) == 3) {162162- offset1 = 0x0;163163- }164164- RM9K_READ_8(data_reg + offset1, val);165165-166166- return PCIBIOS_SUCCESSFUL;167167-}168168-169169-170170-static int titan_ht_config_write_dword(struct pci_dev *device,171171- int offset, u8 val)172172-{173173- int dev, bus, func;174174- uint32_t address_reg, data_reg;175175- uint32_t address;176176-177177- bus = device->bus->number;178178- dev = PCI_SLOT(device->devfn);179179- func = PCI_FUNC(device->devfn);180180-181181- /* XXX Need to change the Bus # */182182- if (bus > 2)183183- address = (bus << 16) | (dev << 11) | (func << 8) | (offset & 0xfc) |184184- 0x80000000 | 0x1;185185- else186186- address = (dev << 11) | (func << 8) | (offset & 0xfc) | 0x80000000;187187-188188- address_reg = RM9000x2_OCD_HTCFGA;189189- data_reg = RM9000x2_OCD_HTCFGD;190190-191191- RM9K_WRITE(address_reg, address);192192- RM9K_WRITE(data_reg, val);193193-194194- return PCIBIOS_SUCCESSFUL;195195-}196196-197197-static int titan_ht_config_write_word(struct pci_dev *device,198198- int offset, u8 val)199199-{200200- int dev, bus, func;201201- uint32_t address_reg, data_reg;202202- uint32_t address;203203-204204- bus = device->bus->number;205205- dev = PCI_SLOT(device->devfn);206206- func = PCI_FUNC(device->devfn);207207-208208- /* XXX Need to change the Bus # */209209- if (bus > 2)210210- address = (bus << 16) | (dev << 11) | (func << 8) | (offset & 0xfc) |211211- 0x80000000 | 0x1;212212- else213213- address = (dev << 11) | (func << 8) | (offset & 0xfc) | 0x80000000;214214-215215- address_reg = RM9000x2_OCD_HTCFGA;216216- data_reg = RM9000x2_OCD_HTCFGD;217217-218218- if ((offset & 0x3) == 0)219219- offset = 0x2;220220- else221221- offset = 0x0;222222-223223- RM9K_WRITE(address_reg, address);224224- RM9K_WRITE_16(data_reg + offset, val);225225-226226- return PCIBIOS_SUCCESSFUL;227227-}228228-229229-static int titan_ht_config_write_byte(struct pci_dev *device,230230- int offset, u8 val)231231-{232232- int dev, bus, func;233233- uint32_t address_reg, data_reg;234234- uint32_t address;235235- int offset1;236236-237237- bus = device->bus->number;238238- dev = PCI_SLOT(device->devfn);239239- func = PCI_FUNC(device->devfn);240240-241241- /* XXX Need to change the Bus # */242242- if (bus > 2)243243- address = (bus << 16) | (dev << 11) | (func << 8) | (offset & 0xfc) |244244- 0x80000000 | 0x1;245245- else246246- address = (dev << 11) | (func << 8) | (offset & 0xfc) | 0x80000000;247247-248248- address_reg = RM9000x2_OCD_HTCFGA;249249- data_reg = RM9000x2_OCD_HTCFGD;250250-251251- RM9K_WRITE(address_reg, address);252252-253253- if ((offset & 0x3) == 0) {254254- offset1 = 0x3;255255- }256256- if ((offset & 0x3) == 1) {257257- offset1 = 0x2;258258- }259259- if ((offset & 0x3) == 2) {260260- offset1 = 0x1;261261- }262262- if ((offset & 0x3) == 3) {263263- offset1 = 0x0;264264- }265265-266266- RM9K_WRITE_8(data_reg + offset1, val);267267- return PCIBIOS_SUCCESSFUL;268268-}269269-270270-271271-static void titan_pcibios_set_master(struct pci_dev *dev)272272-{273273- u16 cmd;274274- int bus = dev->bus->number;275275-276276- if (check_titan_htlink())277277- titan_ht_config_read_word(dev, PCI_COMMAND, &cmd);278278-279279- cmd |= PCI_COMMAND_MASTER;280280-281281- if (check_titan_htlink())282282- titan_ht_config_write_word(dev, PCI_COMMAND, cmd);283283-}284284-285285-286286-int pcibios_enable_resources(struct pci_dev *dev)287287-{288288- u16 cmd, old_cmd;289289- u8 tmp1;290290- int idx;291291- struct resource *r;292292- int bus = dev->bus->number;293293-294294- if (check_titan_htlink())295295- titan_ht_config_read_word(dev, PCI_COMMAND, &cmd);296296-297297- old_cmd = cmd;298298- for (idx = 0; idx < 6; idx++) {299299- r = &dev->resource[idx];300300- if (!r->start && r->end) {301301- printk(KERN_ERR302302- "PCI: Device %s not available because of "303303- "resource collisions\n", pci_name(dev));304304- return -EINVAL;305305- }306306- if (r->flags & IORESOURCE_IO)307307- cmd |= PCI_COMMAND_IO;308308- if (r->flags & IORESOURCE_MEM)309309- cmd |= PCI_COMMAND_MEMORY;310310- }311311- if (cmd != old_cmd) {312312- if (check_titan_htlink())313313- titan_ht_config_write_word(dev, PCI_COMMAND, cmd);314314- }315315-316316- if (check_titan_htlink())317317- titan_ht_config_read_byte(dev, PCI_CACHE_LINE_SIZE, &tmp1);318318-319319- if (tmp1 != 8) {320320- printk(KERN_WARNING "PCI setting cache line size to 8 from "321321- "%d\n", tmp1);322322- }323323-324324- if (check_titan_htlink())325325- titan_ht_config_write_byte(dev, PCI_CACHE_LINE_SIZE, 8);326326-327327- if (check_titan_htlink())328328- titan_ht_config_read_byte(dev, PCI_LATENCY_TIMER, &tmp1);329329-330330- if (tmp1 < 32 || tmp1 == 0xff) {331331- printk(KERN_WARNING "PCI setting latency timer to 32 from %d\n",332332- tmp1);333333- }334334-335335- if (check_titan_htlink())336336- titan_ht_config_write_byte(dev, PCI_LATENCY_TIMER, 32);337337-338338- return 0;339339-}340340-341341-342342-int pcibios_enable_device(struct pci_dev *dev, int mask)343343-{344344- return pcibios_enable_resources(dev);345345-}346346-347347-resource_size_t pcibios_align_resource(void *data, const struct resource *res,348348- resource_size_t size, resource_size_t align)349349-{350350- struct pci_dev *dev = data;351351- resource_size_t start = res->start;352352-353353- if (res->flags & IORESOURCE_IO) {354354- /* We need to avoid collisions with `mirrored' VGA ports355355- and other strange ISA hardware, so we always want the356356- addresses kilobyte aligned. */357357- if (size > 0x100) {358358- printk(KERN_ERR "PCI: I/O Region %s/%d too large"359359- " (%ld bytes)\n", pci_name(dev),360360- dev->resource - res, size);361361- }362362-363363- start = (start + 1024 - 1) & ~(1024 - 1);364364- }365365-366366- return start;367367-}368368-369369-struct pci_ops titan_pci_ops = {370370- titan_ht_config_read_byte,371371- titan_ht_config_read_word,372372- titan_ht_config_read_dword,373373- titan_ht_config_write_byte,374374- titan_ht_config_write_word,375375- titan_ht_config_write_dword376376-};377377-378378-void __init pcibios_fixup_bus(struct pci_bus *c)379379-{380380- titan_ht_pcibios_fixup_bus(c);381381-}382382-383383-void __init pcibios_init(void)384384-{385385-386386- /* Reset PCI I/O and PCI MEM values */387387- /* XXX Need to add the proper values here */388388- ioport_resource.start = 0xe0000000;389389- ioport_resource.end = 0xe0000000 + 0x20000000 - 1;390390- iomem_resource.start = 0xc0000000;391391- iomem_resource.end = 0xc0000000 + 0x20000000 - 1;392392-393393- /* XXX Need to add bus values */394394- pci_scan_bus(2, &titan_pci_ops, NULL);395395- pci_scan_bus(3, &titan_pci_ops, NULL);396396-}397397-398398-unsigned __init int pcibios_assign_all_busses(void)399399-{400400- /* We want to use the PCI bus detection done by PMON */401401- return 0;402402-}403403-404404-#endif /* CONFIG_HYPERTRANSPORT */
-152
arch/mips/pmc-sierra/yosemite/irq.c
···11-/*22- * Copyright (C) 2003 PMC-Sierra Inc.33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)66- *77- * This program is free software; you can redistribute it and/or modify it88- * under the terms of the GNU General Public License as published by the99- * Free Software Foundation; either version 2 of the License, or (at your1010- * option) any later version.1111- *1212- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1313- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1414- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1515- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1616- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1717- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1818- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1919- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT2020- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF2121- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2222- *2323- * You should have received a copy of the GNU General Public License along2424- * with this program; if not, write to the Free Software Foundation, Inc.,2525- * 675 Mass Ave, Cambridge, MA 02139, USA.2626- *2727- * Second level Interrupt handlers for the PMC-Sierra Titan/Yosemite board2828- */2929-#include <linux/errno.h>3030-#include <linux/init.h>3131-#include <linux/kernel_stat.h>3232-#include <linux/module.h>3333-#include <linux/signal.h>3434-#include <linux/sched.h>3535-#include <linux/types.h>3636-#include <linux/interrupt.h>3737-#include <linux/ioport.h>3838-#include <linux/irq.h>3939-#include <linux/timex.h>4040-#include <linux/random.h>4141-#include <linux/bitops.h>4242-#include <asm/bootinfo.h>4343-#include <asm/io.h>4444-#include <asm/irq.h>4545-#include <asm/irq_cpu.h>4646-#include <asm/mipsregs.h>4747-#include <asm/titan_dep.h>4848-4949-/* Hypertransport specific */5050-#define IRQ_ACK_BITS 0x00000000 /* Ack bits */5151-5252-#define HYPERTRANSPORT_INTA 0x78 /* INTA# */5353-#define HYPERTRANSPORT_INTB 0x79 /* INTB# */5454-#define HYPERTRANSPORT_INTC 0x7a /* INTC# */5555-#define HYPERTRANSPORT_INTD 0x7b /* INTD# */5656-5757-extern void titan_mailbox_irq(void);5858-5959-#ifdef CONFIG_HYPERTRANSPORT6060-/*6161- * Handle hypertransport & SMP interrupts. The interrupt lines are scarce.6262- * For interprocessor interrupts, the best thing to do is to use the INTMSG6363- * register. We use the same external interrupt line, i.e. INTB3 and monitor6464- * another status bit6565- */6666-static void ll_ht_smp_irq_handler(int irq)6767-{6868- u32 status = OCD_READ(RM9000x2_OCD_INTP0STATUS4);6969-7070- /* Ack all the bits that correspond to the interrupt sources */7171- if (status != 0)7272- OCD_WRITE(RM9000x2_OCD_INTP0STATUS4, IRQ_ACK_BITS);7373-7474- status = OCD_READ(RM9000x2_OCD_INTP1STATUS4);7575- if (status != 0)7676- OCD_WRITE(RM9000x2_OCD_INTP1STATUS4, IRQ_ACK_BITS);7777-7878-#ifdef CONFIG_HT_LEVEL_TRIGGER7979- /*8080- * Level Trigger Mode only. Send the HT EOI message back to the source.8181- */8282- switch (status) {8383- case 0x1000000:8484- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTA);8585- break;8686- case 0x2000000:8787- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTB);8888- break;8989- case 0x4000000:9090- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTC);9191- break;9292- case 0x8000000:9393- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTD);9494- break;9595- case 0x0000001:9696- /* PLX */9797- OCD_WRITE(RM9000x2_OCD_HTEOI, 0x20);9898- OCD_WRITE(IRQ_CLEAR_REG, IRQ_ACK_BITS);9999- break;100100- case 0xf000000:101101- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTA);102102- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTB);103103- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTC);104104- OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTD);105105- break;106106- }107107-#endif /* CONFIG_HT_LEVEL_TRIGGER */108108-109109- do_IRQ(irq);110110-}111111-#endif112112-113113-asmlinkage void plat_irq_dispatch(void)114114-{115115- unsigned int cause = read_c0_cause();116116- unsigned int status = read_c0_status();117117- unsigned int pending = cause & status;118118-119119- if (pending & STATUSF_IP7) {120120- do_IRQ(7);121121- } else if (pending & STATUSF_IP2) {122122-#ifdef CONFIG_HYPERTRANSPORT123123- ll_ht_smp_irq_handler(2);124124-#else125125- do_IRQ(2);126126-#endif127127- } else if (pending & STATUSF_IP3) {128128- do_IRQ(3);129129- } else if (pending & STATUSF_IP4) {130130- do_IRQ(4);131131- } else if (pending & STATUSF_IP5) {132132-#ifdef CONFIG_SMP133133- titan_mailbox_irq();134134-#else135135- do_IRQ(5);136136-#endif137137- } else if (pending & STATUSF_IP6) {138138- do_IRQ(4);139139- }140140-}141141-142142-/*143143- * Initialize the next level interrupt handler144144- */145145-void __init arch_init_irq(void)146146-{147147- clear_c0_status(ST0_IM);148148-149149- mips_cpu_irq_init();150150- rm7k_cpu_irq_init();151151- rm9k_cpu_irq_init();152152-}
-142
arch/mips/pmc-sierra/yosemite/prom.c
···11-/*22- * This program is free software; you can redistribute it and/or modify it33- * under the terms of the GNU General Public License as published by the44- * Free Software Foundation; either version 2 of the License, or (at your55- * option) any later version.66- *77- * Copyright (C) 2003, 2004 PMC-Sierra Inc.88- * Author: Manish Lachwani (lachwani@pmc-sierra.com)99- * Copyright (C) 2004 Ralf Baechle1010- */1111-#include <linux/init.h>1212-#include <linux/sched.h>1313-#include <linux/mm.h>1414-#include <linux/delay.h>1515-#include <linux/pm.h>1616-#include <linux/smp.h>1717-1818-#include <asm/io.h>1919-#include <asm/pgtable.h>2020-#include <asm/processor.h>2121-#include <asm/reboot.h>2222-#include <asm/smp-ops.h>2323-#include <asm/bootinfo.h>2424-#include <asm/pmon.h>2525-2626-#ifdef CONFIG_SMP2727-extern void prom_grab_secondary(void);2828-#else2929-#define prom_grab_secondary() do { } while (0)3030-#endif3131-3232-#include "setup.h"3333-3434-struct callvectors *debug_vectors;3535-3636-extern unsigned long yosemite_base;3737-extern unsigned long cpu_clock_freq;3838-3939-const char *get_system_type(void)4040-{4141- return "PMC-Sierra Yosemite";4242-}4343-4444-static void prom_cpu0_exit(void *arg)4545-{4646- void *nvram = (void *) YOSEMITE_RTC_BASE;4747-4848- /* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */4949- writeb(0x84, nvram + 0xff7);5050-5151- /* wait for the watchdog to go off */5252- mdelay(100 + (1000 / 16));5353-5454- /* if the watchdog fails for some reason, let people know */5555- printk(KERN_NOTICE "Watchdog reset failed\n");5656-}5757-5858-/*5959- * Reset the NVRAM over the local bus6060- */6161-static void prom_exit(void)6262-{6363-#ifdef CONFIG_SMP6464- if (smp_processor_id())6565- /* CPU 1 */6666- smp_call_function(prom_cpu0_exit, NULL, 1);6767-#endif6868- prom_cpu0_exit(NULL);6969-}7070-7171-/*7272- * Halt the system7373- */7474-static void prom_halt(void)7575-{7676- printk(KERN_NOTICE "\n** You can safely turn off the power\n");7777- while (1)7878- __asm__(".set\tmips3\n\t" "wait\n\t" ".set\tmips0");7979-}8080-8181-extern struct plat_smp_ops yos_smp_ops;8282-8383-/*8484- * Init routine which accepts the variables from PMON8585- */8686-void __init prom_init(void)8787-{8888- int argc = fw_arg0;8989- char **arg = (char **) fw_arg1;9090- char **env = (char **) fw_arg2;9191- struct callvectors *cv = (struct callvectors *) fw_arg3;9292- int i = 0;9393-9494- /* Callbacks for halt, restart */9595- _machine_restart = (void (*)(char *)) prom_exit;9696- _machine_halt = prom_halt;9797- pm_power_off = prom_halt;9898-9999- debug_vectors = cv;100100- arcs_cmdline[0] = '\0';101101-102102- /* Get the boot parameters */103103- for (i = 1; i < argc; i++) {104104- if (strlen(arcs_cmdline) + strlen(arg[i]) + 1 >=105105- sizeof(arcs_cmdline))106106- break;107107-108108- strcat(arcs_cmdline, arg[i]);109109- strcat(arcs_cmdline, " ");110110- }111111-112112-#ifdef CONFIG_SERIAL_8250_CONSOLE113113- if ((strstr(arcs_cmdline, "console=ttyS")) == NULL)114114- strcat(arcs_cmdline, "console=ttyS0,115200");115115-#endif116116-117117- while (*env) {118118- if (strncmp("ocd_base", *env, strlen("ocd_base")) == 0)119119- yosemite_base =120120- simple_strtol(*env + strlen("ocd_base="), NULL,121121- 16);122122-123123- if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0)124124- cpu_clock_freq =125125- simple_strtol(*env + strlen("cpuclock="), NULL,126126- 10);127127-128128- env++;129129- }130130-131131- prom_grab_secondary();132132-133133- register_smp_ops(&yos_smp_ops);134134-}135135-136136-void __init prom_free_prom_memory(void)137137-{138138-}139139-140140-void __init prom_fixup_mem_map(unsigned long start, unsigned long end)141141-{142142-}
-109
arch/mips/pmc-sierra/yosemite/py-console.c
···11-/*22- * This file is subject to the terms and conditions of the GNU General Public33- * License. See the file "COPYING" in the main directory of this archive44- * for more details.55- *66- * Copyright (C) 2001, 2002, 2004 Ralf Baechle77- */88-#include <linux/init.h>99-#include <linux/console.h>1010-#include <linux/kdev_t.h>1111-#include <linux/major.h>1212-#include <linux/termios.h>1313-#include <linux/sched.h>1414-#include <linux/tty.h>1515-1616-#include <linux/serial.h>1717-#include <linux/serial_core.h>1818-#include <asm/serial.h>1919-#include <asm/io.h>2020-2121-/* SUPERIO uart register map */2222-struct yo_uartregs {2323- union {2424- volatile u8 rbr; /* read only, DLAB == 0 */2525- volatile u8 thr; /* write only, DLAB == 0 */2626- volatile u8 dll; /* DLAB == 1 */2727- } u1;2828- union {2929- volatile u8 ier; /* DLAB == 0 */3030- volatile u8 dlm; /* DLAB == 1 */3131- } u2;3232- union {3333- volatile u8 iir; /* read only */3434- volatile u8 fcr; /* write only */3535- } u3;3636- volatile u8 iu_lcr;3737- volatile u8 iu_mcr;3838- volatile u8 iu_lsr;3939- volatile u8 iu_msr;4040- volatile u8 iu_scr;4141-} yo_uregs_t;4242-4343-#define iu_rbr u1.rbr4444-#define iu_thr u1.thr4545-#define iu_dll u1.dll4646-#define iu_ier u2.ier4747-#define iu_dlm u2.dlm4848-#define iu_iir u3.iir4949-#define iu_fcr u3.fcr5050-5151-#define ssnop() __asm__ __volatile__("sll $0, $0, 1\n");5252-#define ssnop_4() do { ssnop(); ssnop(); ssnop(); ssnop(); } while (0)5353-5454-#define IO_BASE_64 0x9000000000000000ULL5555-5656-static unsigned char readb_outer_space(unsigned long long phys)5757-{5858- unsigned long long vaddr = IO_BASE_64 | phys;5959- unsigned char res;6060- unsigned int sr;6161-6262- sr = read_c0_status();6363- write_c0_status((sr | ST0_KX) & ~ ST0_IE);6464- ssnop_4();6565-6666- __asm__ __volatile__ (6767- " .set mips3 \n"6868- " ld %0, %1 \n"6969- " lbu %0, (%0) \n"7070- " .set mips0 \n"7171- : "=r" (res)7272- : "m" (vaddr));7373-7474- write_c0_status(sr);7575- ssnop_4();7676-7777- return res;7878-}7979-8080-static void writeb_outer_space(unsigned long long phys, unsigned char c)8181-{8282- unsigned long long vaddr = IO_BASE_64 | phys;8383- unsigned long tmp;8484- unsigned int sr;8585-8686- sr = read_c0_status();8787- write_c0_status((sr | ST0_KX) & ~ ST0_IE);8888- ssnop_4();8989-9090- __asm__ __volatile__ (9191- " .set mips3 \n"9292- " ld %0, %1 \n"9393- " sb %2, (%0) \n"9494- " .set mips0 \n"9595- : "=&r" (tmp)9696- : "m" (vaddr), "r" (c));9797-9898- write_c0_status(sr);9999- ssnop_4();100100-}101101-102102-void prom_putchar(char c)103103-{104104- unsigned long lsr = 0xfd000008ULL + offsetof(struct yo_uartregs, iu_lsr);105105- unsigned long thr = 0xfd000008ULL + offsetof(struct yo_uartregs, iu_thr);106106-107107- while ((readb_outer_space(lsr) & 0x20) == 0);108108- writeb_outer_space(thr, c);109109-}
-224
arch/mips/pmc-sierra/yosemite/setup.c
···11-/*22- * Copyright (C) 2003 PMC-Sierra Inc.33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- *55- * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)66- *77- * This program is free software; you can redistribute it and/or modify it88- * under the terms of the GNU General Public License as published by the99- * Free Software Foundation; either version 2 of the License, or (at your1010- * option) any later version.1111- *1212- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED1313- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF1414- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN1515- * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,1616- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT1717- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF1818- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON1919- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT2020- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF2121- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.2222- *2323- * You should have received a copy of the GNU General Public License along2424- * with this program; if not, write to the Free Software Foundation, Inc.,2525- * 675 Mass Ave, Cambridge, MA 02139, USA.2626- */2727-#include <linux/bcd.h>2828-#include <linux/init.h>2929-#include <linux/kernel.h>3030-#include <linux/export.h>3131-#include <linux/types.h>3232-#include <linux/mm.h>3333-#include <linux/bootmem.h>3434-#include <linux/swap.h>3535-#include <linux/ioport.h>3636-#include <linux/sched.h>3737-#include <linux/interrupt.h>3838-#include <linux/timex.h>3939-#include <linux/termios.h>4040-#include <linux/tty.h>4141-#include <linux/serial.h>4242-#include <linux/serial_core.h>4343-#include <linux/serial_8250.h>4444-4545-#include <asm/time.h>4646-#include <asm/bootinfo.h>4747-#include <asm/page.h>4848-#include <asm/io.h>4949-#include <asm/irq.h>5050-#include <asm/processor.h>5151-#include <asm/reboot.h>5252-#include <asm/serial.h>5353-#include <asm/titan_dep.h>5454-#include <asm/m48t37.h>5555-5656-#include "setup.h"5757-5858-unsigned char titan_ge_mac_addr_base[6] = {5959- // 0x00, 0x03, 0xcc, 0x1d, 0x22, 0x006060- 0x00, 0xe0, 0x04, 0x00, 0x00, 0x216161-};6262-6363-unsigned long cpu_clock_freq;6464-unsigned long yosemite_base;6565-6666-static struct m48t37_rtc *m48t37_base;6767-6868-void __init bus_error_init(void)6969-{7070- /* Do nothing */7171-}7272-7373-7474-void read_persistent_clock(struct timespec *ts)7575-{7676- unsigned int year, month, day, hour, min, sec;7777- unsigned long flags;7878-7979- spin_lock_irqsave(&rtc_lock, flags);8080- /* Stop the update to the time */8181- m48t37_base->control = 0x40;8282-8383- year = bcd2bin(m48t37_base->year);8484- year += bcd2bin(m48t37_base->century) * 100;8585-8686- month = bcd2bin(m48t37_base->month);8787- day = bcd2bin(m48t37_base->date);8888- hour = bcd2bin(m48t37_base->hour);8989- min = bcd2bin(m48t37_base->min);9090- sec = bcd2bin(m48t37_base->sec);9191-9292- /* Start the update to the time again */9393- m48t37_base->control = 0x00;9494- spin_unlock_irqrestore(&rtc_lock, flags);9595-9696- ts->tv_sec = mktime(year, month, day, hour, min, sec);9797- ts->tv_nsec = 0;9898-}9999-100100-int rtc_mips_set_time(unsigned long tim)101101-{102102- struct rtc_time tm;103103- unsigned long flags;104104-105105- /*106106- * Convert to a more useful format -- note months count from 0107107- * and years from 1900108108- */109109- rtc_time_to_tm(tim, &tm);110110- tm.tm_year += 1900;111111- tm.tm_mon += 1;112112-113113- spin_lock_irqsave(&rtc_lock, flags);114114- /* enable writing */115115- m48t37_base->control = 0x80;116116-117117- /* year */118118- m48t37_base->year = bin2bcd(tm.tm_year % 100);119119- m48t37_base->century = bin2bcd(tm.tm_year / 100);120120-121121- /* month */122122- m48t37_base->month = bin2bcd(tm.tm_mon);123123-124124- /* day */125125- m48t37_base->date = bin2bcd(tm.tm_mday);126126-127127- /* hour/min/sec */128128- m48t37_base->hour = bin2bcd(tm.tm_hour);129129- m48t37_base->min = bin2bcd(tm.tm_min);130130- m48t37_base->sec = bin2bcd(tm.tm_sec);131131-132132- /* day of week -- not really used, but let's keep it up-to-date */133133- m48t37_base->day = bin2bcd(tm.tm_wday + 1);134134-135135- /* disable writing */136136- m48t37_base->control = 0x00;137137- spin_unlock_irqrestore(&rtc_lock, flags);138138-139139- return 0;140140-}141141-142142-void __init plat_time_init(void)143143-{144144- mips_hpt_frequency = cpu_clock_freq / 2;145145-mips_hpt_frequency = 33000000 * 3 * 5;146146-}147147-148148-unsigned long ocd_base;149149-150150-EXPORT_SYMBOL(ocd_base);151151-152152-/*153153- * Common setup before any secondaries are started154154- */155155-156156-#define TITAN_UART_CLK 3686400157157-#define TITAN_SERIAL_BASE_BAUD (TITAN_UART_CLK / 16)158158-#define TITAN_SERIAL_IRQ 4159159-#define TITAN_SERIAL_BASE 0xfd000008UL160160-161161-static void __init py_map_ocd(void)162162-{163163- ocd_base = (unsigned long) ioremap(OCD_BASE, OCD_SIZE);164164- if (!ocd_base)165165- panic("Mapping OCD failed - game over. Your score is 0.");166166-167167- /* Kludge for PMON bug ... */168168- OCD_WRITE(0x0710, 0x0ffff029);169169-}170170-171171-static void __init py_uart_setup(void)172172-{173173-#ifdef CONFIG_SERIAL_8250174174- struct uart_port up;175175-176176- /*177177- * Register to interrupt zero because we share the interrupt with178178- * the serial driver which we don't properly support yet.179179- */180180- memset(&up, 0, sizeof(up));181181- up.membase = (unsigned char *) ioremap(TITAN_SERIAL_BASE, 8);182182- up.irq = TITAN_SERIAL_IRQ;183183- up.uartclk = TITAN_UART_CLK;184184- up.regshift = 0;185185- up.iotype = UPIO_MEM;186186- up.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;187187- up.line = 0;188188-189189- if (early_serial_setup(&up))190190- printk(KERN_ERR "Early serial init of port 0 failed\n");191191-#endif /* CONFIG_SERIAL_8250 */192192-}193193-194194-static void __init py_rtc_setup(void)195195-{196196- m48t37_base = ioremap(YOSEMITE_RTC_BASE, YOSEMITE_RTC_SIZE);197197- if (!m48t37_base)198198- printk(KERN_ERR "Mapping the RTC failed\n");199199-}200200-201201-/* Not only time init but that's what the hook it's called through is named */202202-static void __init py_late_time_init(void)203203-{204204- py_map_ocd();205205- py_uart_setup();206206- py_rtc_setup();207207-}208208-209209-void __init plat_mem_setup(void)210210-{211211- late_time_init = py_late_time_init;212212-213213- /* Add memory regions */214214- add_memory_region(0x00000000, 0x10000000, BOOT_MEM_RAM);215215-216216-#if 0 /* XXX Crash ... */217217- OCD_WRITE(RM9000x2_OCD_HTSC,218218- OCD_READ(RM9000x2_OCD_HTSC) | HYPERTRANSPORT_ENABLE);219219-220220- /* Set the BAR. Shifted mode */221221- OCD_WRITE(RM9000x2_OCD_HTBAR0, HYPERTRANSPORT_BAR0_ADDR);222222- OCD_WRITE(RM9000x2_OCD_HTMASK0, HYPERTRANSPORT_SIZE0);223223-#endif224224-}
-32
arch/mips/pmc-sierra/yosemite/setup.h
···11-/*22- * Copyright 2003, 04 PMC-Sierra33- * Author: Manish Lachwani (lachwani@pmc-sierra.com)44- * Copyright 2004 Ralf Baechle <ralf@linux-mips.org>55- *66- * Board specific definititions for the PMC-Sierra Yosemite77- *88- * This program is free software; you can redistribute it and/or modify it99- * under the terms of the GNU General Public License as published by the1010- * Free Software Foundation; either version 2 of the License, or (at your1111- * option) any later version.1212- */1313-#ifndef __SETUP_H__1414-#define __SETUP_H__1515-1616-/* M48T37 RTC + NVRAM */1717-#define YOSEMITE_RTC_BASE 0xfc8000001818-#define YOSEMITE_RTC_SIZE 0x008000001919-2020-#define HYPERTRANSPORT_BAR0_ADDR 0x000000062121-#define HYPERTRANSPORT_SIZE0 0x0fffffff2222-#define HYPERTRANSPORT_BAR0_ATTR 0x000020002323-2424-#define HYPERTRANSPORT_ENABLE 0x62525-2626-/*2727- * EEPROM Size2828- */2929-#define TITAN_ATMEL_24C32_SIZE 327683030-#define TITAN_ATMEL_24C64_SIZE 655363131-3232-#endif /* __SETUP_H__ */
-185
arch/mips/pmc-sierra/yosemite/smp.c
···11-#include <linux/linkage.h>22-#include <linux/sched.h>33-#include <linux/smp.h>44-55-#include <asm/pmon.h>66-#include <asm/titan_dep.h>77-#include <asm/time.h>88-99-#define LAUNCHSTACK_SIZE 2561010-1111-static __cpuinitdata arch_spinlock_t launch_lock = __ARCH_SPIN_LOCK_UNLOCKED;1212-1313-static unsigned long secondary_sp __cpuinitdata;1414-static unsigned long secondary_gp __cpuinitdata;1515-1616-static unsigned char launchstack[LAUNCHSTACK_SIZE] __initdata1717- __attribute__((aligned(2 * sizeof(long))));1818-1919-static void __init prom_smp_bootstrap(void)2020-{2121- local_irq_disable();2222-2323- while (arch_spin_is_locked(&launch_lock));2424-2525- __asm__ __volatile__(2626- " move $sp, %0 \n"2727- " move $gp, %1 \n"2828- " j smp_bootstrap \n"2929- :3030- : "r" (secondary_sp), "r" (secondary_gp));3131-}3232-3333-/*3434- * PMON is a fragile beast. It'll blow up once the mappings it's littering3535- * right into the middle of KSEG3 are blown away so we have to grab the slave3636- * core early and keep it in a waiting loop.3737- */3838-void __init prom_grab_secondary(void)3939-{4040- arch_spin_lock(&launch_lock);4141-4242- pmon_cpustart(1, &prom_smp_bootstrap,4343- launchstack + LAUNCHSTACK_SIZE, 0);4444-}4545-4646-void titan_mailbox_irq(void)4747-{4848- int cpu = smp_processor_id();4949- unsigned long status;5050-5151- switch (cpu) {5252- case 0:5353- status = OCD_READ(RM9000x2_OCD_INTP0STATUS3);5454- OCD_WRITE(RM9000x2_OCD_INTP0CLEAR3, status);5555-5656- if (status & 0x2)5757- smp_call_function_interrupt();5858- if (status & 0x4)5959- scheduler_ipi();6060- break;6161-6262- case 1:6363- status = OCD_READ(RM9000x2_OCD_INTP1STATUS3);6464- OCD_WRITE(RM9000x2_OCD_INTP1CLEAR3, status);6565-6666- if (status & 0x2)6767- smp_call_function_interrupt();6868- if (status & 0x4)6969- scheduler_ipi();7070- break;7171- }7272-}7373-7474-/*7575- * Send inter-processor interrupt7676- */7777-static void yos_send_ipi_single(int cpu, unsigned int action)7878-{7979- /*8080- * Generate an INTMSG so that it can be sent over to the8181- * destination CPU. The INTMSG will put the STATUS bits8282- * based on the action desired. An alternative strategy8383- * is to write to the Interrupt Set register, read the8484- * Interrupt Status register and clear the Interrupt8585- * Clear register. The latter is preffered.8686- */8787- switch (action) {8888- case SMP_RESCHEDULE_YOURSELF:8989- if (cpu == 1)9090- OCD_WRITE(RM9000x2_OCD_INTP1SET3, 4);9191- else9292- OCD_WRITE(RM9000x2_OCD_INTP0SET3, 4);9393- break;9494-9595- case SMP_CALL_FUNCTION:9696- if (cpu == 1)9797- OCD_WRITE(RM9000x2_OCD_INTP1SET3, 2);9898- else9999- OCD_WRITE(RM9000x2_OCD_INTP0SET3, 2);100100- break;101101- }102102-}103103-104104-static void yos_send_ipi_mask(const struct cpumask *mask, unsigned int action)105105-{106106- unsigned int i;107107-108108- for_each_cpu(i, mask)109109- yos_send_ipi_single(i, action);110110-}111111-112112-/*113113- * After we've done initial boot, this function is called to allow the114114- * board code to clean up state, if needed115115- */116116-static void __cpuinit yos_init_secondary(void)117117-{118118-}119119-120120-static void __cpuinit yos_smp_finish(void)121121-{122122- set_c0_status(ST0_CO | ST0_IM | ST0_IE);123123-}124124-125125-/* Hook for after all CPUs are online */126126-static void yos_cpus_done(void)127127-{128128-}129129-130130-/*131131- * Firmware CPU startup hook132132- * Complicated by PMON's weird interface which tries to minimic the UNIX fork.133133- * It launches the next * available CPU and copies some information on the134134- * stack so the first thing we do is throw away that stuff and load useful135135- * values into the registers ...136136- */137137-static void __cpuinit yos_boot_secondary(int cpu, struct task_struct *idle)138138-{139139- unsigned long gp = (unsigned long) task_thread_info(idle);140140- unsigned long sp = __KSTK_TOS(idle);141141-142142- secondary_sp = sp;143143- secondary_gp = gp;144144-145145- arch_spin_unlock(&launch_lock);146146-}147147-148148-/*149149- * Detect available CPUs, populate cpu_possible_mask before smp_init150150- *151151- * We don't want to start the secondary CPU yet nor do we have a nice probing152152- * feature in PMON so we just assume presence of the secondary core.153153- */154154-static void __init yos_smp_setup(void)155155-{156156- int i;157157-158158- init_cpu_possible(cpu_none_mask);159159-160160- for (i = 0; i < 2; i++) {161161- set_cpu_possible(i, true);162162- __cpu_number_map[i] = i;163163- __cpu_logical_map[i] = i;164164- }165165-}166166-167167-static void __init yos_prepare_cpus(unsigned int max_cpus)168168-{169169- /*170170- * Be paranoid. Enable the IPI only if we're really about to go SMP.171171- */172172- if (num_possible_cpus())173173- set_c0_status(STATUSF_IP5);174174-}175175-176176-struct plat_smp_ops yos_smp_ops = {177177- .send_ipi_single = yos_send_ipi_single,178178- .send_ipi_mask = yos_send_ipi_mask,179179- .init_secondary = yos_init_secondary,180180- .smp_finish = yos_smp_finish,181181- .cpus_done = yos_cpus_done,182182- .boot_secondary = yos_boot_secondary,183183- .smp_setup = yos_smp_setup,184184- .prepare_cpus = yos_prepare_cpus,185185-};