Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jan 2020 21:39:28 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356849 - head/sys/arm/broadcom/bcm2835
Message-ID:  <202001172139.00HLdSak019496@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Fri Jan 17 21:39:28 2020
New Revision: 356849
URL: https://svnweb.freebsd.org/changeset/base/356849

Log:
  bcm2835_vcbus: unifdef all platform definitions
  
  Raspberry Pi are all over the board, and the reality is that there's no harm
  in including all of the definitions by default but plenty of harm in the
  current situation. This change is safe because we match a definition by root
  /compatible in the FDT, so there will be no false-positives because of it.
  
  The main array of definitions grows, but it's only walked exactly once to
  determine which we need to use.

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c	Fri Jan 17 21:29:20 2020	(r356848)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c	Fri Jan 17 21:39:28 2020	(r356849)
@@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$");
  * mappings for use in DMA/mailbox interactions.  This is only used for the
  * arm64 SoC because the 32-bit SoC used the same mappings.
  */
-#if defined (__aarch64__)
-#include "opt_soc.h"
-#endif
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -67,7 +64,6 @@ struct bcm283x_memory_mapping {
 	vm_paddr_t	vcbus_start;
 };
 
-#ifdef SOC_BCM2835
 static struct bcm283x_memory_mapping bcm2835_memmap[] = {
 	{
 		/* SDRAM */
@@ -83,9 +79,7 @@ static struct bcm283x_memory_mapping bcm2835_memmap[] 
 	},
 	{ 0, 0, 0 },
 };
-#endif
 
-#ifdef SOC_BCM2836
 static struct bcm283x_memory_mapping bcm2836_memmap[] = {
 	{
 		/* SDRAM */
@@ -101,9 +95,7 @@ static struct bcm283x_memory_mapping bcm2836_memmap[] 
 	},
 	{ 0, 0, 0 },
 };
-#endif
 
-#ifdef SOC_BRCM_BCM2837
 static struct bcm283x_memory_mapping bcm2837_memmap[] = {
 	{
 		/* SDRAM */
@@ -119,10 +111,7 @@ static struct bcm283x_memory_mapping bcm2837_memmap[] 
 	},
 	{ 0, 0, 0 },
 };
-#endif
 
-#ifdef SOC_BRCM_BCM2838
-
 /*
  * The BCM2838 supports up to 4GB of SDRAM, but unfortunately we can still only
  * map the first 1GB into the "legacy master view" (vcbus) address space.  Thus,
@@ -144,14 +133,12 @@ static struct bcm283x_memory_mapping bcm2838_memmap[] 
 	},
 	{ 0, 0, 0 },
 };
-#endif
 
 static struct bcm283x_memory_soc_cfg {
 	struct bcm283x_memory_mapping	*memmap;
 	const char			*soc_compat;
 	bus_addr_t			 busdma_lowaddr;
 } bcm283x_memory_configs[] = {
-#ifdef SOC_BCM2835
 	/* Legacy */
 	{
 		.memmap = bcm2835_memmap,
@@ -164,8 +151,6 @@ static struct bcm283x_memory_soc_cfg {
 		.soc_compat = "brcm,bcm2835",
 		.busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT,
 	},
-#endif
-#ifdef SOC_BCM2836
 	/* Legacy */
 	{
 		.memmap = bcm2836_memmap,
@@ -178,16 +163,11 @@ static struct bcm283x_memory_soc_cfg {
 		.soc_compat = "brcm,bcm2836",
 		.busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT,
 	},
-
-#endif
-#ifdef SOC_BRCM_BCM2837
 	{
 		.memmap = bcm2837_memmap,
 		.soc_compat = "brcm,bcm2837",
 		.busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT,
 	},
-#endif
-#ifdef SOC_BRCM_BCM2838
 	{
 		.memmap = bcm2838_memmap,
 		.soc_compat = "brcm,bcm2711",
@@ -198,7 +178,6 @@ static struct bcm283x_memory_soc_cfg {
 		.soc_compat = "brcm,bcm2838",
 		.busdma_lowaddr = BCM2838_PERIPH_MAXADDR,
 	},
-#endif
 };
 
 static struct bcm283x_memory_soc_cfg *booted_soc_memcfg;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001172139.00HLdSak019496>