summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/HALKit/ARM64/Storage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-14 22:26:42 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-14 22:26:42 +0100
commit6bbf5ad2058db4020ae20d6aba8f5b099dadc85f (patch)
treead39f25f27938729261f733d2addf839e8a110b3 /dev/Kernel/HALKit/ARM64/Storage
parent1c4f8ae3804be72d947b0b96f90b9300515399bc (diff)
TQ-24 && TQ-16: Add build scripts for MBCI, MBCI+Flash, and UFS.
META: Along other tweaks and important ARM64 patches. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/HALKit/ARM64/Storage')
-rw-r--r--dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc (renamed from dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc)20
-rw-r--r--dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc11
2 files changed, 21 insertions, 10 deletions
diff --git a/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc b/dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc
index 1335a9e4..3ccca867 100644
--- a/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc
+++ b/dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc
@@ -11,10 +11,10 @@
#include <Mod/MFlash/MFlash.h>
#include <Mod/MBCI/MBCI.h>
-/// @file MFlash.cc
+/// @file MBCI+Flash.cc
/// @brief MBCI Flash support.
-#define kMaxFlashSlots (8U)
+#define MBCI_MAX_SLOTS (8U)
namespace NeOS
{
@@ -23,10 +23,10 @@ namespace NeOS
constexpr auto kFlashBridgeRevision = 1;
STATIC BOOL kFlashEnabled = NO;
- STATIC SizeT kFlashSize[kMaxFlashSlots] = {};
- STATIC SizeT kFlashSectorSz[kMaxFlashSlots] = {};
- STATIC IMBCIHost* kFlashMetaPackets[kMaxFlashSlots] = {};
- STATIC IMBCIHost* kFlashDataPackets[kMaxFlashSlots] = {};
+ STATIC SizeT kFlashSize[MBCI_MAX_SLOTS] = {};
+ STATIC SizeT kFlashSectorSz[MBCI_MAX_SLOTS] = {};
+ STATIC IMBCIHost* kFlashMetaPackets[MBCI_MAX_SLOTS] = {};
+ STATIC IMBCIHost* kFlashDataPackets[MBCI_MAX_SLOTS] = {};
STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz);
@@ -40,7 +40,7 @@ namespace NeOS
/// @return slot sector count.
SizeT drv_get_sector_count(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return 0;
return kFlashSectorSz[slot];
@@ -50,7 +50,7 @@ namespace NeOS
/// @return drive slot size
SizeT drv_get_size(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return 0;
return kFlashSize[slot];
@@ -59,7 +59,7 @@ namespace NeOS
/// @brief Enable flash memory at slot.
BOOL drv_enable_at(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return NO;
kFlashMetaPackets[slot]->InterruptEnable = YES;
@@ -72,7 +72,7 @@ namespace NeOS
/// @brief Disable flash memory at slot.
BOOL drv_disable_at(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return NO;
kFlashMetaPackets[slot]->InterruptEnable = NO;
diff --git a/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc b/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc
new file mode 100644
index 00000000..20d06671
--- /dev/null
+++ b/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc
@@ -0,0 +1,11 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+
+------------------------------------------- */
+
+/// @file UFS.cc
+/// @brief UFS Flash Memory support.
+
+#define UFS_PCI_VENDOR_ID (0x01001) /* AKER */
+#define UFS_PCI_DEVICE_ID (0xAEAEA) /* AKER */ \ No newline at end of file