Skip to content

Commit

Permalink
Merge pull request home-assistant#5 from adeepn/jethome_5.7
Browse files Browse the repository at this point in the history
Jethome 5.7 WiP
  • Loading branch information
adeepn authored Jan 20, 2021
2 parents 09ba1c3 + 9d8b566 commit c29eddb
Show file tree
Hide file tree
Showing 23 changed files with 139 additions and 62 deletions.
15 changes: 0 additions & 15 deletions Documentation/boards/jethome/jethub-d1.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,3 @@ Work in progress
## MMC

Uboot has MBR partition table autogeneration.
Partition scheme
num|begin |sectors |bytes |mbytes|partition|id |
1 |0 |8192 |4 194 304 |4 | |00000000-01|
2 |73728 |131072 |67 108 864 |64 | |00000000-02|
3 |221184 |0 |0 |0 | |00000000-03|
4 |221184 |13426688|6 874 464 256|6 556 |ext mbr |00000000-04|
5 |237568 |16384 |8 388 608 |8 | |00000000-05|
6 |270336 |65536 |33 554 432 |32 |boot |00000000-06|
7 |352256 |65536 |33 554 432 |32 |kernela |00000000-07|
8 |434176 |524288 |268 435 456 |256 |systema |00000000-08|
9 |974848 |65536 |33 554 432 |32 |kernelb |00000000-09|
10 |1056768|524288 |268 435 456 |256 |systemb |00000000-0a|
11 |1597440|16384 |8 388 608 |8 |bootinfo |00000000-0b|
12 |1630208|196608 |100 663 296 |96 |overlay |00000000-0c|
13 |1843200|13426688|6 874 464 256|6 556 |data |00000000-0d|
1 change: 1 addition & 0 deletions buildroot-external/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-bcm43xx/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-rtl8723/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hardkernel-boot/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/jethome-boot/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/armbian-firmware-ap6255/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/qemu-guest-agent/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/intel-e1000e/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/rpi-eeprom/Config.in"
Expand Down
Binary file modified buildroot-external/board/jethome/jethub-d1/bin/DDR.USB
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 0 additions & 9 deletions buildroot-external/board/jethome/jethub-d1/bin/platform.conf

This file was deleted.

28 changes: 20 additions & 8 deletions buildroot-external/board/jethome/jethub-d1/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ function create_disk_image() {
_create_disk_aml
}

function create_platform_conf () {
echo 'Platform:0x0811' > ${BINARIES_DIR}/platform.conf
echo 'DDRLoad:0xfffc0000' > ${BINARIES_DIR}/platform.conf
echo 'DDRRun:0xfffc0000' > ${BINARIES_DIR}/platform.conf
echo 'UbootLoad:0x200c000' > ${BINARIES_DIR}/platform.conf
echo 'UbootRun:0xfffc0000' > ${BINARIES_DIR}/platform.conf
echo 'Control0=0xfffc0000:0x000000b1' > ${BINARIES_DIR}/platform.conf
echo 'Control1=0xfffc0000:0x00005183' > ${BINARIES_DIR}/platform.conf
echo 'Encrypt_reg:0xff800228' > ${BINARIES_DIR}/platform.conf
echo 'bl2ParaAddr=0xfffcc000' > ${BINARIES_DIR}/platform.conf
}

