ARM64: configs: tizen: Adjust for mipi csi camera of rpi5 77/314977/1 accepted/tizen_unified_toolchain accepted/tizen_unified_x_asan accepted/tizen/unified/20240725.013002 accepted/tizen/unified/dev/20240729.000903 accepted/tizen/unified/toolchain/20240812.131252 accepted/tizen/unified/x/20240725.034505 accepted/tizen/unified/x/asan/20240813.225535
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 24 Jul 2024 04:37:58 +0000 (13:37 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 24 Jul 2024 04:38:31 +0000 (13:38 +0900)
To use mipi csi camera in rpi5, it is required dw i2c for the
rpi5 board. Also, to support mipi csi of rpi5, pisp_be.
Adjust for mipi csi camera of rpi5 and build camera sensors
as module because they are only used when connected.

Change-Id: I9b59b0f3816ba6a7801028162870566e262f23f5
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 files changed:
arch/arm64/configs/tizen_bcm2711_defconfig
arch/arm64/configs/tizen_bcm2711_rt_defconfig
build-rpi4.sh
fs/btrfs/send.c
include/net/bluetooth/hci_core.h
net/bluetooth/hci_event.c
packaging/baselibs.conf
packaging/linux-rpi4.spec
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/util/hist.c
tools/perf/util/metricgroup.c
tools/perf/util/synthetic-events.c

index 9c1631b..d0cfe5c 100644 (file)
@@ -282,6 +282,7 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PINCTRL=y
 CONFIG_I2C_BCM2708=m
 CONFIG_I2C_BCM2835=y
+CONFIG_I2C_DESIGNWARE_PLATFORM=m
 CONFIG_I2C_GPIO=y
 CONFIG_I2C_STUB=m
 CONFIG_SPI=y
@@ -334,9 +335,10 @@ CONFIG_USB_VIDEO_CLASS=y
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_MUX=y
 CONFIG_VIDEO_BCM2835_UNICAM=y
+CONFIG_VIDEO_RASPBERRYPI_PISP_BE=y
 CONFIG_VIDEO_RP1_CFE=y
-CONFIG_VIDEO_IMX219=y
-CONFIG_VIDEO_IMX708=y
+CONFIG_VIDEO_IMX219=m
+CONFIG_VIDEO_IMX708=m
 CONFIG_VIDEO_OV5647=y
 CONFIG_VIDEO_DW9807_VCM=y
 CONFIG_DRM=y
index b6c5da7..0c55508 100644 (file)
@@ -284,6 +284,7 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PINCTRL=y
 CONFIG_I2C_BCM2708=m
 CONFIG_I2C_BCM2835=y
+CONFIG_I2C_DESIGNWARE_PLATFORM=m
 CONFIG_I2C_GPIO=y
 CONFIG_I2C_STUB=m
 CONFIG_SPI=y
@@ -336,9 +337,10 @@ CONFIG_USB_VIDEO_CLASS=y
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_MUX=y
 CONFIG_VIDEO_BCM2835_UNICAM=y
+CONFIG_VIDEO_RASPBERRYPI_PISP_BE=y
 CONFIG_VIDEO_RP1_CFE=y
-CONFIG_VIDEO_IMX219=y
-CONFIG_VIDEO_IMX708=y
+CONFIG_VIDEO_IMX219=m
+CONFIG_VIDEO_IMX708=m
 CONFIG_VIDEO_OV5647=y
 CONFIG_VIDEO_DW9807_VCM=y
 CONFIG_DRM=y
index a453b29..1267e32 100755 (executable)
@@ -72,7 +72,7 @@ function mk_bootimg()
                cp -a arch/arm/boot/dts/broadcom/bcm*.dtb ${TMP_PATH}
        fi
        mkdir -p ${TMP_PATH}/overlays
-       cp -a arch/arm/boot/dts/overlays/*.dtbo ${TMP_PATH}/overlays
+       cp -a arch/arm/boot/dts/overlays/*.dtb* ${TMP_PATH}/overlays
 
        # install u-boot files extracted from u-boot-rpi4 rpm package in download.tizen.org.
        rm -rf ${TMP_UBOOT_PATH}
@@ -82,10 +82,11 @@ function mk_bootimg()
                REPO_URL=http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/standard/packages/aarch64/
        else
                REPO_URL=http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/standard/packages/armv7l/
+               BITS=-32b
        fi
        rm -f index.html*
        wget ${REPO_URL}
-       UBOOT=`awk -F\" '{ print $2 }' index.html | grep u-boot-rpi4`
+       UBOOT=`awk -F\" '{ print $2 }' index.html | grep u-boot-rpi4${BITS}`
        wget ${REPO_URL}${UBOOT}
        unrpm ${UBOOT}
        popd
index db94eef..c367b1f 100644 (file)
@@ -8205,8 +8205,8 @@ long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg)
                goto out;
        }
 
-       sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
-                                    arg->clone_sources_count + 1,
+       sctx->clone_roots = kvcalloc(arg->clone_sources_count + 1,
+                                    sizeof(*sctx->clone_roots),
                                     GFP_KERNEL);
        if (!sctx->clone_roots) {
                ret = -ENOMEM;
index 24de664..d46f1ab 100644 (file)
@@ -716,7 +716,6 @@ struct hci_conn {
        __u8            init_addr_type;
        bdaddr_t        resp_addr;
        __u8            resp_addr_type;
-       __u8            adv_instance;
        __u16           handle;
        __u16           sync_handle;
        __u16           state;
index 452d322..0fdf91a 100644 (file)
@@ -2982,13 +2982,12 @@ static void hci_cs_disconnect(struct hci_dev *hdev, u8 status)
                goto unlock;
 
        if (status) {
+               u8 type = conn->type;
                mgmt_disconnect_failed(hdev, &conn->dst, conn->type,
                                       conn->dst_type, status);
 
-               if (conn->type == LE_LINK && conn->role == HCI_ROLE_SLAVE) {
-                       hdev->cur_adv_instance = conn->adv_instance;
+               if (type == LE_LINK)
                        hci_enable_advertising(hdev);
-               }
 
                /* Inform sockets conn is gone before we delete it */
                hci_disconn_cfm(conn, HCI_ERROR_UNSPECIFIED);
@@ -3614,6 +3613,7 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,
        struct hci_conn_params *params;
        struct hci_conn *conn;
        bool mgmt_connected;
+       u8 type;
 
        bt_dev_dbg(hdev, "status 0x%2.2x", ev->status);
 
@@ -3667,8 +3667,10 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,
                        break;
                }
        }
