1*89d63fe1SAtsushi Nemoto /* 2*89d63fe1SAtsushi Nemoto * linux/arch/mips/txx9/generic/setup.c 3*89d63fe1SAtsushi Nemoto * 4*89d63fe1SAtsushi Nemoto * Based on linux/arch/mips/txx9/rbtx4938/setup.c, 5*89d63fe1SAtsushi Nemoto * and RBTX49xx patch from CELF patch archive. 6*89d63fe1SAtsushi Nemoto * 7*89d63fe1SAtsushi Nemoto * 2003-2005 (c) MontaVista Software, Inc. 8*89d63fe1SAtsushi Nemoto * (C) Copyright TOSHIBA CORPORATION 2000-2001, 2004-2007 9*89d63fe1SAtsushi Nemoto * 10*89d63fe1SAtsushi Nemoto * This file is subject to the terms and conditions of the GNU General Public 11*89d63fe1SAtsushi Nemoto * License. See the file "COPYING" in the main directory of this archive 12*89d63fe1SAtsushi Nemoto * for more details. 13*89d63fe1SAtsushi Nemoto */ 14*89d63fe1SAtsushi Nemoto #include <linux/init.h> 15*89d63fe1SAtsushi Nemoto #include <linux/kernel.h> 16*89d63fe1SAtsushi Nemoto #include <linux/types.h> 17*89d63fe1SAtsushi Nemoto #include <asm/txx9/generic.h> 18*89d63fe1SAtsushi Nemoto 19*89d63fe1SAtsushi Nemoto /* EBUSC settings of TX4927, etc. */ 20*89d63fe1SAtsushi Nemoto struct resource txx9_ce_res[8]; 21*89d63fe1SAtsushi Nemoto static char txx9_ce_res_name[8][4]; /* "CEn" */ 22*89d63fe1SAtsushi Nemoto 23*89d63fe1SAtsushi Nemoto /* pcode, internal register */ 24*89d63fe1SAtsushi Nemoto char txx9_pcode_str[8]; 25*89d63fe1SAtsushi Nemoto static struct resource txx9_reg_res = { 26*89d63fe1SAtsushi Nemoto .name = txx9_pcode_str, 27*89d63fe1SAtsushi Nemoto .flags = IORESOURCE_MEM, 28*89d63fe1SAtsushi Nemoto }; 29*89d63fe1SAtsushi Nemoto void __init 30*89d63fe1SAtsushi Nemoto txx9_reg_res_init(unsigned int pcode, unsigned long base, unsigned long size) 31*89d63fe1SAtsushi Nemoto { 32*89d63fe1SAtsushi Nemoto int i; 33*89d63fe1SAtsushi Nemoto 34*89d63fe1SAtsushi Nemoto for (i = 0; i < ARRAY_SIZE(txx9_ce_res); i++) { 35*89d63fe1SAtsushi Nemoto sprintf(txx9_ce_res_name[i], "CE%d", i); 36*89d63fe1SAtsushi Nemoto txx9_ce_res[i].flags = IORESOURCE_MEM; 37*89d63fe1SAtsushi Nemoto txx9_ce_res[i].name = txx9_ce_res_name[i]; 38*89d63fe1SAtsushi Nemoto } 39*89d63fe1SAtsushi Nemoto 40*89d63fe1SAtsushi Nemoto sprintf(txx9_pcode_str, "TX%x", pcode); 41*89d63fe1SAtsushi Nemoto if (base) { 42*89d63fe1SAtsushi Nemoto txx9_reg_res.start = base & 0xfffffffffULL; 43*89d63fe1SAtsushi Nemoto txx9_reg_res.end = (base & 0xfffffffffULL) + (size - 1); 44*89d63fe1SAtsushi Nemoto request_resource(&iomem_resource, &txx9_reg_res); 45*89d63fe1SAtsushi Nemoto } 46*89d63fe1SAtsushi Nemoto } 47*89d63fe1SAtsushi Nemoto 48*89d63fe1SAtsushi Nemoto /* clocks */ 49*89d63fe1SAtsushi Nemoto unsigned int txx9_master_clock; 50*89d63fe1SAtsushi Nemoto unsigned int txx9_cpu_clock; 51*89d63fe1SAtsushi Nemoto unsigned int txx9_gbus_clock; 52