Path: blob/master/arch/powerpc/kernel/cpu_setup_fsl_booke.S
10818 views
/*1* This file contains low level CPU setup functions.2* Kumar Gala <[email protected]>3* Copyright 2009 Freescale Semiconductor, Inc.4*5* Based on cpu_setup_6xx code by6* Benjamin Herrenschmidt <[email protected]>7*8* This program is free software; you can redistribute it and/or9* modify it under the terms of the GNU General Public License10* as published by the Free Software Foundation; either version11* 2 of the License, or (at your option) any later version.12*13*/1415#include <asm/processor.h>16#include <asm/cputable.h>17#include <asm/ppc_asm.h>1819_GLOBAL(__e500_icache_setup)20mfspr r0, SPRN_L1CSR121andi. r3, r0, L1CSR1_ICE22bnelr /* Already enabled */23oris r0, r0, L1CSR1_CPE@h24ori r0, r0, (L1CSR1_ICFI | L1CSR1_ICLFR | L1CSR1_ICE)25mtspr SPRN_L1CSR1, r0 /* Enable I-Cache */26isync27blr2829_GLOBAL(__e500_dcache_setup)30mfspr r0, SPRN_L1CSR031andi. r3, r0, L1CSR0_DCE32bnelr /* Already enabled */33msync34isync35li r0, 036mtspr SPRN_L1CSR0, r0 /* Disable */37msync38isync39li r0, (L1CSR0_DCFI | L1CSR0_CLFC)40mtspr SPRN_L1CSR0, r0 /* Invalidate */41isync421: mfspr r0, SPRN_L1CSR043andi. r3, r0, L1CSR0_CLFC44bne+ 1b /* Wait for lock bits reset */45oris r0, r0, L1CSR0_CPE@h46ori r0, r0, L1CSR0_DCE47msync48isync49mtspr SPRN_L1CSR0, r0 /* Enable */50isync51blr5253#ifdef CONFIG_PPC3254_GLOBAL(__setup_cpu_e200)55/* enable dedicated debug exception handling resources (Debug APU) */56mfspr r3,SPRN_HID057ori r3,r3,HID0_DAPUEN@l58mtspr SPRN_HID0,r359b __setup_e200_ivors60_GLOBAL(__setup_cpu_e500v1)61_GLOBAL(__setup_cpu_e500v2)62mflr r463bl __e500_icache_setup64bl __e500_dcache_setup65bl __setup_e500_ivors66#ifdef CONFIG_FSL_RIO67/* Ensure that RFXE is set */68mfspr r3,SPRN_HID169oris r3,r3,HID1_RFXE@h70mtspr SPRN_HID1,r371#endif72mtlr r473blr74_GLOBAL(__setup_cpu_e500mc)75mflr r476bl __e500_icache_setup77bl __e500_dcache_setup78bl __setup_e500mc_ivors79mtlr r480blr81#endif82/* Right now, restore and setup are the same thing */83_GLOBAL(__restore_cpu_e5500)84_GLOBAL(__setup_cpu_e5500)85mflr r486bl __e500_icache_setup87bl __e500_dcache_setup88#ifdef CONFIG_PPC_BOOK3E_6489bl .__setup_base_ivors90bl .setup_perfmon_ivor91bl .setup_doorbell_ivors92bl .setup_ehv_ivors93#else94bl __setup_e500mc_ivors95#endif96mtlr r497blr9899100