+       type = conn->type;
 
        hci_disconn_cfm(conn, ev->reason);
+       hci_conn_del(conn);
 
        /* Re-enable advertising if necessary, since it might
         * have been disabled by the connection. From the
@@ -3680,12 +3682,10 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,
         * or until a connection is created or until the Advertising
         * is timed out due to Directed Advertising."
         */
-       if (conn->type == LE_LINK && conn->role == HCI_ROLE_SLAVE) {
-               hdev->cur_adv_instance = conn->adv_instance;
+
+       if (type == LE_LINK)
                hci_enable_advertising(hdev);
-       }
 
-       hci_conn_del(conn);
 
 #ifdef TIZEN_BT
        if (conn->type == ACL_LINK && !hci_conn_num(hdev, ACL_LINK)) {
@@ -6256,13 +6256,6 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
        conn->sec_level = BT_SECURITY_LOW;
        conn->state = BT_CONFIG;
 
-       /* Store current advertising instance as connection advertising instance
-        * when sotfware rotation is in use so it can be re-enabled when
-        * disconnected.
-        */
-       if (!ext_adv_capable(hdev))
-               conn->adv_instance = hdev->cur_adv_instance;
-
        conn->le_conn_interval = interval;
        conn->le_conn_latency = latency;
        conn->le_supv_timeout = supervision_timeout;
@@ -6343,7 +6336,7 @@ static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, void *data,
 {
        struct hci_evt_le_ext_adv_set_term *ev = data;
        struct hci_conn *conn;
-       struct adv_info *adv, *n;
+       struct adv_info *n;
 
        bt_dev_dbg(hdev, "status 0x%2.2x", ev->status);
 
@@ -6361,9 +6354,10 @@ static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, void *data,
 
        hci_dev_lock(hdev);
 
-       adv = hci_find_adv_instance(hdev, ev->handle);
 
        if (ev->status) {
+               struct adv_info *adv;
+               adv = hci_find_adv_instance(hdev, ev->handle);
                if (!adv)
                        goto unlock;
 
@@ -6381,15 +6375,9 @@ static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, void *data,
                goto unlock;
        }
 
-       if (adv)
-               adv->enabled = false;
-
        conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->conn_handle));
        if (conn) {
-               /* Store handle in the connection so the correct advertising
-                * instance can be re-enabled when disconnected.
-                */
-               conn->adv_instance = ev->handle;
+               struct adv_info *adv_instance;
 
                if (hdev->adv_addr_type != ADDR_LE_DEV_RANDOM ||
                    bacmp(&conn->resp_addr, BDADDR_ANY))
@@ -6400,8 +6388,9 @@ static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, void *data,
                        goto unlock;
                }
 
-               if (adv)
-                       bacpy(&conn->resp_addr, &adv->random_addr);
+               adv_instance = hci_find_adv_instance(hdev, ev->handle);
+               if (adv_instance)
+                       bacpy(&conn->resp_addr, &adv_instance->random_addr);
        }
 
 unlock:
index 7f71347..f828103 100644 (file)
@@ -1,14 +1,26 @@
 arch aarch64 targets armv7l:aarch64 armv7hl:aarch64
 
+prefix /.linux-rpi
+
 arm64-rpi4-linux-kernel
+  post "cp -a  /.linux-rpi/boot/* /boot/"
+  post "cp -a  /.linux-rpi/usr/share/licenses/* /usr/share/licenses/"
+  post "rm -rf /.linux-rpi"
   +/
 
 arm64-rpi4-linux-kernel-modules
+  post "cp -a  /.linux-rpi/lib/modules/* /lib/modules/"
+  post "rm -rf /.linux-rpi"
   +/
 
 arm64-rpi4-rt-linux-kernel
-  post "mv /boot/Image_rt /boot/Image"
+  post "cp -a  /.linux-rpi/boot/* /boot/"
+  post "cp -a  /.linux-rpi/usr/share/licenses/* /usr/share/licenses/"
+  post "rm -rf /.linux-rpi"
+  post "mv     /boot/Image_rt /boot/Image"
   +/
 
 arm64-rpi4-rt-linux-kernel-modules
+  post "cp -a  /.linux-rpi/lib/modules/* /lib/modules/"
+  post "rm -rf /.linux-rpi"
   +/
index edc8a01..93430b1 100644 (file)
@@ -191,7 +191,7 @@ install -m 644 rpi4/boot/fixup*.dat %{buildroot}/boot/
 # Install kernel DTB
 install -m 644 build/%{variant}/arch/%{buildarch}/boot/dts/broadcom/bcm*.dtb %{buildroot}/boot/
 mkdir -p %{buildroot}/boot/overlays
-install -m 644 build/%{variant}/arch/%{buildarch}/boot/dts/overlays/*.dtbo %{buildroot}/boot/overlays/
+install -m 644 build/%{variant}/arch/%{buildarch}/boot/dts/overlays/*.dtb* %{buildroot}/boot/overlays/
 
 # Install kernel headers
 make O=build/%{variant} headers_install %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr
@@ -300,7 +300,7 @@ mv /boot/zImage /boot/zImage_rt
 /boot/zImage
 %endif
 /boot/bcm*.dtb
-/boot/overlays/*.dtbo
+/boot/overlays/*.dtb*
 /boot/config.txt
 /boot/LICENCE.broadcom
 /boot/start*.elf
@@ -314,7 +314,7 @@ mv /boot/zImage /boot/zImage_rt
 /boot/zImage_rt
 %endif
 /boot/bcm*.dtb
-/boot/overlays/*.dtbo
+/boot/overlays/*.dtb*
 /boot/config.txt
 /boot/LICENCE.broadcom
 /boot/start*.elf
index 34bb31f..ddb2473 100644 (file)
@@ -4051,8 +4051,8 @@ int cmd_record(int argc, const char **argv)
        }
 
        if (rec->switch_output.num_files) {
-               rec->switch_output.filenames = calloc(sizeof(char *),
-                                                     rec->switch_output.num_files);
+               rec->switch_output.filenames = calloc(rec->switch_output.num_files,
+                                                     sizeof(char *));
                if (!rec->switch_output.filenames) {
                        err = -EINVAL;
                        goto out_opts;
index ea8c7ec..3960c4d 100644 (file)
@@ -357,7 +357,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
 
 static void prompt_integer(int *target, const char *msg)
 {
-       char *buf = malloc(0), *p;
+       char *buf = NULL, *p;
        size_t dummy = 0;
        int tmp;
 
index ac8c0ef..e5405ce 100644 (file)
@@ -491,8 +491,8 @@ static int hist_entry__init(struct hist_entry *he,
        }
 
        if (symbol_conf.res_sample) {
-               he->res_samples = calloc(sizeof(struct res_sample),
-                                       symbol_conf.res_sample);
+               he->res_samples = calloc(symbol_conf.res_sample,
+                                       sizeof(struct res_sample));
                if (!he->res_samples)
                        goto err_srcline;
        }
index bb5faaa..df1595b 100644 (file)
@@ -286,7 +286,7 @@ static int setup_metric_events(const char *pmu, struct hashmap *ids,
        *out_metric_events = NULL;
        ids_size = hashmap__size(ids);
 
-       metric_events = calloc(sizeof(void *), ids_size + 1);
+       metric_events = calloc(ids_size + 1, sizeof(void *));
        if (!metric_events)
                return -ENOMEM;
 
index a0579c7..7577e63 100644 (file)
@@ -1039,11 +1039,11 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
        if (thread_nr > n)
                thread_nr = n;
 
-       synthesize_threads = calloc(sizeof(pthread_t), thread_nr);
+       synthesize_threads = calloc(thread_nr, sizeof(pthread_t));
        if (synthesize_threads == NULL)
                goto free_dirent;
 
-       args = calloc(sizeof(*args), thread_nr);
+       args = calloc(thread_nr, sizeof(*args));
        if (args == NULL)
                goto free_threads;