function _create_disk_aml() {
# ${FILE##*/}
local boot_img="$(path_boot_img)"
Expand All @@ -82,29 +94,29 @@ function _create_disk_aml() {
local hdd_count=${DISK_SIZE:-2}
local disk_layout="${BINARIES_DIR}/disk.layout"
local boot_start=$(size2sectors "8M")
local bootloader_img="u-boot.bin" # old bootloader.PARTITION
local ubootbin_img="u-boot.bin.usb.tpl" # UBOOT.USB

echo '[LIST_NORMAL]' > ${BINARIES_DIR}/image.cfg
echo 'file="DDR.USB" main_type="USB" sub_type="DDR"' >> ${BINARIES_DIR}/image.cfg
echo 'file="UBOOT.USB" main_type="USB" sub_type="UBOOT"' >> ${BINARIES_DIR}/image.cfg
echo 'file="'${ubootbin_img}'" main_type="USB" sub_type="UBOOT"' >> ${BINARIES_DIR}/image.cfg
echo 'file="_aml_dtb.PARTITION" main_type="dtb" sub_type="meson1"' >> ${BINARIES_DIR}/image.cfg
echo 'file="platform.conf" main_type="conf" sub_type="platform"' >> ${BINARIES_DIR}/image.cfg
echo '' >> ${BINARIES_DIR}/image.cfg
echo '[LIST_VERIFY]' >> ${BINARIES_DIR}/image.cfg
echo 'file="_aml_dtb.PARTITION" main_type="PARTITION" sub_type="_aml_dtb"' >> ${BINARIES_DIR}/image.cfg
echo 'file="bootloader.PARTITION" main_type="PARTITION" sub_type="bootloader"' >> ${BINARIES_DIR}/image.cfg
echo 'file="'${bootloader_img}'" main_type="PARTITION" sub_type="bootloader"' >> ${BINARIES_DIR}/image.cfg
echo 'file="'${boot_img##*/}'" main_type="PARTITION" sub_type="boot"' >> ${BINARIES_DIR}/image.cfg
echo 'file="'${kernel_img##*/}'" main_type="PARTITION" sub_type="kernela"' >> ${BINARIES_DIR}/image.cfg
echo 'file="'${rootfs_img##*/}'" main_type="PARTITION" sub_type="systema"' >> ${BINARIES_DIR}/image.cfg
# echo 'file="'PART.4.kernelb'" main_type="PARTITION" sub_type="kernelb"' >> ${BINARIES_DIR}/image.cfg
# echo 'file="'PART.5.systemb'" main_type="PARTITION" sub_type="systemb"' >> ${BINARIES_DIR}/image.cfg
# echo 'file="'PART.6.bootinfo'" main_type="PARTITION" sub_type="bootstate"' >> ${BINARIES_DIR}/image.cfg
echo 'file="'${overlay_img##*/}'" main_type="PARTITION" sub_type="overlay"' >> ${BINARIES_DIR}/image.cfg
echo 'file="'${data_img##*/}'" main_type="PARTITION" sub_type="data"' >> ${BINARIES_DIR}/image.cfg

cp $BOARD_DIR/bin/DDR.USB $BINARIES_DIR/
cp $BOARD_DIR/bin/UBOOT.USB $BINARIES_DIR/
cp $BOARD_DIR/bin/bootloader.PARTITION $BINARIES_DIR/
cp $BOARD_DIR/bin/platform.conf $BINARIES_DIR/
#cp $BOARD_DIR/bin/UBOOT.USB $BINARIES_DIR/
#cp $BOARD_DIR/bin/bootloader.PARTITION $BINARIES_DIR/

create_platform_conf

cc -o $BINARIES_DIR/dtbTool $BOARD_DIR/bin/dtbTool.c
$BINARIES_DIR/dtbTool -o $BINARIES_DIR/_aml_dtb.PARTITION ${BINARIES_DIR}/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PM=0
nv_by_chip=1 \
43362 1 nvram_ap6210.txt
43430 0 nvram_ap6212.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ make_swap()
local swap_part=/mnt/data
local swap_path=/mnt/data/swapfile
local swap_free_space=$(env stat -f -c '%a*%S/1024/1024' $swap_part | bc)
local swap_priority=6
local swap_priority=-3

if [ -n "$swap_free_space" ]; then
if [ ! -f "$swap_path" ]; then
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=HassOS File swap for JetHome
DefaultDependencies=no
Requires=hassos-expand.service mnt-data.mount [email protected]
After=hassos-expand.service mnt-data.mount [email protected]
Wants=hassos-expand.service mnt-data.mount systemd-fsck@dev-disk-by\x2dlabel-hassos\x2ddata.service [email protected]
#RefuseManualStart=true
#RefuseManualStop=true

[Service]
Type=oneshot
ExecStart=/usr/lib/jethome/swap_file_maker
TimeoutStartSec=15min
RemainAfterExit=true
#StandardOutput=null

[Install]
WantedBy=hassos-zram.target

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
KERNEL=="mmcblk1p7", SYMLINK+="disk/by-partlabel/hassos-bootstate"
KERNEL=="mmcblk1p8", SYMLINK+="disk/by-partlabel/hassos-kernel0"
KERNEL=="mmcblk1p9", SYMLINK+="disk/by-partlabel/hassos-system0"
KERNEL=="mmcblk1p10", SYMLINK+="disk/by-partlabel/hassos-kernel1"
KERNEL=="mmcblk1p11", SYMLINK+="disk/by-partlabel/hassos-system1"
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ index 000000000..8e6bd30ca
+/ {
+ compatible = "jethome,j100", "amlogic,a113d", "amlogic,meson-axg";
+ model = "JetHome JetHub J100 Compatible Board";
+ amlogic-dt-id = "axg_jethubj100_v1";
+ amlogic-dt-id = "jethome_j100_v1";
+
+ aliases {
+ serial0 = &uart_AO; /* Console */
Expand Down Expand Up @@ -333,7 +333,7 @@ index 000000000..8e6bd30ca
+ ranges;
+ linux,cma {
+ compatible = "shared-dma-pool";
+ reusable; size = <0x0 0x2000000>;
+ reusable; size = <0x0 0x400000>;
+ alignment = <0x0 0x400000>;
+ linux,cma-default;
+ };
Expand Down
12 changes: 4 additions & 8 deletions buildroot-external/configs/jethub_d1_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ BR2_PACKAGE_USB_MODESWITCH_DATA=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="s400"
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="$(BR2_EXTERNAL_HASSOS_PATH)/board/jethome/jethub-d1/uboot-boot.ush"
Expand All @@ -110,12 +112,6 @@ BR2_PACKAGE_JETHOME_BOOT_JETHUB_D1=y
BR2_PACKAGE_DOSFSTOOLS=y
BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y

#BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XX=y
#BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX=y
# or BR2_PACKAGE_RPI_WIFI_FIRMWARE=y
#BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM4366B1=y
#BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM4366C0=y
BR2_PACKAGE_ARMBIAN_FIRMWARE_AP6255=y

#BR2_PACKAGE_LINUX_FIRMWARE_USB_SERIAL_TI=y

BR2_PACKAGE_ARMBIAN_FIRMWARE=y
BR2_PACKAGE_XZ=y
4 changes: 4 additions & 0 deletions buildroot-external/package/armbian-firmware-ap6255/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config BR2_PACKAGE_ARMBIAN_FIRMWARE_AP6255
bool "AP6255 SDIO WiFi/BT"
help
Firmware files for AP6255 WiFi/BT combo chip.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Locally calculated
sha256 c347aa50b7fe6b4f6078ed310f6cdf3f4acbabb530ff3612be022ae24cfdc512 armbian-firmware-ap6255-292e1e5b5bc5756e9314ea6d494d561422d23264.tar.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
################################################################################
#
# armbian-firmware-ap6255
#
################################################################################

ARMBIAN_FIRMWARE_AP6255_VERSION = 292e1e5b5bc5756e9314ea6d494d561422d23264
ARMBIAN_FIRMWARE_AP6255_SITE = https://github.com/armbian/firmware
ARMBIAN_FIRMWARE_AP6255_SITE_METHOD = git

# AP6255 WiFi/BT combo firmware
ifeq ($(BR2_PACKAGE_ARMBIAN_FIRMWARE_AP6255),y)
ARMBIAN_FIRMWARE_AP6255_FILES += \
BCM4345C0.hcd \
fw_bcm43455c0_ag.bin \
fw_bcm43455c0_ag_apsta.bin \
fw_bcm43455c0_ag_p2p.bin \
nvram_ap6255.txt \
brcm/brcmfmac43455-sdio.bin \
brcm/brcmfmac43455-sdio.clm_blob \
brcm/brcmfmac43455-sdio.txt \
brcm/config.txt \

define ARMBIAN_FIRMWARE_AP6255_INSTALL_FILES
cd $(@D) && \
$(TAR) cf install.tar $(sort $(ARMBIAN_FIRMWARE_AP6255_FILES)) && \
$(TAR) xf install.tar -C $(TARGET_DIR)/lib/firmware
endef

ARMBIAN_FIRMWARE_AP6255_LICENSE = PROPRIETARY
ARMBIAN_FIRMWARE_AP6255_REDISTRIBUTE = NO
endif

define ARMBIAN_FIRMWARE_AP6255_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/lib/firmware
$(ARMBIAN_FIRMWARE_AP6255_INSTALL_FILES)
$(ARMBIAN_FIRMWARE_AP6255_INSTALL_DIRS)
endef

$(eval $(generic-package))
7 changes: 6 additions & 1 deletion buildroot-external/package/jethome-boot/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ choice
config BR2_PACKAGE_JETHOME_BOOT_JETHUB_D1
bool "JetHub-D1"
help
For the JetHub-D1
For the JetHome JetHub-D1 (j100)

config BR2_PACKAGE_JETHOME_BOOT_JETHUB_H1
bool "JetHub-H1"
help
For the JetHome JetHub-H1 (j80)

endchoice

Expand Down
29 changes: 29 additions & 0 deletions buildroot-external/package/jethome-boot/jethome-boot.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
################################################################################
#
# jethome uboot loader
#
################################################################################

JETHOME_BOOT_VERSION = HEAD
JETHOME_BOOT_SITE = https://github.com/adeepn/jethub-prebuilt-u-boot.git
JETHOME_BOOT_SITE_METHOD = git
JETHOME_BOOT_INSTALL_IMAGES = YES
JETHOME_BOOT_DEPENDENCIES = uboot
JETHOME_BOOT_BINS = u-boot.bin u-boot.bin.usb.tpl


ifeq ($(BR2_PACKAGE_JETHOME_BOOT_JETHUB_D1),y)
JETHOME_BOOT_DEVICE = jethub-j100

else ifeq ($(BR2_PACKAGE_JETHOME_BOOT_JETHUB_H1),y)
JETHOME_BOOT_DEVICE = jethub-j80

endif

define JETHOME_BOOT_INSTALL_IMAGES_CMDS
$(foreach f,$(JETHOME_BOOT_BINS), \
cp -dpf $(@D)/hassos/$(JETHOME_BOOT_DEVICE)/$(f) $(BINARIES_DIR)/
)
endef

$(eval $(generic-package))

0 comments on commit c29eddb

Please sign in to comment.