Skip to content
Snippets Groups Projects
Commit e3904d9e authored by Barnabás Czémán's avatar Barnabás Czémán Committed by Luca Weiss
Browse files

main/lk2nd-msm8953: update to 0.3.8 & add motorola-ali

Update lk2nd to latest release and add motorola-ali project
as an subpackage.
parent fab0e090
Branches
No related tags found
No related merge requests found
# Maintainer: Alejandro Tafalla <atafalla@dnyon.com>
pkgname=lk2nd-msm8953
pkgver=0.3.7
pkgver=0.3.8
pkgrel=0
pkgdesc="Secondary little kernel (lk) bootloader for msm8953 based devices"
arch="aarch64"
......@@ -8,8 +8,12 @@ url="https://github.com/msm8953-mainline/lk2nd"
license="MIT AND GPL-2.0-only"
makedepends="dtc dtc-dev gcc-arm-none-eabi python3 py3-libfdt"
builddir="$srcdir"/lk2nd-$pkgver
source="lk2nd-$pkgver.tar.gz::https://github.com/msm8953-mainline/lk2nd/archive/refs/tags/$pkgver.tar.gz
o2.patch"
subpackages="$pkgname-motorola-ali:motorola_ali"
source="
lk2nd-$pkgver.tar.gz::https://github.com/msm8953-mainline/lk2nd/archive/refs/tags/$pkgver.tar.gz
o2.patch
fix-compile.patch
"
options="!check !archcheck !tracedeps !strip pmb:cross-native"
# This APKBUILD builds bare metal executable; options are very specific!
# * there are no tests (how do you even test the bootloader?);
......@@ -18,7 +22,7 @@ options="!check !archcheck !tracedeps !strip pmb:cross-native"
# * there are no depends for bootloader, it's a kernel and OS in one binary;
# * stripping of unused sections is done in lk2nd's own ld script.
build() {
_build() {
# This builds baremetal executable; distro-specific compiler flags
# and optimizations can't be set by build system.
unset CFLAGS
......@@ -34,7 +38,13 @@ build() {
unset PATH
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
make TOOLCHAIN_PREFIX=arm-none-eabi- msm8953-secondary
local project="$1"; shift
make TOOLCHAIN_PREFIX=arm-none-eabi- "$@" "$project"
}
build() {
_build msm8953-secondary
_build motorola-ali-secondary
}
package() {
......@@ -43,7 +53,13 @@ package() {
"$pkgdir"/boot
}
motorola_ali() {
install -Dm644 "$builddir"/build-motorola-ali-secondary/lk2nd.img -t \
"$subpkgdir"/boot
}
sha512sums="
072608efb1adc98c3fa2281f3b25733228676290797f93a974519af0cc6375eaf5c4c7d72f32384f49ce418cb95d22aed9833fe6bf76ef96db438fc5790ead73 lk2nd-0.3.7.tar.gz
1d962649b141d0f3be1a27ee5f9c8a472c871ad19d93e0a29a922c85c01bfd4cdbc23d0f48cb1d876d297dfbf7e3e77ddf7de5b3b7a8b9d76feec0df2cb9e0bf lk2nd-0.3.8.tar.gz
e4d2e116966485aca746bec5bf6ab9855514dc70dfb94ce3cdc9def01c5b36eeddc33e77bdbcfb8f6bb89bb0277fd6dd3e6f8066475dcfc5b5fcdec567af754b o2.patch
741ec09274e0caa5dc8af18d7a1ea265d478e159971fddc9c93a44077190b330a90bf3e1a5492c3a6fb4c499f054424b541c151b5b13a79316979e9b32e7b181 fix-compile.patch
"
diff --git a/arch/arm/mmu.c b/arch/arm/mmu.c
index 4b186fe4..f2e5cac3 100644
--- a/arch/arm/mmu.c
+++ b/arch/arm/mmu.c
@@ -26,6 +26,7 @@
#include <arch.h>
#include <arch/arm.h>
#include <arch/defines.h>
+#include <arch/ops.h>
#include <arch/arm/mmu.h>
#include <platform.h>
diff --git a/kernel/main.c b/kernel/main.c
index a40aa7d8..203a5586 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -29,6 +29,8 @@
#include <arch.h>
#include <platform.h>
#include <target.h>
+#include <lib/bio.h>
+#include <lib/fs.h>
#include <lib/heap.h>
#include <kernel/thread.h>
#include <kernel/timer.h>
diff --git a/lib/debug/debug.c b/lib/debug/debug.c
index b3e889d3..5941c3b6 100644
--- a/lib/debug/debug.c
+++ b/lib/debug/debug.c
@@ -32,6 +32,7 @@
#include <arch/ops.h>
#include <platform.h>
#include <platform/debug.h>
+#include <platform/timer.h>
#include <kernel/thread.h>
#include <kernel/timer.h>
#include <rand.h>
diff --git a/lib/fs/ext2/dir.c b/lib/fs/ext2/dir.c
index 90dc4258..e71f965b 100644
--- a/lib/fs/ext2/dir.c
+++ b/lib/fs/ext2/dir.c
@@ -198,7 +198,7 @@ int ext2_lookup(ext2_t *ext2, const char *_path, inodenum_t *inum)
// © 2019 Mis012 - SPDX-License-Identifier: GPL-3.0
// from here till the end of file
-status_t ext2_open_directory(fscookie *cookie, const char *path, dircookie **dircookie) {
+status_t ext2_open_directory(fscookie *cookie, const char *path, dircookie **dcookie) {
off_t entry_len = 0;
ext2_dir_t *dir = malloc(sizeof(ext2_dir_t));
memset(dir, 0, sizeof(ext2_dir_t));
@@ -225,7 +225,7 @@ status_t ext2_open_directory(fscookie *cookie, const char *path, dircookie **dir
dir->offset = 0;
dir->length = entry_len;
- *dircookie = dir;
+ *dcookie = (dircookie *) dir;
return 0;
}
@@ -254,7 +254,7 @@ status_t ext2_read_directory(dircookie *dircookie, struct dirent *ent) {
status_t ext2_close_directory(dircookie *dircookie) {
ext2_dir_t *dir = (ext2_dir_t *)dircookie;
- ext2_close_file(dir->file);
+ ext2_close_file((filecookie *)dir->file);
free(dir);
return 0;
}
diff --git a/platform/msm8953/platform.c b/platform/msm8953/platform.c
index 408876b1..4d3c1927 100644
--- a/platform/msm8953/platform.c
+++ b/platform/msm8953/platform.c
@@ -35,6 +35,7 @@
#include <qtimer.h>
#include <mmu.h>
#include <arch/arm/mmu.h>
+#include <arch/defines.h>
#include <smem.h>
#include <board.h>
#include <boot_stats.h>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment