凌云实验室IGKBoard开发板的Yocto meta-layer文件
guowenxue
2023-07-26 4b162b1af1ddc50e8db330e0271af61274f7072f
Update packagegroup-misc-utils to add pinctrl

Signed-off-by: guowenxue <guowenxue@gmail.com>
3 files modified
1 files deleted
3 files added
1 files renamed
229 ■■■■■ changed files
recipes-misc/expand-rootfs/expand-rootfs_1.0.bb 15 ●●●●● patch | view | raw | blame | history
recipes-misc/expand-tools/expand-tools_1.0.bb 21 ●●●●● patch | view | raw | blame | history
recipes-misc/expand-tools/files/expand_rootfs patch | view | raw | blame | history
recipes-misc/expand-tools/files/pinctrl-igkboard-6ull 143 ●●●●● patch | view | raw | blame | history
recipes-misc/expand-tools/files/pinloop 42 ●●●●● patch | view | raw | blame | history
recipes-misc/packagegroups/packagegroup-misc-utils.bb 2 ●●● patch | view | raw | blame | history
recipes-misc/sshswitch/sshswitch_1.0.bb 2 ●●● patch | view | raw | blame | history
recipes-misc/wpa-conf/wpa-conf_1.0.bb 4 ●●●● patch | view | raw | blame | history
recipes-misc/expand-rootfs/expand-rootfs_1.0.bb
File was deleted
recipes-misc/expand-tools/expand-tools_1.0.bb
New file
@@ -0,0 +1,21 @@
DESCRIPTION = "Expand rootfs space on MMC"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
FILES:${PN} = "${sbindir}"
SRC_URI = " \
        file://expand_rootfs \
        file://pinloop \
        file://pinctrl-${MACHINE} \
"
do_install() {
    install -d ${D}/${sbindir}/
    install -m 0755 ${WORKDIR}/expand_rootfs      ${D}/${sbindir}/
    install -m 0755 ${WORKDIR}/pinloop            ${D}/${sbindir}/
    install -m 0755 ${WORKDIR}/pinctrl-${MACHINE} ${D}/${sbindir}/pinctrl
}
RDEPENDS:expand-tools = "bash e2fsprogs util-linux"
recipes-misc/expand-tools/files/expand_rootfs
old mode 100644 new mode 100755
recipes-misc/expand-tools/files/pinctrl-igkboard-6ull
New file
@@ -0,0 +1,143 @@
# This shell script used to control GPIO port on IGKBoard
direction=out
sysdir=/sys/class/gpio/
pinbase=0
groupin=32
pinnum=
pindir=
action=
set -u
# RedLed: GPIO01_IO11  GreenLed: GPIO01_IO10 BlueLed: GPIO05_IO09
function usage()
{
   echo "Show pinmap Usage: $0 [-v]"
   echo "Output set  Usage: $0 GPIO01_IO11 [1/0]"
   echo "Input read  Usage: $0 [-i] GPIO01_IO11"
   echo "Unexport    Usage: $0 [-u] GPIO01_IO11"
   exit;
}
function show_pinmap()
{
   echo "
+-------------+-------------+---IGKBoard---+-------------+-------------+
|    GPIO     |     Name    |   Physical  |     Name    |    GPIO     |
+-------------+-------------+-----++------+-------------+-------------+
|     3.3v    |     3.3v    |   1 ||  2   |     5v      |     5v      |
|  GPIO1_IO03 |   I2C1_SDA  |   3 ||  4   |     5v      |     5v      |
|  GPIO1_IO02 |   I2C1_SCL  |   5 ||  6   |     GND     |     GND     |
|  GPIO1_IO18 |      W1     |   7 ||  8   |  UART2_TX   |  GPIO1_IO20 |
|     GND     |     GND     |   9 ||  10  |  UART2_RX   |  GPIO1_IO21 |
|  GPIO1_IO24 |   UART3_TX  |  11 ||  12  |  UART3_RX   |  GPIO1_IO25 |
|  GPIO1_IO28 |   UART4_TX  |  13 ||  14  |     GND     |     GND     |
|  GPIO1_IO29 |   UART4_RX  |  15 ||  16  |  UART7_TX   |  GPIO3_IO21 |
|     3.3v    |     3.3v    |  17 ||  18  |  UART7_RX   |  GPIO3_IO22 |
|  GPIO3_IO27 |   SPI1_MOSI |  19 ||  20  |     GND     |     GND     |
|  GPIO3_IO28 |   SPI1_MISO |  21 ||  22  |     GPIO    |  GPIO3_IO23 |
|  GPIO3_IO25 |   SPI1_SCLK |  23 ||  24  |  SPI1_SS0   |  GPIO3_IO26 |
|     GND     |     GND     |  25 ||  26  |     GPIO    |  GPIO3_IO24 |
|  GPIO1_IO26 |   CAN1_TX   |  27 ||  28  |     PWM8    |  GPIO1_IO15 |
|  GPIO1_IO27 |   CAN1_RX   |  29 ||  30  |     GND     |     GND     |
|  GPIO1_IO22 |   CAN2_TX   |  31 ||  32  |     PWM7    |  GPIO1_IO14 |
|  GPIO1_IO23 |   CAN2_RX   |  33 ||  34  |     GND     |     GND     |
|  GPIO5_IO01 |     GPIO    |  35 ||  36  |     GPIO    |  GPIO1_IO11 |
|  GPIO5_IO08 |     GPIO    |  37 ||  38  |     GPIO    |  GPIO1_IO10 |
|     GND     |     GND     |  39 ||  40  |     GPIO    |  GPIO5_IO09 |
+-------------+-------------+---IGKBoard--+-------------+-------------+
|    GPIO     |     Name    |   Physical  |     Name    |    GPIO     |
+-------------+-------------+-----++------+-------------+-------------+
"
   exit 0;
}
function calc_pinum()
{
   pinstr=$1
   group=`echo $pinstr | cut -d_ -f1 | tr -cd "[0-9]"`
   pin=`echo $pinstr | cut -d_ -f2 | tr -cd "[0-9]"`
   group=`expr $group \- 1`
   pinum=`expr $group \* $groupin + $pin + $pinbase`
   pindir=$sysdir/gpio$pinum
   #echo "INFO: GPIO $pinstr map to pinum[$pinum]"
}
function export_gpio()
{
    if [ -e $pindir ] ; then
       return ;
    fi
    echo $pinum > $sysdir/export
}
function unexport_gpio()
{
    if [ ! -e $pindir ] ; then
       return ;
    fi
    echo $pinum > $sysdir/unexport
}
function set_gpio()
{
    echo out > $pindir/direction
    echo $1 > $pindir/value
}
function read_gpio()
{
    echo in > $pindir/direction
    cat $pindir/value
}
if [[ $# -lt 1 ]] ; then
   usage;
fi
while getopts "iuvh" OPTNAME
do
    case "${OPTNAME}" in
        "i")
           direction=in
           shift
           ;;
        "u")
           action=unexport;
           shift
           ;;
        "v")
           show_pinmap;
           shift
           ;;
        "h")
           usage;
           ;;
    esac
