summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal <amlal@nekernel.org>2025-05-07 08:35:04 +0200
committerAmlal <amlal@nekernel.org>2025-05-07 08:35:04 +0200
commitc9242551bd16ef8458626b1eea765dff336ab6dd (patch)
tree33c701387b2aff054c33ab1a5b697ff39520eba6
parent4a80c0e7eaa36817f52e0f3cd6d8c8e07bf860dc (diff)
feat(docs): Add MBCI specification, a mini bus HW interface.
where? - Inside /docs/tex why? - Provide an independent standard for future HW interfaces. Signed-off-by: Amlal <amlal@nekernel.org>
-rw-r--r--docs/tex/mbci.tex114
1 files changed, 114 insertions, 0 deletions
diff --git a/docs/tex/mbci.tex b/docs/tex/mbci.tex
new file mode 100644
index 00000000..a23bc87b
--- /dev/null
+++ b/docs/tex/mbci.tex
@@ -0,0 +1,114 @@
+
+\documentclass{article}
+\usepackage{geometry}
+\usepackage{longtable}
+\usepackage{listings}
+\usepackage{xcolor}
+\geometry{margin=1in}
+\title{MBCI: Mini Bus Controller Interface Specification}
+\author{Amlal El Mahrouss}
+\date{2025}
+
+\begin{document}
+
+\maketitle
+
+\section{Overview}
+The Mini Bus Controller Interface (MBCI) is a standardized memory-mapped I/O bus specification designed for use in embedded systems and operating system kernels. It provides an extensible framework for managing hardware devices via a shared bus using memory-mapped registers.
+
+\section{Signal Lines}
+The MBCI bus interface includes the following signal lines:
+
+\begin{itemize}
+ \item \textbf{VCC} (IN) – Power supply (OUT for MCU)
+ \item \textbf{CLK} (IN) – Clock line (OUT for MCU)
+ \item \textbf{ACK} (BI) – Acknowledge line containing packet frame
+ \item \textbf{D0-, D1-} (IN) – Host interface packet input
+ \item \textbf{D0+, D1+} (OUT) – Host interface packet output
+ \item \textbf{GND} (IN) – Ground line (OUT for MCU)
+\end{itemize}
+
+\section{Host Structure}
+
+\subsection*{IMBCIHost Structure}
+
+\begin{lstlisting}[language=C++,basicstyle=\ttfamily\footnotesize]
+struct IMBCIHost {
+ UInt32 Magic;
+ UInt32 HostId;
+ UInt16 VendorId;
+ UInt16 DeviceId;
+ UInt8 MemoryType;
+ UInt16 HostType;
+ UInt16 HostFlags;
+ UInt8 Error;
+ UInt32 MMIOTest;
+ UInt16 State;
+ UInt8 Status;
+ UInt8 InterruptEnable;
+ UInt64 BaseAddressRegister;
+ UInt64 BaseAddressRegisterSize;
+ UInt32 CommandIssue;
+ UInt8 Esb[64]; // Extended Signature Block
+ UInt8 Zero[8];
+};
+\end{lstlisting}
+
+\section{Enumerations}
+
+\subsection*{Device Speeds}
+\begin{itemize}
+ \item \texttt{kMBCISpeedDeviceInvalid}
+ \item \texttt{kMBCILowSpeedDevice}
+ \item \texttt{kMBCIHighSpeedDevice}
+\end{itemize}
+
+\subsection*{Host Flags}
+\begin{itemize}
+ \item \texttt{kMBCIHostFlagsSupportsNothing}
+ \item \texttt{kMBCIHostFlagsSupportsAPM}
+ \item \texttt{kMBCIHostFlagsSupportsDaisyChain}
+ \item \texttt{kMBCIHostFlagsSupportsHWInterrupts}
+ \item \texttt{kMBCIHostFlagsSupportsDMA}
+ \item \texttt{kMBCIHostFlagsExtended}
+\end{itemize}
+
+\subsection*{Host Types}
+\begin{itemize}
+ \item \texttt{kMBCIHostKindHardDisk}
+ \item \texttt{kMBCIHostKindOpticalDisk}
+ \item \texttt{kMBCIHostKindKeyboardLow}
+ \item \texttt{kMBCIHostKindMouseLow}
+ \item \texttt{kMBCIHostKindMouseHigh}
+ \item \texttt{kMBCIHostKindKeyboardHigh}
+ \item \texttt{kMBCIHostKindNetworkInterface}
+ \item \texttt{kMBCIHostKindDaisyChain}
+ \item \texttt{kMBCIHostKindStartExtended}
+\end{itemize}
+
+\subsection*{Host State}
+\begin{itemize}
+ \item \texttt{kMBCIHostStateInvalid}
+ \item \texttt{kMBCIHostStateReset}
+ \item \texttt{kMBCIHostStateSuccess}
+ \item \texttt{kMBCIHostStateReady}
+ \item \texttt{kMBCIHostStateDmaStart}
+ \item \texttt{kMBCIHostStateDmaEnd}
+ \item \texttt{kMBCIHostStateFail}
+\end{itemize}
+
+\section{Functions}
+
+\subsection*{Auth Key Reader}
+Reads the 24-bit auth key encoded in the last three bytes of the Extended Signature Block:
+\begin{lstlisting}[language=C++,basicstyle=\ttfamily\footnotesize]
+inline MBCIAuthKeyType mbci_read_auth_key(volatile IMBCIHost* host);
+\end{lstlisting}
+
+\subsection*{MMIO Test}
+Tests if MMIO is accessible by writing and reading a challenge value.
+\begin{lstlisting}[language=C++,basicstyle=\ttfamily\footnotesize]
+inline BOOL mbci_test_mmio(volatile IMBCIHost* host);
+\end{lstlisting}
+
+\end{document}