diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index c8bbbb5f1e1..c7974ef372f 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -19,6 +19,7 @@ Describe the Homme Assistant image you are using and the hardare environemnt - [ ] ASUS Tinker [S] - [ ] Intel NUC (or compatible) - [ ] OVA (Open Virtualization Applicance, on Intel NUC or any other hardware, please add the Hypervisor you are using) +- [ ] JetHome (D1/H1) **Home Assistant OS release:** - [ ] Fresh installation of release x.y diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 522ce39c426..2a5e942efaa 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -13,6 +13,8 @@ categories: label: 'board/odroid' - title: 'ASUS Tinker' label: 'board/tinker' + - title: 'JetHome' + label: 'board/jethome' template: | ## Changes diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 0df359d51b3..26883357f3a 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -50,6 +50,8 @@ jobs: - {"name": "rpi4", "output": "rpi4", "runner": "arm-runner"} - {"name": "rpi4_64", "output": "rpi4-64", "runner": "aarch64-runner"} - {"name": "tinker", "output": "tinker", "runner": "arm-runner"} + - {"name": "jethub_d1", "output": "jethub-d1", "runner": "aarch64-runner"} + - {"name": "jethub_h1", "output": "jethub-h1", "runner": "aarch64-runner"} runs-on: ${{ matrix.board.runner }} steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7375f9ed037..0c38aad2692 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,6 +45,8 @@ jobs: - {"name": "rpi4", "output": "rpi4", "runner": "arm-runner"} - {"name": "rpi4_64", "output": "rpi4-64", "runner": "aarch64-runner"} - {"name": "tinker", "output": "tinker", "runner": "arm-runner"} + - {"name": "jethub_d1", "output": "jethub-d1", "runner": "aarch64-runner"} + - {"name": "jethub_h1", "output": "jethub-h1", "runner": "aarch64-runner"} runs-on: ${{ matrix.board.runner }} steps: diff --git a/Documentation/boards/README.md b/Documentation/boards/README.md index 7fceae4c968..47053d1a8a5 100644 --- a/Documentation/boards/README.md +++ b/Documentation/boards/README.md @@ -33,6 +33,7 @@ The following boards/devices are supported: - QCOW2 ? - JetHome - JetHub D1 + - JetHub H1 Notes: - see ? above: are these currently supported? see ova documentation which explains issues with previous OVA distribution) @@ -56,3 +57,4 @@ Notes: |Tinker Board|`make tinker` |[tinker](../../buildroot-external/configs/tinker_defconfig)|[asus](./asus/)| |OVA |`make ova` |[ova](../../buildroot-external/configs/ova_defconfig)|[ova](./ova/)| |JetHub D1 |`make jethub_d1` |[jethub_d1](../../buildroot-external/configs/jethub_d1_defconfig)|[jethome](./jethome/)| +|JetHub H1 |`make jethub_h1` |[jethub_h1](../../buildroot-external/configs/jethub_h1_defconfig)|[jethome](./jethome/)| diff --git a/Documentation/boards/jethome/README.md b/Documentation/boards/jethome/README.md index de5b0abaad3..fc0c10b8a10 100644 --- a/Documentation/boards/jethome/README.md +++ b/Documentation/boards/jethome/README.md @@ -5,5 +5,6 @@ | Device | Release Date | Support | Config | |----------------|---------------|--------------|-----------| | JetHub D1 | 2020 | experimental | [jethub_d1](../../../buildroot-external/configs/jethub_d1_defconfig) | +| JetHub H1 | 2020 | experimental | [jethub_h1](../../../buildroot-external/configs/jethub_h1_defconfig) | See separate documentation for each board. diff --git a/Documentation/boards/jethome/jethub-d1.md b/Documentation/boards/jethome/jethub-d1.md index 9bcd8dbcaca..86f3cb88836 100644 --- a/Documentation/boards/jethome/jethub-d1.md +++ b/Documentation/boards/jethome/jethub-d1.md @@ -1,5 +1,22 @@ # JetHub D1 +More information [JetHub D1 wiki](http://wiki.jethome.ru/jethub_d1) (Russian) + +- 4-core CPU Amlogic A113X (ARM Cortex-A53) 1,4 ГГц; +- RAM 512 or 1024 MB DDR3; +- eMMC flash 8 Gbyte. + +## Interfaces + +- WiFi/Bluetooth AMPAK AP6255 (Broadcom BCM43455) +- Ethernet IEEE 802.3 10/100 Mbps +- ZigBee TI CC2538 + CC2592 +- 1 x USB 2.0 high-speed +- 1 X 1-Wire +- 2 x RS-485 +- 4 x inputs «dry contact» +- 3 х relay output + ## MMC MMC support is provided transparently. Just flash the image to the MMC board by http://update.jethome.ru/armbian/USB_Burning_Tool_v2.2.3.zip diff --git a/Documentation/boards/jethome/jethub-h1.md b/Documentation/boards/jethome/jethub-h1.md new file mode 100644 index 00000000000..befe7d74066 --- /dev/null +++ b/Documentation/boards/jethome/jethub-h1.md @@ -0,0 +1,39 @@ +# JetHub H1 + +More information [JetHub H1 wiki](http://wiki.jethome.ru/jethub_h1) (Russian) + +- 4-core CPU Amlogic S905W (ARM Cortex-A53) 1,5 Ghz; +- RAM 1024 MB DDR3; +- eMMC flash 8 Gbyte. + +## Interfaces + +- WiFi/Bluetooth Realtek RTL8822CS +- MicroSD 2.x/3.x/4.x DS/HS card slot +- Ethernet IEEE 802.3 10/100 Mbps +- ZigBee TI CC2538 + CC2592 +- 2 x USB 2.0 high-speed + +## MMC + +MMC support is provided transparently. Just flash the image to the MMC board by http://update.jethome.ru/armbian/USB_Burning_Tool_v2.2.3.zip + +## Console + +By default, console access is granted over the serial header. Certain startup messages will only appear on the serial console by default. + +## USB + +A long-standing kernel bug currently results in some odd behavior. To use the USB, a device must be plugged into one of the USB ports at hard boot. If all devices are removed from the USB ports, the USB will cease to function until a reboot. + +### OTG + +The OTG USB is untested. + +## GPIO + +Work in progress + +## MMC + +Uboot has MBR partition table autogeneration. diff --git a/Documentation/development.md b/Documentation/development.md index 06319705412..e57f9dc29cd 100644 --- a/Documentation/development.md +++ b/Documentation/development.md @@ -50,6 +50,8 @@ Default 2. That is the size of end image in GB. - raspberrypi3-64 - raspberrypi4-64 - tinker +- jethub-d1 +- jethub-h1 `SUPERVISOR_ARCH`: diff --git a/Documentation/kernel.md b/Documentation/kernel.md index 28a9fbde913..c7b7a96d680 100644 --- a/Documentation/kernel.md +++ b/Documentation/kernel.md @@ -18,3 +18,4 @@ Default Kernel tree: 5.4 | Odroid-XU4 | 5.9.13 | | Intel NUC | 5.4.82 | | JetHub D1 | 5.7.16 | +| JetHub H1 | 5.7.16 | diff --git a/buildroot-external/board/jethome/patches/kernel/arm-64-current/0005-jethome-jethub-j80-dts-arm64-add-dts-files.patch b/buildroot-external/board/jethome/patches/kernel/arm-64-current/0005-jethome-jethub-j80-dts-arm64-add-dts-files.patch index 5de89b0a076..c3b9900599d 100644 --- a/buildroot-external/board/jethome/patches/kernel/arm-64-current/0005-jethome-jethub-j80-dts-arm64-add-dts-files.patch +++ b/buildroot-external/board/jethome/patches/kernel/arm-64-current/0005-jethome-jethub-j80-dts-arm64-add-dts-files.patch @@ -3,12 +3,11 @@ new file mode 100644 index 000000000..cf0e6e742 --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905w-jethome-jethub-j80.dts -@@ -0,0 +1,381 @@ +@@ -0,0 +1,373 @@ + +/dts-v1/; + -+#include "meson-gxl-s905x.dtsi" -+#include "meson-gx-p23x-q20x.dtsi" ++#include "meson-gxl.dtsi" + +/ { + compatible = "amlogic,p281", "amlogic,s905w", "amlogic,meson-gxl"; @@ -142,10 +141,6 @@ index 000000000..cf0e6e742 + clock-names = "ext_clock"; + }; + -+ sound { -+ status = "disabled"; -+ } -+ + efusekey: efusekey { + keynum = <5>; + key0 = <&key_0>; @@ -376,12 +371,9 @@ index 000000000..cf0e6e742 + }; +}; + -+&acodec { -+ status = "disabled"; -+}; -+&hdmi_tx { -+ status = "disabled"; -+}; -+&ir { -+ status = "disabled"; ++ ++/* S905X only has access to its internal PHY */ ++ðmac { ++ phy-mode = "rmii"; ++ phy-handle = <&internal_phy>; +}; diff --git a/buildroot-external/board/jethome/patches/kernel/arm-64-current/0005-jethome-jethub-j80-dts-arm64-add-dts-files.patch_enabled_ir_audio_hdmi b/buildroot-external/board/jethome/patches/kernel/arm-64-current/0005-jethome-jethub-j80-dts-arm64-add-dts-files.patch_enabled_ir_audio_hdmi deleted file mode 100644 index 00ba701be90..00000000000 --- a/buildroot-external/board/jethome/patches/kernel/arm-64-current/0005-jethome-jethub-j80-dts-arm64-add-dts-files.patch_enabled_ir_audio_hdmi +++ /dev/null @@ -1,374 +0,0 @@ -diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905w-jethome-jethub-j80.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905w-jethome-jethub-j80.dts -new file mode 100644 -index 000000000..cf0e6e742 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905w-jethome-jethub-j80.dts -@@ -0,0 +1,368 @@ -+ -+/dts-v1/; -+ -+#include "meson-gxl-s905x.dtsi" -+#include "meson-gx-p23x-q20x.dtsi" -+ -+/ { -+ compatible = "amlogic,p281", "amlogic,s905w", "amlogic,meson-gxl"; -+ model = "JetHome JetHub J80"; -+ amlogic-dt-id = "gxl_j80_1g"; -+ -+ /* 1G RAM */ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x0 0x0 0x0 0x40000000>; -+ }; -+ partitions: partitions{ -+ parts = <8>; -+ part-0 = <&boot>; -+ part-1 = <&bootstate>; -+ part-2 = <&kernela>; -+ part-3 = <&systema>; -+ part-4 = <&kernelb>; -+ part-5 = <&systemb>; -+ part-6 = <&overlay>; -+ part-7 = <&data>; -+ -+ boot:boot { -+ pname = "boot"; -+ size = <0x0 0x4000000>; -+ mask = <1>; -+ }; -+ bootstate:bootstate { -+ pname = "bootstate"; -+ size = <0x0 0x800000>; -+ mask = <4>; -+ }; -+ kernela:kernela { -+ pname = "kernela"; -+ size = <0x0 0x4000000>; -+ mask = <4>; -+ }; -+ systema:systema { -+ pname = "systema"; -+ size = <0x0 0x10000000>; -+ mask = <4>; -+ }; -+ kernelb:kernelb { -+ pname = "kernelb"; -+ size = <0x0 0x4000000>; -+ mask = <4>; -+ }; -+ systemb:systemb { -+ pname = "systemb"; -+ size = <0x0 0x10000000>; -+ mask = <4>; -+ }; -+ overlay:overlay { -+ pname = "overlay"; -+ size = <0x0 0x8000000>; -+ mask = <4>; -+ }; -+ data:data { -+ pname = "data"; -+ size = <0xffffffff 0xffffffff>; -+ mask = <4>; -+ }; -+ }; -+ reserved-memory { -+ #address-cells = <2>; -+ #size-cells = <2>; -+ ranges; -+ linux,cma { -+ compatible = "shared-dma-pool"; -+ reusable; size = <0x0 0x400000>; -+ alignment = <0x0 0x400000>; -+ linux,cma-default; -+ }; -+ }; -+ aliases { -+ serial0 = &uart_AO; /* Console */ -+ serial1 = &uart_A; /* Bluetooth */ -+ serial2 = &uart_AO_B; /* Wireless module 1 */ -+ serial3 = &uart_C; /* Wireless module 2 */ -+ ethernet0 = ðmac; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ vddio_ao18: regulator-vddio_ao18 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDIO_AO18"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ }; -+ -+ vddio_boot: regulator-vddio_boot { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDIO_BOOT"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ }; -+ -+ vddao_3v3: regulator-vddao_3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDDAO_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ vcc_3v3: regulator-vcc_3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "VCC_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ emmc_pwrseq: emmc-pwrseq { -+ compatible = "mmc-pwrseq-emmc"; -+ reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>; -+ }; -+ -+ wifi32k: wifi32k { -+ compatible = "pwm-clock"; -+ #clock-cells = <0>; -+ clock-frequency = <32768>; -+ pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ -+ }; -+ -+ sdio_pwrseq: sdio-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; -+ clocks = <&wifi32k>; -+ clock-names = "ext_clock"; -+ }; -+ -+ efusekey: efusekey { -+ keynum = <5>; -+ key0 = <&key_0>; -+ key1 = <&key_1>; -+ key2 = <&key_2>; -+ key3 = <&key_3>; -+ key4 = <&key_4>; -+ -+ key_0: key_0 { -+ keyname = "mac"; -+ offset = <0>; -+ size = <6>; -+ }; -+ key_1: key_1 { -+ keyname = "mac_bt"; -+ offset = <6>; -+ size = <6>; -+ }; -+ key_2: key_2 { -+ keyname = "mac_wifi"; -+ offset = <12>; -+ size = <6>; -+ }; -+ key_3: key_3 { -+ keyname = "usid"; -+ offset = <18>; -+ size = <32>; -+ }; -+ key_4: key_4 { -+ keyname = "serial"; -+ offset = <50>; -+ size = <32>; -+ }; -+ }; //End efusekey -+ -+ unifykey { -+ compatible = "amlogic, unifykey"; -+ status = "ok"; -+ unifykey-num = <6>; -+ unifykey-index-0 = <&keysn_0>; -+ unifykey-index-1 = <&keysn_1>; -+ unifykey-index-2 = <&keysn_2>; -+ unifykey-index-3 = <&keysn_3>; -+ unifykey-index-4 = <&keysn_4>; -+ unifykey-index-5 = <&keysn_5>; -+ -+ keysn_0: key_0 { -+ key-name = "usid"; -+ key-device = "efuse"; -+ key-permit = "read","write"; -+ }; -+ keysn_1: key_1 { -+ key-name = "mac"; -+ key-device = "efuse"; -+ key-permit = "read","write"; -+ }; -+ keysn_2: key_2 { -+ key-name = "mac_bt"; -+ key-device = "normal"; -+ key-permit = "read","write","del"; -+ key-type = "mac"; -+ }; -+ keysn_3: key_3 { -+ key-name = "mac_wifi"; -+ key-device = "normal"; -+ key-permit = "read","write","del"; -+ key-type = "mac"; -+ }; -+ keysn_4: key_4 { -+ key-name = "serial"; -+ key-device = "efuse"; -+ key-permit = "read","write"; -+ }; -+ keysn_5:key_5 { -+ key-name = "deviceid"; -+ key-device = "normal"; -+ key-permit = "read","write","del"; -+ }; -+ }; //End unifykey -+}; -+ -+&efuse { -+ status = "okay"; -+ compatible = "amlogic,meson-gxbb-efuse", "amlogic, efuse"; -+ read_cmd = <0x82000030>; -+ write_cmd = <0x82000031>; -+ get_max_cmd = <0x82000033>; -+ key = <&efusekey>; -+ clock-names = "efuse_clk"; -+}; -+ -+&pwm_ef { -+ status = "okay"; -+ pinctrl-0 = <&pwm_e_pins>; -+ pinctrl-names = "default"; -+ clocks = <&clkc CLKID_FCLK_DIV4>; -+ clock-names = "clkin0"; -+}; -+ -+&saradc { -+ status = "okay"; -+ vref-supply = <&vddio_ao18>; -+}; -+ -+/* Wireless SDIO Module */ -+&sd_emmc_a { -+ status = "okay"; -+ pinctrl-0 = <&sdio_pins>; -+ pinctrl-1 = <&sdio_clk_gate_pins>; -+ pinctrl-names = "default", "clk-gate"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ bus-width = <4>; -+ cap-sd-highspeed; -+ max-frequency = <50000000>; -+ -+ non-removable; -+ disable-wp; -+ -+ /* WiFi firmware requires power to be kept while in suspend */ -+ keep-power-in-suspend; -+ -+ mmc-pwrseq = <&sdio_pwrseq>; -+ -+ vmmc-supply = <&vddao_3v3>; -+ vqmmc-supply = <&vddio_boot>; -+}; -+ -+/* SD card */ -+&sd_emmc_b { -+ status = "okay"; -+ pinctrl-0 = <&sdcard_pins>; -+ pinctrl-1 = <&sdcard_clk_gate_pins>; -+ pinctrl-names = "default", "clk-gate"; -+ -+ bus-width = <4>; -+ cap-sd-highspeed; -+ max-frequency = <50000000>; -+ disable-wp; -+ -+ cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>; -+ -+ vmmc-supply = <&vddao_3v3>; -+ vqmmc-supply = <&vddio_boot>; -+}; -+ -+/* eMMC */ -+&sd_emmc_c { -+ status = "okay"; -+ pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>; -+ pinctrl-1 = <&emmc_clk_gate_pins>; -+ pinctrl-names = "default", "clk-gate"; -+ -+ bus-width = <8>; -+ cap-mmc-highspeed; -+ max-frequency = <200000000>; -+ non-removable; -+ disable-wp; -+ mmc-ddr-1_8v; -+ mmc-hs200-1_8v; -+ -+ mmc-pwrseq = <&emmc_pwrseq>; -+ vmmc-supply = <&vcc_3v3>; -+ vqmmc-supply = <&vddio_boot>; -+}; -+ -+/* Console UART */ -+&uart_AO { -+ status = "okay"; -+ pinctrl-0 = <&uart_ao_a_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&usb0 { -+ status = "okay"; -+}; -+ -+/* S905X only has access to its internal PHY */ -+ðmac { -+ status = "okay"; -+ phy-mode = "rmii"; -+ phy-handle = <&internal_phy>; -+}; -+ -+&internal_phy { -+ status = "okay"; -+ pinctrl-0 = <ð_link_led_pins>, <ð_act_led_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&uart_A { -+ status = "okay"; -+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; -+ pinctrl-names = "default"; -+ // uart-has-rtscts; -+ -+ /* -+ bluetooth { -+ compatible = "realtek,rtl8822cs-bt"; -+ enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; -+ }; -+ */ -+}; -+ -+&uart_C { -+ status = "okay"; -+ pinctrl-0 = <&uart_c_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&uart_AO_B { -+ status = "okay"; -+ pinctrl-0 = <&uart_ao_b_pins>, <&uart_ao_b_cts_rts_pins>; -+ pinctrl-names = "default"; -+ uart-has-rtscts; -+}; -+ -+&i2c_B { -+ status = "okay"; -+ pinctrl-names="default"; -+ pinctrl-0=<&i2c_b_pins>; -+ -+ pcf8563: pcf8563@51 { -+ compatible = "nxp,pcf8563"; -+ reg = <0x51>; -+ status = "okay"; -+ }; -+}; -+ diff --git a/buildroot-external/board/jethome/patches/kernel/arm-64-current/0007-Fix-cma.patch b/buildroot-external/board/jethome/patches/kernel/arm-64-current/0007-Fix-cma.patch new file mode 100644 index 00000000000..2a9764114a8 --- /dev/null +++ b/buildroot-external/board/jethome/patches/kernel/arm-64-current/0007-Fix-cma.patch @@ -0,0 +1,25 @@ +From c3b53a1f97d2ac88b6ec060c15759b8da4bbb652 Mon Sep 17 00:00:00 2001 +From: Vyacheslav Bocharov +Date: Sun, 31 Jan 2021 15:28:20 +0300 +Subject: [PATCH] Fix cma + +--- + arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +index 5c6770b4dd..9c72e8c42d 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +@@ -51,7 +51,7 @@ secmon_reserved_bl32: secmon@5300000 { + linux,cma { + compatible = "shared-dma-pool"; + reusable; +- size = <0x0 0x10000000>; ++ size = <0x0 0x400000>; + alignment = <0x0 0x400000>; + linux,cma-default; + }; +-- +2.25.1 + diff --git a/buildroot-external/board/jethome/rootfs-overlay/usr/lib/jethome/swap_file_maker b/buildroot-external/board/jethome/rootfs-overlay/usr/lib/jethome/swap_file_maker index 3a958df88b4..df625129c53 100755 --- a/buildroot-external/board/jethome/rootfs-overlay/usr/lib/jethome/swap_file_maker +++ b/buildroot-external/board/jethome/rootfs-overlay/usr/lib/jethome/swap_file_maker @@ -1,47 +1,52 @@ #!/bin/bash +swap_size=512 +swap_part=/mnt/data +swap_path=/mnt/data/swapfile +swap_priority=-3 + +swap_free_space=$(env stat -f -c '%a*%S/1024/1024' $swap_part | bc) + make_swap() { - local swap_size=512 # MiBs - 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=-3 - - if [ -n "$swap_free_space" ]; then - if [ ! -f "$swap_path" ]; then - if [ $swap_free_space -ge $swap_size ]; then - echo "dd if=/dev/zero of=$swap_path ..." - if dd if=/dev/zero of=$swap_path bs=1M count=512; then - chmod 0600 $swap_path - if mkswap "$swap_path"; then - if swapon --verbose --priority $swap_priority "$swap_path"; then - echo "swap created and added succesfully" - else - echo "swapon $swap_path failed" - fi - fi + if [ $swap_free_space -ge $swap_size ]; then + echo "allocating file for swap ..." + if dd if=/dev/zero of=$swap_path bs=1M count=$swap_size; then + chmod 0600 $swap_path + if mkswap "$swap_path"; then + if swapon --verbose --priority $swap_priority "$swap_path"; then + echo "swap added succesfully" else - echo "dd if=/dev/zero of=$swap_path failed" + echo "swapon $swap_path failed" fi else - echo "Unable to make swap file. swap_free_space==$swap_free_space < $swap_size" + echo "mkswap $swap_path failed" fi else - echo "$swap_path already exist. Unable to make swap file" - if swapon --verbose --priority $swap_priority "$swap_path"; then - echo "swap added succesfully" - else - echo "swapon $swap_path failed" - fi + echo "allocate file $swap_path with $swap_size MB size failed." fi + fi +} + +enable_swap() +{ + local swap_size_bytes=$(env echo $swap_size*1024*1024 | bc) + if [ stat -c "%s" "/mnt/data/swapfile" -lt $swap_size_bytes ]; then + make_swap + elif swapon --verbose --priority $swap_priority "$swap_path"; then + echo "swap added succesfully" else - echo "swap_free_space is empty. Unable to make swap file" + echo "swapon $swap_path failed" fi } + + make_swap_axg() { - if grep -Eq "^GXL.+S905W" /sys/devices/soc0/soc_id; then + if [ -f "$swap_path" ]; then + echo "Swap file exist. Check and enable swap." + enable_swap + elif grep -Eq "^GXL.+S905W" /sys/devices/soc0/soc_id; then echo "Amlogic S905W detected. Skip swap file creation" elif grep -Eq "^AXG" /sys/devices/soc0/soc_id; then echo "Amlogic AXG detected" diff --git a/buildroot-external/package/rtl8822cs/rtl8822cs.mk b/buildroot-external/package/rtl8822cs/rtl8822cs.mk index 346dbe55e2a..4285ace77e1 100644 --- a/buildroot-external/package/rtl8822cs/rtl8822cs.mk +++ b/buildroot-external/package/rtl8822cs/rtl8822cs.mk @@ -4,7 +4,7 @@ # ################################################################################ -RTL8822CS_VERSION = 65af8fc4a72aa6ebcb02fbe3a5ea6f6886eeaebe +RTL8822CS_VERSION = 010b40a050bbf9164c914169e79d506888839e98 RTL8822CS_SITE = $(call github,adeepn,rtl88x2cs,$(RTL8822CS_VERSION)) RTL8822CS_LICENSE = Unknown #RTL8822CS_LICENSE_FILES = COPYING