From b2d0caf86b633e4242bc320d03ba7d13ff99b7f1 Mon Sep 17 00:00:00 2001
From: Atish Patra <atish.patra@wdc.com>
Date: Tue, 18 Jun 2019 14:54:05 -0700
Subject: platform: Enable all drivers by default.

The drivers and libfdt are built as libsbiutils.a
instead of libplatsbi.a.

libsbiutils.a are not built per platform specific. Thus,
enable all drivers by default.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Anup Patel <anup.patel@wdc.com>
---
 lib/utils/irqchip/objects.mk     |  2 +-
 lib/utils/libfdt/objects.mk      |  4 ++--
 lib/utils/serial/objects.mk      |  4 ++--
 lib/utils/sys/objects.mk         |  2 +-
 platform/kendryte/k210/config.mk |  8 --------
 platform/qemu/sifive_u/config.mk |  8 --------
 platform/qemu/virt/config.mk     |  3 ---
 platform/sifive/fu540/config.mk  |  9 ---------
 platform/template/config.mk      | 16 ----------------
 9 files changed, 6 insertions(+), 50 deletions(-)

diff --git a/lib/utils/irqchip/objects.mk b/lib/utils/irqchip/objects.mk
index fa7c937..e3a0902 100644
--- a/lib/utils/irqchip/objects.mk
+++ b/lib/utils/irqchip/objects.mk
@@ -7,4 +7,4 @@
 #   Anup Patel <anup.patel@wdc.com>
 #
 
-libsbiutils-objs-$(PLATFORM_IRQCHIP_PLIC) += irqchip/plic.o
+libsbiutils-objs-y += irqchip/plic.o
diff --git a/lib/utils/libfdt/objects.mk b/lib/utils/libfdt/objects.mk
index 205ea2c..a95c1bd 100644
--- a/lib/utils/libfdt/objects.mk
+++ b/lib/utils/libfdt/objects.mk
@@ -12,5 +12,5 @@ libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \
 $(foreach file, $(libfdt_files), \
         $(eval CFLAGS_$(file) = -I$(src)/../../utils/libfdt))
 
-libsbiutils-objs-$(PLATFORM_INCLUDE_LIBFDT) += $(addprefix libfdt/,$(libfdt_files))
-libsbiutils-genflags-$(PLATFORM_INCLUDE_LIBFDT)  += -I$(libsbiutils_dir)/libfdt/
+libsbiutils-objs-y += $(addprefix libfdt/,$(libfdt_files))
+libsbiutils-genflags-y  += -I$(libsbiutils_dir)/libfdt/
diff --git a/lib/utils/serial/objects.mk b/lib/utils/serial/objects.mk
index fba056b..d4f6755 100644
--- a/lib/utils/serial/objects.mk
+++ b/lib/utils/serial/objects.mk
@@ -7,5 +7,5 @@
 #   Anup Patel <anup.patel@wdc.com>
 #
 
-libsbiutils-objs-$(PLATFORM_SERIAL_UART8250) += serial/uart8250.o
-libsbiutils-objs-$(PLATFORM_SERIAL_SIFIVE_UART) += serial/sifive-uart.o
+libsbiutils-objs-y += serial/uart8250.o
+libsbiutils-objs-y += serial/sifive-uart.o
diff --git a/lib/utils/sys/objects.mk b/lib/utils/sys/objects.mk
index 3c13b9b..baed884 100644
--- a/lib/utils/sys/objects.mk
+++ b/lib/utils/sys/objects.mk
@@ -7,4 +7,4 @@
 #   Anup Patel <anup.patel@wdc.com>
 #
 
-libsbiutils-objs-$(PLATFORM_SYS_CLINT) += sys/clint.o
+libsbiutils-objs-y += sys/clint.o
diff --git a/platform/kendryte/k210/config.mk b/platform/kendryte/k210/config.mk
index 2aa3b13..e0f8d3a 100644
--- a/platform/kendryte/k210/config.mk
+++ b/platform/kendryte/k210/config.mk
@@ -13,16 +13,8 @@ platform-cflags-y =
 platform-asflags-y =
 platform-ldflags-y =
 
-# Common drivers to enable
-PLATFORM_IRQCHIP_PLIC=y
-PLATFORM_SYS_CLINT=y
-
 # Blobs to build
 FW_TEXT_START=0x80000000
 FW_PAYLOAD=y
 FW_PAYLOAD_ALIGN=0x1000
 FW_PAYLOAD_FDT=k210.dtb
