arm64: Add apple,s5l UART driver

This is the debug UART found in Apple SoCs. Tested on M1 MacBook Air.

Registers definitions were taken from:
  - https://github.com/AsahiLinux/m1n1/blob/18eb02fa92789dfcdab8e00e8b1cace7ab002718/src/uart_regs.h
  - https://www.sistemasorp.es/blog/S3C2410%20-%20datasheet.pdf

Change-Id: I2e4c8b7927fc823cedca421e1a2623b91f5ef112
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10480
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Sam Roberts
2026-03-11 23:38:03 +00:00
committed by waddlesplash
parent 5bb69a0f33
commit d2819f9e83
4 changed files with 177 additions and 0 deletions
@@ -0,0 +1,41 @@
/*
* Copyright 2026 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Sam Roberts, [email protected]
*/
#ifndef __DEV_UART_SAMSUNG_H
#define __DEV_UART_SAMSUNG_H
#include <arch/generic/debug_uart.h>
#define UART_KIND_SAMSUNG "samsung"
class ArchUARTSamsung : public DebugUART {
public:
ArchUARTSamsung(addr_t base, int64 clock);
~ArchUARTSamsung();
void InitPort(uint32 baud);
void Enable();
void Disable();
int PutChar(char c);
int GetChar(bool wait);
void FlushTx();
void FlushRx();
private:
void Out32(int reg, uint32 data);
uint32 In32(int reg);
};
#endif