source: trunk/target/linux/lantiq/patches-3.2/0067-MIPS-lantiq-adds-bootsel-helper.patch @ 31260

Last change on this file since 31260 was 31260, checked in by blogic, 5 years ago

[lantiq] update 3.2 patches

sync with lantiq kernel series

File size: 2.0 KB
  • arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h

    From 5e679bb5e0ba948e5a1aa52ab50b6b60d175348d Mon Sep 17 00:00:00 2001
    From: John Crispin <blogic@openwrt.org>
    Date: Wed, 21 Mar 2012 14:17:37 +0100
    Subject: [PATCH 67/73] MIPS: lantiq: adds bootsel helper
    
    ---
     .../mips/include/asm/mach-lantiq/xway/lantiq_soc.h |   12 ++++++++++++
     arch/mips/lantiq/xway/reset.c                      |   12 +++++++++++-
     2 files changed, 23 insertions(+), 1 deletions(-)
    
    diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
    index bfdeb16..1ec8f2a 100644
    a b  
    144144#define LTQ_MPS_BASE_ADDR       (KSEG1 + 0x1F107000) 
    145145#define LTQ_MPS_CHIPID          ((u32 *)(LTQ_MPS_BASE_ADDR + 0x0344)) 
    146146 
     147/* BOOT_SEL - find what boot media we have */ 
     148#define BS_EXT_ROM      0x0 
     149#define BS_FLASH        0x1 
     150#define BS_MII0         0x2 
     151#define BS_PCI          0x3 
     152#define BS_UART1        0x4 
     153#define BS_SPI          0x5 
     154#define BS_NAND         0x6 
     155#define BS_RMII0        0x7 
     156 
     157extern unsigned char ltq_boot_select(void); 
     158 
    147159/* register access macros for EBU and CGU */ 
    148160#define ltq_ebu_w32(x, y)       ltq_w32((x), ltq_ebu_membase + (y)) 
    149161#define ltq_ebu_r32(x)          ltq_r32(ltq_ebu_membase + (x)) 
  • arch/mips/lantiq/xway/reset.c

    diff --git a/arch/mips/lantiq/xway/reset.c b/arch/mips/lantiq/xway/reset.c
    index 8a5dff1..b8f7ffb 100644
    a b  
    2727#define RCU_RST_STAT    0x0014 
    2828 
    2929/* reset cause */ 
    30 #define RCU_STAT_SHIFT  26 
     30#define RCU_STAT_SHIFT          26 
     31/* boot selection */ 
     32#define RCU_BOOT_SEL_SHIFT      26 
     33#define RCU_BOOT_SEL_MASK       0x7 
     34 
    3135/* Global SW Reset */ 
    3236#define RCU_RD_SRST             BIT(30) 
    3337/* Memory Controller */ 
    int ltq_reset_cause(void) 
    7579} 
    7680EXPORT_SYMBOL_GPL(ltq_reset_cause); 
    7781 
     82unsigned char ltq_boot_select(void) 
     83{ 
     84        u32 val = ltq_rcu_r32(RCU_RST_STAT); 
     85        return (val >> RCU_BOOT_SEL_SHIFT) & RCU_BOOT_SEL_MASK; 
     86} 
     87 
    7888void ltq_reset_once(unsigned int module, ulong usec) 
    7989{ 
    8090        ltq_rcu_w32(ltq_rcu_r32(RCU_RST_REQ) | module, RCU_RST_REQ); 
Note: See TracBrowser for help on using the repository browser.