-
-# External Libraries to include
-PLATFORM_INCLUDE_LIBC=y
-
diff --git a/platform/qemu/sifive_u/config.mk b/platform/qemu/sifive_u/config.mk
index 87e12ee..f66a555 100644
--- a/platform/qemu/sifive_u/config.mk
+++ b/platform/qemu/sifive_u/config.mk
@@ -17,11 +17,6 @@ platform-ldflags-y =
 platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M sifive_u -m 256M \
   -nographic -kernel $(build_dir)/platform/qemu/sifive_u/firmware/fw_payload.elf
 
-# Common drivers to enable
-PLATFORM_IRQCHIP_PLIC=y
-PLATFORM_SERIAL_SIFIVE_UART=y
-PLATFORM_SYS_CLINT=y
-
 # Blobs to build
 FW_TEXT_START=0x80000000
 FW_DYNAMIC=y
@@ -43,6 +38,3 @@ else
   FW_PAYLOAD_OFFSET=0x200000
 endif
 FW_PAYLOAD_FDT_ADDR=0x82200000
-
-# External Libraries to include
-PLATFORM_INCLUDE_LIBC=y
diff --git a/platform/qemu/virt/config.mk b/platform/qemu/virt/config.mk
index 2b0709c..5cc9f0b 100644
--- a/platform/qemu/virt/config.mk
+++ b/platform/qemu/virt/config.mk
@@ -43,6 +43,3 @@ else
   FW_PAYLOAD_OFFSET=0x200000
 endif
 FW_PAYLOAD_FDT_ADDR=0x82200000
-
-# External Libraries to include
-PLATFORM_INCLUDE_LIBC=y
diff --git a/platform/sifive/fu540/config.mk b/platform/sifive/fu540/config.mk
index fbb5db8..5905433 100644
--- a/platform/sifive/fu540/config.mk
+++ b/platform/sifive/fu540/config.mk
@@ -13,11 +13,6 @@ platform-cflags-y =
 platform-asflags-y =
 platform-ldflags-y =
 
-# Common drivers to enable
-PLATFORM_IRQCHIP_PLIC=y
-PLATFORM_SERIAL_SIFIVE_UART=y
-PLATFORM_SYS_CLINT=y
-
 # Blobs to build
 FW_TEXT_START=0x80000000
 FW_DYNAMIC=y
@@ -27,7 +22,3 @@ FW_JUMP_FDT_ADDR=0x82200000
 FW_PAYLOAD=y
 FW_PAYLOAD_OFFSET=0x200000
 FW_PAYLOAD_FDT_ADDR=0x82200000
-
-# External Libraries to include
-PLATFORM_INCLUDE_LIBFDT=y
-PLATFORM_INCLUDE_LIBC=y
diff --git a/platform/template/config.mk b/platform/template/config.mk
index 5ba8efc..70f2db8 100644
--- a/platform/template/config.mk
+++ b/platform/template/config.mk
@@ -31,17 +31,6 @@ platform-ldflags-y =
 # PLATFORM_RISCV_ISA = rv64imafdc
 # PLATFORM_RISCV_CODE_MODEL = medany
 
-#
-# OpenSBI implements generic drivers for some common generic hardware. The
-# drivers currently available are the RISC-V Platform Level Interrupt
-# Controller (PLIC), RISC-V Core Local Interrupt controller (CLINT) and a UART
-# 8250 compliant serial line driver (UART8250). The following definitions allow
-# enabling the use of these generic drivers for the platform.
-#
-# PLATFORM_IRQCHIP_PLIC=<y|n>
-# PLATFORM_SYS_CLINT=<y|n>
-# PLATFORM_SERIAL_UART8250=<y|n>
-
 # Firmware load address configuration. This is mandatory.
 FW_TEXT_START=0x80000000
 
@@ -85,8 +74,3 @@ endif
 # FW_PAYLOAD_FDT_PATH="path to platform flattened device tree file"
 # FW_PAYLOAD_FDT="name of the platform defined flattened device tree file"
 # FW_PAYLOAD_FDT_ADDR=0x82200000
-
-#
-# Allow linking against static libc for standard functions (memset, memcpy, etc)
-#
-# PLATFORM_INCLUDE_LIBC=y
-- 
cgit v1.2.3