source: trunk/target/linux/atheros/patches-2.6.36/101-early-printk-support.patch @ 23454

Last change on this file since 23454 was 23454, checked in by acoul, 6 years ago

linux/atheros: add preliminary 2.6.36 kernel support (refresh patches)

File size: 1.7 KB
  • new file arch/mips/ar231x/early_printk.c

    - +  
     1/* 
     2 * This file is subject to the terms and conditions of the GNU General Public 
     3 * License.  See the file "COPYING" in the main directory of this archive 
     4 * for more details. 
     5 * 
     6 * Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org> 
     7 */ 
     8 
     9#include <linux/mm.h> 
     10#include <linux/io.h> 
     11#include <linux/serial_reg.h> 
     12#include <asm/addrspace.h> 
     13 
     14#include <asm/mach-ar231x/ar2315_regs.h> 
     15#include <asm/mach-ar231x/ar5312_regs.h> 
     16#include "devices.h" 
     17 
     18static inline void prom_uart_wr(void __iomem *base, unsigned reg, 
     19                                unsigned char ch) 
     20{ 
     21        __raw_writeb(ch, base + 4 * reg); 
     22} 
     23 
     24static inline unsigned char prom_uart_rr(void __iomem *base, unsigned reg) 
     25{ 
     26        return __raw_readb(base + 4 * reg); 
     27} 
     28 
     29void prom_putchar(unsigned char ch) 
     30{ 
     31        static void __iomem *base; 
     32 
     33        if (unlikely(base == NULL)) { 
     34                if (is_2315()) 
     35                        base = (void __iomem *)(KSEG1ADDR(AR2315_UART0)); 
     36                else 
     37                        base = (void __iomem *)(KSEG1ADDR(AR531X_UART0)); 
     38        } 
     39 
     40        while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0); 
     41        prom_uart_wr(base, UART_TX, ch); 
     42        while ((prom_uart_rr(base, UART_LSR) & UART_LSR_THRE) == 0); 
     43} 
     44 
  • arch/mips/ar231x/Makefile

    a b  
    99# 
    1010 
    1111obj-y += board.o prom.o devices.o 
     12 
     13obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 
     14 
    1215obj-$(CONFIG_ATHEROS_AR5312) += ar5312.o 
    1316obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o 
  • arch/mips/Kconfig

    a b config ATHEROS_AR231X 
    107107        select SYS_SUPPORTS_BIG_ENDIAN 
    108108        select SYS_SUPPORTS_32BIT_KERNEL 
    109109        select GENERIC_GPIO 
     110        select SYS_HAS_EARLY_PRINTK 
    110111        help 
    111112          Support for AR231x and AR531x based boards 
    112113 
Note: See TracBrowser for help on using the repository browser.