From a7f01b3bc6bb36be7edfc5db62e1ca020b49b0b6 Mon Sep 17 00:00:00 2001
From: Georg Hartinger <georg.hartinger@congatec.com>
Date: Thu, 20 May 2021 16:14:23 +0200
Subject: [PATCH] cgtsmx8: switch to public https git repositories

Signed-off-by: Georg Hartinger <georg.hartinger@congatec.com>
---
 README-congatec                               | 32 +++++++++++++++----
 .../imx-boot-congatec/imx-boot-congatec.bb    |  2 +-
 recipes-bsp/u-boot/u-boot-congatec_2020.04.bb |  2 +-
 recipes-kernel/linux/linux-congatec_5.4.70.bb |  2 +-
 4 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/README-congatec b/README-congatec
index a32b341..3320f0a 100755
--- a/README-congatec
+++ b/README-congatec
@@ -10,7 +10,7 @@ Quickstart for conga-SMX8 build
 ===============================
 
 1. Checkout sources on compatible development machine
-    $ repo init -u git@git.congatec.com:arm-nxp/imx8-family-internal/yocto/manifest-imx8-family.git -b cgtimx8__zeus_5.4.70_2.3.1
+    $ repo init -u git@git.congatec.com:arm-nxp/imx8-family/yocto/manifest-imx8-family.git -b cgtimx8__zeus_5.4.70_2.3.1
     $ repo sync
 
 
@@ -24,17 +24,35 @@ Quickstart for conga-SMX8 build
 
 4. Prepare micro-SD Card
 
-    a) Copy image
+    a) Write image
         Change sdX to your card (eg. sdc)
-        $ bzcat tmp/deploy/images/imx8qm-cgtsmx8/fsl-image-machine-test-imx8qm-cgtsmx8.wic.bz2 | sudo dd of=/dev/sdX bs=1M conv=fsync && sync
+    	$ DISK=/dev/sdX
+	    $ cd tmp/deploy/images/imx8qm-cgtsmx8/
+        $ bzcat fsl-image-machine-test-imx8qm-cgtsmx8.wic.bz2 | sudo dd of=${DISK} bs=1M conv=fsync && sync
 
-    b) Add bootcontainer
-        Get bootcontainer or build it with cgtbcbe (use uboot.bin from deploy folder for booting from sdcard)
-        Write bootcontainer to card
-        $ sudo dd if=flash.bin of=/dev/sdc bs=512 seek=64
 
     c) Resize root partition
         The root partition on u-SD card does exactly fit to the data used
         and does not have any extra space. It could be expanded up to the
         end of the available sdcard space.
         Resize it with eg. parted or a graphical tool like gparted
+        $ sudo parted -s ${DISK} resizepart 2 '100%'
+        $ sudo e2fsck -f ${DISK}2
+        $ sudo resize2fs ${DISK}2
+        $ sync
+        $ sudo fdisk -l | grep ${DISK}
+
+    b) Boot container
+        The image does not contain a bootloader, because the only supported way from congatec
+        to boot up is from onboard SPI flash.
+        A default bootcontainer is also built with yocto image and could be used.
+
+        For normal boot: flash bootcontainer to onboard SPI flash
+        $ uuu -b qspi imx8qm-cgtsmx8_4GB_fspi-yocto.bin
+
+        For recovery boot only: add bootcontainer to u-SD
+        $ sudo dd if=imx8qm-cgtsmx8_4GB_usd-yocto.bin of=/dev/sdc bs=512 seek=64 conv=fsync
+        $ sync
+        To use the bootcontainer on u-SD (for testing purpose) erase
+        the bootcontainer on the SPI-flash.
+
diff --git a/recipes-bsp/imx-boot-congatec/imx-boot-congatec.bb b/recipes-bsp/imx-boot-congatec/imx-boot-congatec.bb
index 0e0509b..ef8ba28 100755
--- a/recipes-bsp/imx-boot-congatec/imx-boot-congatec.bb
+++ b/recipes-bsp/imx-boot-congatec/imx-boot-congatec.bb
@@ -4,7 +4,7 @@ DESCRIPTION = "Generate Boot Container for congatec i.MX 8 device"
 LICENSE = "GPL-2.0"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
-CGTBCBE_SRC ?= "git://git@git.congatec.com/arm-nxp/imx8-family-internal/misc/cgtbcbe.git;protocol=ssh"
+CGTBCBE_SRC ?= "git://git@git.congatec.com/arm-nxp/imx8-family/misc/cgtbcbe.git;protocol=http"
 SRC_BRANCH = "imx8"
 SRC_URI = "${CGTBCBE_SRC};branch=${SRC_BRANCH}"
 SRCREV = "4869aeff55e0bdb3b62edeb2d70fc4ff1342c202"
diff --git a/recipes-bsp/u-boot/u-boot-congatec_2020.04.bb b/recipes-bsp/u-boot/u-boot-congatec_2020.04.bb
index 126fc6e..c725645 100755
--- a/recipes-bsp/u-boot/u-boot-congatec_2020.04.bb
+++ b/recipes-bsp/u-boot/u-boot-congatec_2020.04.bb
@@ -18,7 +18,7 @@ LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a
 SRCBRANCH = "cgtimx8__imx_v2020.04_5.4.70_2.3.0"
 SRCREV = "fe9e545d4ca38a0e3351c099295e6a9fbab86931"
 
-UBOOT_SRC ?= "git://git@git.congatec.com/arm-nxp/imx8-family-internal/uboot-imx8-family.git;protocol=ssh"
+UBOOT_SRC ?= "git://git@git.congatec.com/arm-nxp/imx8-family/uboot-imx8-family.git;protocol=http"
 SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}"
 
 # add memory configuration to defconfig
diff --git a/recipes-kernel/linux/linux-congatec_5.4.70.bb b/recipes-kernel/linux/linux-congatec_5.4.70.bb
index 51314f4..7ee791b 100755
--- a/recipes-kernel/linux/linux-congatec_5.4.70.bb
+++ b/recipes-kernel/linux/linux-congatec_5.4.70.bb
@@ -15,7 +15,7 @@ DEPENDS += "lzop-native bc-native"
 SRCBRANCH = "cgtimx8__imx_5.4.70_2.3.0"
 SRCREV = "1411d140d3269e2535c04844e853265bef418198"
 
-KERNEL_SRC = "git://git@git.congatec.com/arm-nxp/imx8-family-internal/kernel-imx8-family.git;protocol=ssh"
+KERNEL_SRC = "git://git@git.congatec.com/arm-nxp/imx8-family/kernel-imx8-family.git;protocol=http"
 SRC_URI = "${KERNEL_SRC};branch=${SRCBRANCH}"
 
 LOCALVERSION = "-${@'${SRCBRANCH}'.replace('_', '-')}"
-- 
GitLab