Skip to content

Commit 3f5f0a4

Browse files
paulburtonralfbaechle
authored andcommitted
MIPS: generic: Convert SEAD-3 to a generic board
Convert the MIPS SEAD-3 board support to be a generic board, supported by generic kernels. Because the SEAD-3 boot protocol was defined long ago and we don't want to force a switch to the UHI protocol, SEAD-3 is added as a legacy board which is detected by reading the REVISION register. This may technically not be a valid memory read & future work will include attempting to handle that gracefully. In practice since SEAD-3 is the only legacy board supported by the generic kernel so far the read will only happen on SEAD-3 boards, and even once Malta is converted the same REVISION register exists there too. Other boards such as Boston, Ci20 & Ci40 will use the UHI boot protocol & thus not run any of the legacy board detect functions. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14354/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent eed0eab commit 3f5f0a4

22 files changed

Lines changed: 152 additions & 730 deletions

arch/mips/Kbuild.platforms

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ platforms += lasat
1919
platforms += loongson32
2020
platforms += loongson64
2121
platforms += mti-malta
22-
platforms += mti-sead3
2322
platforms += netlogic
2423
platforms += paravirt
2524
platforms += pic32

arch/mips/Kconfig

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -546,41 +546,6 @@ config MACH_PIC32
546546
Microchip PIC32 is a family of general-purpose 32 bit MIPS core
547547
microcontrollers.
548548

549-
config MIPS_SEAD3
550-
bool "MIPS SEAD3 board"
551-
select BOOT_ELF32
552-
select BOOT_RAW
553-
select BUILTIN_DTB
554-
select CEVT_R4K
555-
select CSRC_R4K
556-
select CLKSRC_MIPS_GIC
557-
select COMMON_CLK
558-
select CPU_MIPSR2_IRQ_VI
559-
select CPU_MIPSR2_IRQ_EI
560-
select DMA_NONCOHERENT
561-
select IRQ_MIPS_CPU
562-
select MIPS_GIC
563-
select LIBFDT
564-
select MIPS_MSC
565-
select SYS_HAS_CPU_MIPS32_R1
566-
select SYS_HAS_CPU_MIPS32_R2
567-
select SYS_HAS_CPU_MIPS32_R6
568-
select SYS_HAS_CPU_MIPS64_R1
569-
select SYS_SUPPORTS_32BIT_KERNEL
570-
select SYS_SUPPORTS_64BIT_KERNEL
571-
select SYS_SUPPORTS_BIG_ENDIAN
572-
select SYS_SUPPORTS_LITTLE_ENDIAN
573-
select SYS_SUPPORTS_SMARTMIPS
574-
select SYS_SUPPORTS_MICROMIPS
575-
select SYS_SUPPORTS_MIPS16
576-
select SYS_SUPPORTS_RELOCATABLE
577-
select USB_EHCI_BIG_ENDIAN_DESC
578-
select USB_EHCI_BIG_ENDIAN_MMIO
579-
select USE_OF
580-
help
581-
This enables support for the MIPS Technologies SEAD3 evaluation
582-
board.
583-
584549
config NEC_MARKEINS
585550
bool "NEC EMMA2RH Mark-eins board"
586551
select SOC_EMMA2RH
@@ -2976,7 +2941,7 @@ endchoice
29762941
choice
29772942
prompt "Kernel command line type" if !CMDLINE_OVERRIDE
29782943
default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \
2979-
!MIPS_MALTA && !MIPS_SEAD3 && \
2944+
!MIPS_MALTA && \
29802945
!CAVIUM_OCTEON_SOC
29812946
default MIPS_CMDLINE_FROM_BOOTLOADER
29822947

arch/mips/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,3 +488,16 @@ $(generic_defconfigs):
488488
# Prevent generic merge_config rules attempting to merge single fragments
489489
#
490490
$(generic_config_dir)/%.config: ;
491+
492+
#
493+
# Legacy defconfig compatibility - these targets used to be real defconfigs but
494+
# now that the boards have been converted to use the generic kernel they are
495+
# wrappers around the generic rules above.
496+
#
497+
.PHONY: sead3_defconfig
498+
sead3_defconfig:
499+
$(Q)$(MAKE) 32r2el_defconfig BOARDS=sead-3
500+
501+
.PHONY: sead3micro_defconfig
502+
sead3micro_defconfig:
503+
$(Q)$(MAKE) micro32r2el_defconfig BOARDS=sead-3

arch/mips/boot/dts/mti/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dtb-$(CONFIG_MIPS_MALTA) += malta.dtb
2-
dtb-$(CONFIG_MIPS_SEAD3) += sead3.dtb
2+
dtb-$(CONFIG_LEGACY_BOARD_SEAD3) += sead3.dtb
33

44
obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
55

arch/mips/boot/dts/mti/sead3.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#address-cells = <1>;
1111
#size-cells = <1>;
1212
compatible = "mti,sead-3";
13+
model = "MIPS SEAD-3";
1314
interrupt-parent = <&gic>;
1415

1516
chosen {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
CONFIG_LEGACY_BOARD_SEAD3=y
2+
3+
CONFIG_AUXDISPLAY=y
4+
CONFIG_IMG_ASCII_LCD=y
5+
6+
CONFIG_NEW_LEDS=y
7+
CONFIG_LEDS_CLASS=y
8+
CONFIG_LEDS_SYSCON=y
9+
10+
CONFIG_MMC=y
11+
CONFIG_MMC_SPI=y
12+
13+
CONFIG_MTD=y
14+
CONFIG_MTD_BLOCK=y
15+
CONFIG_MTD_CFI=y
16+
CONFIG_MTD_CFI_INTELEXT=y
17+
CONFIG_MTD_OF_PARTS=y
18+
CONFIG_MTD_PHYSMAP=y
19+
CONFIG_MTD_PHYSMAP_OF=y
20+
CONFIG_MTD_UBI=y
21+
CONFIG_MTD_UBI_GLUEBI=y
22+
23+
CONFIG_NETDEVICES=y
24+
CONFIG_SMSC911X=y
25+
CONFIG_SMSC_PHY=y
26+
27+
CONFIG_SERIAL_8250=y
28+
CONFIG_SERIAL_8250_CONSOLE=y
29+
CONFIG_SERIAL_OF_PLATFORM=y
30+
31+
CONFIG_USB=y
32+
CONFIG_USB_EHCI_HCD=y

arch/mips/configs/sead3_defconfig

Lines changed: 0 additions & 129 deletions
This file was deleted.

arch/mips/configs/sead3micro_defconfig

Lines changed: 0 additions & 122 deletions
This file was deleted.

arch/mips/generic/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@ config LEGACY_BOARDS
99
kernel is booted without being provided with an FDT via the UHI
1010
boot protocol.
1111

12+
config LEGACY_BOARD_SEAD3
13+
bool "Support MIPS SEAD-3 boards"
14+
select LEGACY_BOARDS
15+
help
16+
Enable this to include support for booting on MIPS SEAD-3 FPGA-based
17+
development boards, which boot using a legacy boot protocol.
18+
1219
endif

arch/mips/generic/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
obj-y += init.o
1212
obj-y += irq.o
1313
obj-y += proc.o
14+
15+
obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o

0 commit comments

Comments
 (0)