[PATCH] bsps: Move ZynqMP-specific info into the BSP

Kinsey Moore kinsey.moore at oarcorp.com
Wed Dec 28 19:17:55 UTC 2022


The address of the nandpsu peripheral is specific to the ZynqMP SoC and
not relevant to other devices that might have one or more instances of
this peripheral.
---
 bsps/aarch64/xilinx-zynqmp/include/bsp.h   |  2 +
 bsps/shared/dev/nand/xnandpsu_g.c          | 47 ---------------
 bsps/shared/dev/nand/xnandpsu_sinit.c      | 70 ----------------------
 spec/build/bsps/objnandpsu.yml             |  6 --
 spec/build/bsps/optnandpsu0baseaddress.yml | 18 ------
 spec/build/bsps/optnandpsunuminstances.yml | 18 ------
 6 files changed, 2 insertions(+), 159 deletions(-)
 delete mode 100644 bsps/shared/dev/nand/xnandpsu_g.c
 delete mode 100644 bsps/shared/dev/nand/xnandpsu_sinit.c
 delete mode 100644 spec/build/bsps/optnandpsu0baseaddress.yml
 delete mode 100644 spec/build/bsps/optnandpsunuminstances.yml

diff --git a/bsps/aarch64/xilinx-zynqmp/include/bsp.h b/bsps/aarch64/xilinx-zynqmp/include/bsp.h
index bb7df94fd1..572963af4c 100644
--- a/bsps/aarch64/xilinx-zynqmp/include/bsp.h
+++ b/bsps/aarch64/xilinx-zynqmp/include/bsp.h
@@ -67,6 +67,8 @@ extern "C" {
 extern unsigned int zynqmp_dtb_len;
 extern unsigned char zynqmp_dtb[];
 
+#define NANDPSU_BASEADDR 0xFF100000
+
 /**
  * @brief Zynq UltraScale+ MPSoC specific set up of the MMU.
  *
diff --git a/bsps/shared/dev/nand/xnandpsu_g.c b/bsps/shared/dev/nand/xnandpsu_g.c
deleted file mode 100644
index 2fb2a2a26e..0000000000
--- a/bsps/shared/dev/nand/xnandpsu_g.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/******************************************************************************
-* Copyright (C) 2015 - 2022 Xilinx, Inc.  All rights reserved.
-* SPDX-License-Identifier: MIT
-******************************************************************************/
-
-/*****************************************************************************/
-/**
-*
-* @file xnandpsu_g.c
-* @addtogroup nandpsu_v1_10
-* @{
-*
-* This file contains a configuration table where each entry is a configuration
-* structure for an XNandPsu device in the system.
-*
-* <pre>
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date	   Changes
-* ----- ----   ----------  -----------------------------------------------
-* 1.0   nm     05/06/2014  First release
-* 1.0   nm     06/02/2014  Changed the copyright to new copyright
-* </pre>
-*
-******************************************************************************/
-
-/***************************** Include Files ********************************/
-#include "xparameters.h"
-#include "xnandpsu.h"
-/************************** Constant Definitions ****************************/
-
-/**************************** Type Definitions ******************************/
-
-/***************** Macros (Inline Functions) Definitions ********************/
-
-/************************** Variable Definitions ****************************/
-
-/**
- * Each XNandPsu device in the system has an entry in this table.
- */
-XNandPsu_Config XNandPsu_ConfigTable[] = {
-	{
-		0U,
-		(u32)XPAR_XNANDPSU_0_BASEADDR
-	}
-};
-/** @} */
diff --git a/bsps/shared/dev/nand/xnandpsu_sinit.c b/bsps/shared/dev/nand/xnandpsu_sinit.c
deleted file mode 100644
index dd6b14ef10..0000000000
--- a/bsps/shared/dev/nand/xnandpsu_sinit.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/******************************************************************************
-* Copyright (C) 2015 - 2022 Xilinx, Inc.  All rights reserved.
-* SPDX-License-Identifier: MIT
-******************************************************************************/
-
-/*****************************************************************************/
-/**
-*
-* @file xnandpsu_sinit.c
-* @addtogroup nandpsu_v1_10
-* @{
-*
-* The implementation of the XNandPsu driver's static initialization
-* functionality.
-*
-* <pre>
-* MODIFICATION HISTORY:
-*
-* Ver   Who    Date	   Changes
-* ----- ----   ----------  -----------------------------------------------
-* 1.0   nm     05/06/2014  First release
-* </pre>
-*
-******************************************************************************/
-
-/***************************** Include Files ********************************/
-#include "xstatus.h"
-#include "xparameters.h"
-#include "xnandpsu.h"
-/************************** Constant Definitions ****************************/
-
-/**************************** Type Definitions ******************************/
-
-/***************** Macros (Inline Functions) Definitions ********************/
-
-/************************** Variable Definitions ****************************/
-
-extern XNandPsu_Config XNandPsu_ConfigTable[];
-
-/************************** Function Prototypes *****************************/
-
-/****************************************************************************/
-/**
-*
-* Looks up the controller configuration based on the unique controller ID. A
-* table contains the configuration info for each controller in the system.
-*
-* @param	DevID is the ID of the controller to look up the
-*		configuration for.
-*
-* @return
-*		A pointer to the configuration found or NULL if the specified
-*		controller ID was not found.
-*
-******************************************************************************/
-XNandPsu_Config *XNandPsu_LookupConfig(u16 DevID)
-{
-	XNandPsu_Config *CfgPtr = NULL;
-	u32 Index;
-
-	for (Index = 0U; Index < (u32)XPAR_XNANDPSU_NUM_INSTANCES; Index++) {
-		if (XNandPsu_ConfigTable[Index].DeviceId == DevID) {
-			CfgPtr = &XNandPsu_ConfigTable[Index];
-			break;
-		}
-	}
-
-	return (XNandPsu_Config *)CfgPtr;
-}
-/** @} */
diff --git a/spec/build/bsps/objnandpsu.yml b/spec/build/bsps/objnandpsu.yml
index 60dc8f67cc..ebed80326a 100644
--- a/spec/build/bsps/objnandpsu.yml
+++ b/spec/build/bsps/objnandpsu.yml
@@ -20,14 +20,8 @@ install:
 links:
 - role: build-dependency
   uid: objxilinxsupport
-- role: build-dependency
-  uid: optnandpsu0baseaddress
-- role: build-dependency
-  uid: optnandpsunuminstances
 source:
 - bsps/shared/dev/nand/xnandpsu_bbm.c
 - bsps/shared/dev/nand/xnandpsu.c
-- bsps/shared/dev/nand/xnandpsu_g.c
 - bsps/shared/dev/nand/xnandpsu_onfi.c
-- bsps/shared/dev/nand/xnandpsu_sinit.c
 type: build
diff --git a/spec/build/bsps/optnandpsu0baseaddress.yml b/spec/build/bsps/optnandpsu0baseaddress.yml
deleted file mode 100644
index 34668a39de..0000000000
--- a/spec/build/bsps/optnandpsu0baseaddress.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-actions:
-- get-integer: null
-- assert-uint32: null
-- env-assign: null
-- format-and-define: null
-build-type: option
-copyrights:
-- Copyright (C) 2022 On-Line Applications Research Corporation (OAR)
-default: 0xFF100000
-default-by-variant: []
-description: |
-  base address of NAND PSU 0
-enabled-by: true
-format: '{:#010x}'
-links: []
-name: XPAR_XNANDPSU_0_BASEADDR
-type: build
\ No newline at end of file
diff --git a/spec/build/bsps/optnandpsunuminstances.yml b/spec/build/bsps/optnandpsunuminstances.yml
deleted file mode 100644
index 4d8cfa6b05..0000000000
--- a/spec/build/bsps/optnandpsunuminstances.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-actions:
-- get-integer: null
-- assert-uint32: null
-- env-assign: null
-- format-and-define: null
-build-type: option
-copyrights:
-- Copyright (C) 2022 On-Line Applications Research Corporation (OAR)
-default: 1
-default-by-variant: []
-description: |
-  Number of nand instances
-enabled-by: true
-format: '{:#010x}'
-links: []
-name: XPAR_XNANDPSU_NUM_INSTANCES
-type: build
\ No newline at end of file
-- 
2.30.2



More information about the devel mailing list