Skip to content

Commit

Permalink
MIPS: generic: Convert SEAD-3 to a generic board
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
paulburton authored and ralfbaechle committed Oct 6, 2016
1 parent eed0eab commit 3f5f0a4
Show file tree
Hide file tree
Showing 22 changed files with 152 additions and 730 deletions.
1 change: 0 additions & 1 deletion arch/mips/Kbuild.platforms
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ platforms += lasat
platforms += loongson32
platforms += loongson64
platforms += mti-malta
platforms += mti-sead3
platforms += netlogic
platforms += paravirt
platforms += pic32
Expand Down
37 changes: 1 addition & 36 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -546,41 +546,6 @@ config MACH_PIC32
Microchip PIC32 is a family of general-purpose 32 bit MIPS core
microcontrollers.

config MIPS_SEAD3
bool "MIPS SEAD3 board"
select BOOT_ELF32
select BOOT_RAW
select BUILTIN_DTB
select CEVT_R4K
select CSRC_R4K
select CLKSRC_MIPS_GIC
select COMMON_CLK
select CPU_MIPSR2_IRQ_VI
select CPU_MIPSR2_IRQ_EI
select DMA_NONCOHERENT
select IRQ_MIPS_CPU
select MIPS_GIC
select LIBFDT
select MIPS_MSC
select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_CPU_MIPS32_R2
select SYS_HAS_CPU_MIPS32_R6
select SYS_HAS_CPU_MIPS64_R1
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_LITTLE_ENDIAN
select SYS_SUPPORTS_SMARTMIPS
select SYS_SUPPORTS_MICROMIPS
select SYS_SUPPORTS_MIPS16
select SYS_SUPPORTS_RELOCATABLE
select USB_EHCI_BIG_ENDIAN_DESC
select USB_EHCI_BIG_ENDIAN_MMIO
select USE_OF
help
This enables support for the MIPS Technologies SEAD3 evaluation
board.

config NEC_MARKEINS
bool "NEC EMMA2RH Mark-eins board"
select SOC_EMMA2RH
Expand Down Expand Up @@ -2976,7 +2941,7 @@ endchoice
choice
prompt "Kernel command line type" if !CMDLINE_OVERRIDE
default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \
!MIPS_MALTA && !MIPS_SEAD3 && \
!MIPS_MALTA && \
!CAVIUM_OCTEON_SOC
default MIPS_CMDLINE_FROM_BOOTLOADER

Expand Down
13 changes: 13 additions & 0 deletions arch/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -488,3 +488,16 @@ $(generic_defconfigs):
# Prevent generic merge_config rules attempting to merge single fragments
#
$(generic_config_dir)/%.config: ;

#
# Legacy defconfig compatibility - these targets used to be real defconfigs but
# now that the boards have been converted to use the generic kernel they are
# wrappers around the generic rules above.
#
.PHONY: sead3_defconfig
sead3_defconfig:
$(Q)$(MAKE) 32r2el_defconfig BOARDS=sead-3

.PHONY: sead3micro_defconfig
sead3micro_defconfig:
$(Q)$(MAKE) micro32r2el_defconfig BOARDS=sead-3
2 changes: 1 addition & 1 deletion arch/mips/boot/dts/mti/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dtb-$(CONFIG_MIPS_MALTA) += malta.dtb
dtb-$(CONFIG_MIPS_SEAD3) += sead3.dtb
dtb-$(CONFIG_LEGACY_BOARD_SEAD3) += sead3.dtb

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

Expand Down
1 change: 1 addition & 0 deletions arch/mips/boot/dts/mti/sead3.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#address-cells = <1>;
#size-cells = <1>;
compatible = "mti,sead-3";
model = "MIPS SEAD-3";
interrupt-parent = <&gic>;

chosen {
Expand Down
32 changes: 32 additions & 0 deletions arch/mips/configs/generic/board-sead-3.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CONFIG_LEGACY_BOARD_SEAD3=y

CONFIG_AUXDISPLAY=y
CONFIG_IMG_ASCII_LCD=y

CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_SYSCON=y

CONFIG_MMC=y
CONFIG_MMC_SPI=y

CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_GLUEBI=y

CONFIG_NETDEVICES=y
CONFIG_SMSC911X=y
CONFIG_SMSC_PHY=y

CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y

CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
129 changes: 0 additions & 129 deletions arch/mips/configs/sead3_defconfig

This file was deleted.

122 changes: 0 additions & 122 deletions arch/mips/configs/sead3micro_defconfig

This file was deleted.

7 changes: 7 additions & 0 deletions arch/mips/generic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ config LEGACY_BOARDS
kernel is booted without being provided with an FDT via the UHI
boot protocol.

config LEGACY_BOARD_SEAD3
bool "Support MIPS SEAD-3 boards"
select LEGACY_BOARDS
help
Enable this to include support for booting on MIPS SEAD-3 FPGA-based
development boards, which boot using a legacy boot protocol.

endif
2 changes: 2 additions & 0 deletions arch/mips/generic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
obj-y += init.o
obj-y += irq.o
obj-y += proc.o

obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o
Loading

0 comments on commit 3f5f0a4

Please sign in to comment.