.: Multiple changes

arch: Implement ARM32 support
soc: Implement ARM32 support for MSM8916
board: Implement ARM32 support for Samsung Galaxy J5 2015
include: main: Revert built-in memcpy, rearrange and add support for writel
lib: simplefb: Make the clear screen function usable

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Cc: Efim Girjeu <efimgirjeu@gmail.com>
This commit is contained in:
Ivaylo Ivanov committed 2023-07-18 14:41:37 +03:00
1 parent c4044f40fa
commit ed98b5d900
14 files changed
+161 -32

No files matched your search

+29
View File
@@ -3,6 +3,16 @@
* Copyright (c) 2022, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
*/
#include <lib/debug.h>
#include <stddef.h>
/* TODO: Import libc */
void writel(unsigned int value, void* address) {
// Cast the address pointer to a 32-bit unsigned integer pointer
volatile unsigned int* ptr = (volatile unsigned int*)address;
// Write the value to the memory location
*ptr = value;
}
void printk(char *text) {
#ifdef CONFIG_SIMPLE_FB
@@ -16,3 +26,22 @@ void printk(char *text) {
debug_linecount++;
#endif
}
#ifdef __aarch64__
/* Define our own 128 bit memcpy */
void memcpy(void *dest, void *src, size_t size)
{
unsigned __int128 *src2 = src;
unsigned __int128 *dest2 = dest;
for (size_t i = 0; i < size / 16; i++)
dest2[i] = src2[i];
}
#endif
#ifdef __arm__
void memcpy (char* src, char* dest, size_t len) {
for (size_t i = 0; i < len; i++)
dest[i] = src[i];
}
#endif
+1 -1
View File
@@ -8,7 +8,7 @@
#include <lib/simplefb.h>
#include <lib/font.h>
void clean_fb(volatile char *fb, char *text, int width, int height, int stride) {
void clean_fb(volatile char *fb, int width, int height, int stride) {
for (volatile char *addr = fb; addr < fb + (width * height * stride); addr += stride)
*(int*) (addr) = 0x0;
}