Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-linus' of git://github.com/openrisc/linux

Pull OpenRISC updates from Stafford Horne:
"A few cleanups and compiler warning fixes for OpenRISC.

Also, this includes dts and defconfig updates to enable Ethernet on
OpenRISC/Litex FPGA SoC's now that the LiteEth driver has gone
upstream"

* tag 'for-linus' of git://github.com/openrisc/linux:
openrisc/litex: Update defconfig
openrisc/litex: Add ethernet device
openrisc/litex: Update uart address
openrisc: Fix compiler warnings in setup
openrisc: rename or32 code & comments to or1k
openrisc: don't printk() unconditionally

+58 -40
+11 -2
arch/openrisc/boot/dts/or1klitex.dts
··· 41 41 interrupt-controller; 42 42 }; 43 43 44 - serial0: serial@e0002000 { 44 + serial0: serial@e0006800 { 45 45 device_type = "serial"; 46 46 compatible = "litex,liteuart"; 47 - reg = <0xe0002000 0x100>; 47 + reg = <0xe0006800 0x100>; 48 48 }; 49 49 50 50 soc_ctrl0: soc_controller@e0000000 { 51 51 compatible = "litex,soc-controller"; 52 52 reg = <0xe0000000 0xc>; 53 53 status = "okay"; 54 + }; 55 + 56 + ethernet@e0001000 { 57 + compatible = "litex,liteeth"; 58 + reg = <0xe0001000 0x7c>, 59 + <0xe0001800 0x0a>, 60 + <0x80000000 0x2000>; 61 + reg-names = "mac", "mdio", "buffer"; 62 + interrupts = <2>; 54 63 }; 55 64 };
+16 -10
arch/openrisc/configs/or1klitex_defconfig
··· 1 1 CONFIG_BLK_DEV_INITRD=y 2 - CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y 3 - CONFIG_BUG_ON_DATA_CORRUPTION=y 4 2 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 3 + CONFIG_EMBEDDED=y 4 + CONFIG_OPENRISC_BUILTIN_DTB="or1klitex" 5 + CONFIG_HZ_100=y 6 + CONFIG_NET=y 7 + CONFIG_PACKET=y 8 + CONFIG_UNIX=y 9 + CONFIG_INET=y 5 10 CONFIG_DEVTMPFS=y 6 11 CONFIG_DEVTMPFS_MOUNT=y 7 - CONFIG_EMBEDDED=y 8 - CONFIG_HZ_100=y 9 - CONFIG_INITRAMFS_SOURCE="openrisc-rootfs.cpio.gz" 10 12 CONFIG_OF_OVERLAY=y 11 - CONFIG_OPENRISC_BUILTIN_DTB="or1klitex" 12 - CONFIG_PANIC_ON_OOPS=y 13 - CONFIG_PRINTK_TIME=y 14 - CONFIG_LITEX_SOC_CONTROLLER=y 13 + CONFIG_NETDEVICES=y 14 + CONFIG_LITEX_LITEETH=y 15 15 CONFIG_SERIAL_LITEUART=y 16 16 CONFIG_SERIAL_LITEUART_CONSOLE=y 17 - CONFIG_SOFTLOCKUP_DETECTOR=y 18 17 CONFIG_TTY_PRINTK=y 18 + CONFIG_LITEX_SOC_CONTROLLER=y 19 + CONFIG_TMPFS=y 20 + CONFIG_PRINTK_TIME=y 21 + CONFIG_PANIC_ON_OOPS=y 22 + CONFIG_SOFTLOCKUP_DETECTOR=y 23 + CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y 24 + CONFIG_BUG_ON_DATA_CORRUPTION=y
+3 -3
arch/openrisc/include/asm/pgtable.h
··· 12 12 * et al. 13 13 */ 14 14 15 - /* or32 pgtable.h - macros and functions to manipulate page tables 15 + /* or1k pgtable.h - macros and functions to manipulate page tables 16 16 * 17 17 * Based on: 18 18 * include/asm-cris/pgtable.h ··· 29 29 30 30 /* 31 31 * The Linux memory management assumes a three-level page table setup. On 32 - * or32, we use that, but "fold" the mid level into the top-level page 32 + * or1k, we use that, but "fold" the mid level into the top-level page 33 33 * table. Since the MMU TLB is software loaded through an interrupt, it 34 34 * supports any page table structure, so we could have used a three-level 35 35 * setup, but for the amounts of memory we normally use, a two-level is 36 36 * probably more efficient. 37 37 * 38 38 * This file contains the functions and defines necessary to modify and use 39 - * the or32 page table tree. 39 + * the or1k page table tree. 40 40 */ 41 41 42 42 extern void paging_init(void);
+15
arch/openrisc/include/asm/setup.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2021 Stafford Horne 4 + */ 5 + #ifndef _ASM_OR1K_SETUP_H 6 + #define _ASM_OR1K_SETUP_H 7 + 8 + #include <linux/init.h> 9 + #include <asm-generic/setup.h> 10 + 11 + #ifndef __ASSEMBLY__ 12 + void __init or1k_early_setup(void *fdt); 13 + #endif 14 + 15 + #endif /* _ASM_OR1K_SETUP_H */
+1 -1
arch/openrisc/include/asm/thread_info.h
··· 25 25 26 26 /* THREAD_SIZE is the size of the task_struct/kernel_stack combo. 27 27 * normally, the stack is found by doing something like p + THREAD_SIZE 28 - * in or32, a page is 8192 bytes, which seems like a sane size 28 + * in or1k, a page is 8192 bytes, which seems like a sane size 29 29 */ 30 30 31 31 #define THREAD_SIZE_ORDER 0
+4 -2
arch/openrisc/kernel/entry.S
··· 326 326 1: l.ori r6,r0,0x0 // !write access 327 327 2: 328 328 329 - /* call fault.c handler in or32/mm/fault.c */ 329 + /* call fault.c handler in openrisc/mm/fault.c */ 330 330 l.jal do_page_fault 331 331 l.nop 332 332 l.j _ret_from_exception ··· 348 348 /* r4 set be EXCEPTION_HANDLE */ // effective address of fault 349 349 l.ori r6,r0,0x0 // !write access 350 350 351 - /* call fault.c handler in or32/mm/fault.c */ 351 + /* call fault.c handler in openrisc/mm/fault.c */ 352 352 l.jal do_page_fault 353 353 l.nop 354 354 l.j _ret_from_exception ··· 547 547 l.bnf 1f // ext irq enabled, all ok. 548 548 l.nop 549 549 550 + #ifdef CONFIG_PRINTK 550 551 l.addi r1,r1,-0x8 551 552 l.movhi r3,hi(42f) 552 553 l.ori r3,r3,lo(42f) ··· 561 560 .string "\n\rESR interrupt bug: in _external_irq_handler (ESR %x)\n\r" 562 561 .align 4 563 562 .previous 563 + #endif 564 564 565 565 l.ori r4,r4,SPR_SR_IEE // fix the bug 566 566 // l.sw PT_SR(r1),r4
+3 -3
arch/openrisc/kernel/head.S
··· 599 599 l.jal _flush_tlb 600 600 l.nop 601 601 602 - /* The MMU needs to be enabled before or32_early_setup is called */ 602 + /* The MMU needs to be enabled before or1k_early_setup is called */ 603 603 604 604 enable_mmu: 605 605 /* ··· 641 641 /* magic number mismatch, set fdt pointer to null */ 642 642 l.or r25,r0,r0 643 643 _fdt_found: 644 - /* pass fdt pointer to or32_early_setup in r3 */ 644 + /* pass fdt pointer to or1k_early_setup in r3 */ 645 645 l.or r3,r0,r25 646 - LOAD_SYMBOL_2_GPR(r24, or32_early_setup) 646 + LOAD_SYMBOL_2_GPR(r24, or1k_early_setup) 647 647 l.jalr r24 648 648 l.nop 649 649
+3 -17
arch/openrisc/kernel/setup.c
··· 209 209 } 210 210 211 211 /** 212 - * or32_early_setup 212 + * or1k_early_setup 213 + * @fdt: pointer to the start of the device tree in memory or NULL 213 214 * 214 215 * Handles the pointer to the device tree that this kernel is to use 215 216 * for establishing the available platform devices. ··· 218 217 * Falls back on built-in device tree in case null pointer is passed. 219 218 */ 220 219 221 - void __init or32_early_setup(void *fdt) 220 + void __init or1k_early_setup(void *fdt) 222 221 { 223 222 if (fdt) 224 223 pr_info("FDT at %p\n", fdt); ··· 242 241 mask = mask >> 1; 243 242 } 244 243 return mask & reg; 245 - } 246 - 247 - void __init detect_unit_config(unsigned long upr, unsigned long mask, 248 - char *text, void (*func) (void)) 249 - { 250 - if (text != NULL) 251 - printk("%s", text); 252 - 253 - if (upr & mask) { 254 - if (func != NULL) 255 - func(); 256 - else 257 - printk("present\n"); 258 - } else 259 - printk("not present\n"); 260 244 } 261 245 262 246 /*
+1 -1
arch/openrisc/lib/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 # 3 - # Makefile for or32 specific library files.. 3 + # Makefile for or1k specific library files.. 4 4 # 5 5 6 6 obj-y := delay.o string.o memset.o memcpy.o
+1 -1
arch/openrisc/mm/fault.c
··· 28 28 unsigned long pte_errors; /* updated by do_page_fault() */ 29 29 30 30 /* __PHX__ :: - check the vmalloc_fault in do_page_fault() 31 - * - also look into include/asm-or32/mmu_context.h 31 + * - also look into include/asm/mmu_context.h 32 32 */ 33 33 volatile pgd_t *current_pgd[NR_CPUS]; 34 34