done
calc_pinum $1
if [[ $action == unexport ]] ; then
   unexport_gpio
   exit;
fi
export_gpio
if [[ $direction == in ]] ; then
   read_gpio
else
   set_gpio $2
fi
recipes-misc/expand-tools/files/pinloop
New file
@@ -0,0 +1,42 @@
#!/bin/sh
# 40 Pin Header GPIO loop test script, it based on pinctrl shell script
function loop_test()
{
   if [[ $# != 3 ]] ; then
      echo "ERROR: Invalid input arguments"
      return 1;
   fi
   level=$3
   pinctrl $1 $level
   res=`pinctrl -i $2`
   printf "$1 out [$level] --> $2 in [$res] : "
   if [[ $level == $res ]]  ; then
      printf " [  OK  ]\n"
   else
      printf " [ FAIL ]\n"
      exit 1;
   fi
}
if [[ $# != 2 ]] ; then
   echo ""
   echo "Usage  : $0 Pin1 Pin2"
   echo "Example: $0 GPIO1_IO10 GPIO1_IO11"
   echo ""
   echo "You can check pinmap by 'pinctrl -v' "
   echo ""
   exit;
fi
loop_test $1 $2 1
loop_test $1 $2 0
loop_test $2 $1 1
loop_test $2 $1 0
exit 0;
recipes-misc/packagegroups/packagegroup-misc-utils.bb
@@ -3,4 +3,4 @@
inherit packagegroup
RDEPENDS_${PN} = "expand-rootfs sshswitch wpa-conf"
RDEPENDS:${PN} = "expand-tools sshswitch wpa-conf"
recipes-misc/sshswitch/sshswitch_1.0.bb
@@ -9,7 +9,7 @@
SYSTEMD_SERVICE_${PN} = "sshswitch.service"
SRC_URI += " file://sshswitch.service "
FILES_${PN} += "${systemd_unitdir}/system/sshswitch.service"
FILES:${PN} += "${systemd_unitdir}/system/sshswitch.service"
do_install() {
    install -d ${D}/${systemd_unitdir}/system
recipes-misc/wpa-conf/wpa-conf_1.0.bb
@@ -6,10 +6,10 @@
inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE_${PN} = "wpa-conf.service"
SYSTEMD_SERVICE:${PN} = "wpa-conf.service"
SRC_URI += " file://wpa-conf.service "
FILES_${PN} += "${systemd_unitdir}/system/wpa-conf.service"
FILES:${PN} += "${systemd_unitdir}/system/wpa-conf.service"
do_install() {
    install -d ${D}/${systemd_unitdir}/system