Skip to content

Commit 603eefd

Browse files
committed
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
2 parents 50ddcdb + 1955d84 commit 603eefd

10 files changed

Lines changed: 58 additions & 40 deletions

File tree

‎arch/openrisc/boot/dts/or1klitex.dts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,24 @@
4141
interrupt-controller;
4242
};
4343

44-
serial0: serial@e0002000 {
44+
serial0: serial@e0006800 {
4545
device_type = "serial";
4646
compatible = "litex,liteuart";
47-
reg = <0xe0002000 0x100>;
47+
reg = <0xe0006800 0x100>;
4848
};
4949

5050
soc_ctrl0: soc_controller@e0000000 {
5151
compatible = "litex,soc-controller";
5252
reg = <0xe0000000 0xc>;
5353
status = "okay";
5454
};
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>;
63+
};
5564
};
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
CONFIG_BLK_DEV_INITRD=y
2-
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
3-
CONFIG_BUG_ON_DATA_CORRUPTION=y
42
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
5-
CONFIG_DEVTMPFS=y
6-
CONFIG_DEVTMPFS_MOUNT=y
73
CONFIG_EMBEDDED=y
4+
CONFIG_OPENRISC_BUILTIN_DTB="or1klitex"
85
CONFIG_HZ_100=y
9-
CONFIG_INITRAMFS_SOURCE="openrisc-rootfs.cpio.gz"
6+
CONFIG_NET=y
7+
CONFIG_PACKET=y
8+
CONFIG_UNIX=y
9+
CONFIG_INET=y
10+
CONFIG_DEVTMPFS=y
11+
CONFIG_DEVTMPFS_MOUNT=y
1012
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
1515
CONFIG_SERIAL_LITEUART=y
1616
CONFIG_SERIAL_LITEUART_CONSOLE=y
17-
CONFIG_SOFTLOCKUP_DETECTOR=y
1817
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

‎arch/openrisc/include/asm/pgtable.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* et al.
1313
*/
1414

15-
/* or32 pgtable.h - macros and functions to manipulate page tables
15+
/* or1k pgtable.h - macros and functions to manipulate page tables
1616
*
1717
* Based on:
1818
* include/asm-cris/pgtable.h
@@ -29,14 +29,14 @@
2929

3030
/*
3131
* 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
3333
* table. Since the MMU TLB is software loaded through an interrupt, it
3434
* supports any page table structure, so we could have used a three-level
3535
* setup, but for the amounts of memory we normally use, a two-level is
3636
* probably more efficient.
3737
*
3838
* This file contains the functions and defines necessary to modify and use
39-
* the or32 page table tree.
39+
* the or1k page table tree.
4040
*/
4141

4242
extern void paging_init(void);

‎arch/openrisc/include/asm/setup.h‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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 */

‎arch/openrisc/include/asm/thread_info.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
/* THREAD_SIZE is the size of the task_struct/kernel_stack combo.
2727
* 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
2929
*/
3030

3131
#define THREAD_SIZE_ORDER 0

‎arch/openrisc/kernel/entry.S‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ EXCEPTION_ENTRY(_data_page_fault_handler)
326326
1: l.ori r6,r0,0x0 // !write access
327327
2:
328328

329-
/* call fault.c handler in or32/mm/fault.c */
329+
/* call fault.c handler in openrisc/mm/fault.c */
330330
l.jal do_page_fault
331331
l.nop
332332
l.j _ret_from_exception
@@ -348,7 +348,7 @@ EXCEPTION_ENTRY(_insn_page_fault_handler)
348348
/* r4 set be EXCEPTION_HANDLE */ // effective address of fault
349349
l.ori r6,r0,0x0 // !write access
350350

351-
/* call fault.c handler in or32/mm/fault.c */
351+
/* call fault.c handler in openrisc/mm/fault.c */
352352
l.jal do_page_fault
353353
l.nop
354354
l.j _ret_from_exception
@@ -547,6 +547,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
547547
l.bnf 1f // ext irq enabled, all ok.
548548
l.nop
549549

550+
#ifdef CONFIG_PRINTK
550551
l.addi r1,r1,-0x8
551552
l.movhi r3,hi(42f)
552553
l.ori r3,r3,lo(42f)
@@ -560,6 +561,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
560561
.string "\n\rESR interrupt bug: in _external_irq_handler (ESR %x)\n\r"
561562
.align 4
562563
.previous
564+
#endif
563565

564566
l.ori r4,r4,SPR_SR_IEE // fix the bug
565567
// l.sw PT_SR(r1),r4

‎arch/openrisc/kernel/head.S‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ flush_tlb:
599599
l.jal _flush_tlb
600600
l.nop
601601

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 */
603603

604604
enable_mmu:
605605
/*
@@ -641,9 +641,9 @@ enable_mmu:
641641
/* magic number mismatch, set fdt pointer to null */
642642
l.or r25,r0,r0
643643
_fdt_found:
644-
/* pass fdt pointer to or32_early_setup in r3 */
644+
/* pass fdt pointer to or1k_early_setup in r3 */
645645
l.or r3,r0,r25
646-
LOAD_SYMBOL_2_GPR(r24, or32_early_setup)
646+
LOAD_SYMBOL_2_GPR(r24, or1k_early_setup)
647647
l.jalr r24
648648
l.nop
649649

‎arch/openrisc/kernel/setup.c‎

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,16 @@ void __init setup_cpuinfo(void)
209209
}
210210

211211
/**
212-
* or32_early_setup
212+
* or1k_early_setup
213+
* @fdt: pointer to the start of the device tree in memory or NULL
213214
*
214215
* Handles the pointer to the device tree that this kernel is to use
215216
* for establishing the available platform devices.
216217
*
217218
* Falls back on built-in device tree in case null pointer is passed.
218219
*/
219220

220-
void __init or32_early_setup(void *fdt)
221+
void __init or1k_early_setup(void *fdt)
221222
{
222223
if (fdt)
223224
pr_info("FDT at %p\n", fdt);
@@ -243,21 +244,6 @@ static inline unsigned long extract_value(unsigned long reg, unsigned long mask)
243244
return mask & reg;
244245
}
245246

246-
void __init detect_unit_config(unsigned long upr, unsigned long mask,
247-
char *text, void (*func) (void))
248-
{
249-
if (text != NULL)
250-
printk("%s", text);
251-
252-
if (upr & mask) {
253-
if (func != NULL)
254-
func();
255-
else
256-
printk("present\n");
257-
} else
258-
printk("not present\n");
259-
}
260-
261247
/*
262248
* calibrate_delay
263249
*

‎arch/openrisc/lib/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
#
3-
# Makefile for or32 specific library files..
3+
# Makefile for or1k specific library files..
44
#
55

66
obj-y := delay.o string.o memset.o memcpy.o

‎arch/openrisc/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ unsigned long pte_misses; /* updated by do_page_fault() */
2828
unsigned long pte_errors; /* updated by do_page_fault() */
2929

3030
/* __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
3232
*/
3333
volatile pgd_t *current_pgd[NR_CPUS];
3434

0 commit comments

Comments
 (0)