diff --git a/.gitignore b/.gitignore index e136cb2b113730da4acce6546d27422b107f977c..52c3da8afff85afb8b5fa214404573a82ca32292 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,9 @@ project.refs # Produced by the gnomeos build scripts ostree-gpg/ -ostree-repo/ \ No newline at end of file +ostree-repo/ + +checkout/ +**/*.DS_STORE +logs/ +**/*.img diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 831cf0c31507a1254c928e5ed7a0c76e41c592ca..896ee6685c82312e5825075405707d8715f39456 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,11 +2,11 @@ include: .gitlab-ci/arch.yml variables: GET_SOURCES_ATTEMPTS: 3 - BST_STRICT: '--strict' - BST_TRACK_TAGS: 'false' + BST_STRICT: "--strict" + BST_TRACK_TAGS: "false" BST_NO_PUSH: "bst $BST_STRICT --config .gitlab-ci/buildstream-nopush.conf --log-file logs/build.log --colors" BST: "bst $BST_STRICT --config .gitlab-ci/buildstream.conf --log-file logs/build.log --colors" - FLATPAK_BRANCH: '42' + FLATPAK_BRANCH: "42" OPENQA_HOST: https://openqa.gnome.org OPENQA_NEEDLES_GIT: https://gitlab.gnome.org/gnome/openqa-needles OPENQA_NEEDLES_SHA: master @@ -16,22 +16,22 @@ variables: DOCKER_IMAGE_ID: "cb2f2be871659a4136244ae9ee65c4d8571575b0" stages: -- track -- build -- deploy-config -- deploy -- test -- reports + - track + - build + - deploy-config + - deploy + - test + - reports default: image: "${DOCKER_REGISTRY}/bst16:${DOCKER_IMAGE_ID}" before_script: - # Ensure the log directory exists - - mkdir -p logs + # Ensure the log directory exists + - mkdir -p logs - # Setup certificate for pushing to the cache - - echo "$GITLAB_CAS_PUSH_CERT" > client.crt - - echo "$GITLAB_CAS_PUSH_KEY" > client.key + # Setup certificate for pushing to the cache + - echo "$GITLAB_CAS_PUSH_CERT" > client.crt + - echo "$GITLAB_CAS_PUSH_KEY" > client.key # # Templates shared by multiple jobs @@ -40,78 +40,94 @@ default: .build-template: stage: build needs: - - job: 'track' - optional: true + - job: "track" + optional: true interruptible: true script: - - TARGETS=(core.bst flatpak-runtimes.bst flatpak-platform-extensions.bst flatpak/platform-manifest.bst flatpak/sdk-manifest.bst oci/debug.bst oci/platform.bst oci/sdk.bst) + - TARGETS=(core.bst flatpak-runtimes.bst flatpak-platform-extensions.bst flatpak/platform-manifest.bst flatpak/sdk-manifest.bst oci/debug.bst oci/platform.bst oci/sdk.bst) - - | - case "${ARCH}" in - aarch64) - TARGETS+=(vm/filesystem.bst vm/filesystem-devel.bst) - ;; - x86_64) - TARGETS+=(vm/repo.bst vm/repo-devel.bst) - ;; - esac + - | + case "${ARCH}" in + aarch64) + TARGETS+=(vm/filesystem.bst vm/filesystem-devel.bst) + ;; + x86_64) + TARGETS+=(vm/repo.bst vm/repo-devel.bst) + ;; + esac - - ${BST} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build "${TARGETS[@]}" + - ${BST} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build "${TARGETS[@]}" # Store artifacts so we can inspect build failures artifacts: when: always paths: - - logs - expire_in: '1 week' + - logs + expire_in: "1 week" .manual-image-template: stage: deploy needs: - - job: 'track' - optional: true + - job: "track" + optional: true when: manual allow_failure: true script: - - ${BST_NO_PUSH} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build "${IMAGE}" - - ${BST} -o arch "${ARCH}" checkout --hardlinks "${IMAGE}" image + - ${BST_NO_PUSH} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build "${IMAGE}" + - ${BST} -o arch "${ARCH}" checkout --hardlinks "${IMAGE}" image artifacts: when: always paths: - - image - expire_in: '2 days' + - image + expire_in: "2 days" + +.image-template: + stage: deploy + needs: + - job: "track" + optional: true + when: always + allow_failure: false + script: + - ${BST_NO_PUSH} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build "${IMAGE}" + - ${BST} -o arch "${ARCH}" checkout --hardlinks "${IMAGE}" image + artifacts: + when: always + paths: + - image + expire_in: "2 days" .deploy-rules: rules: - - if: $EMERGENCY || $BST_TRACK_TAGS != "false" - when: never - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME =~ /^gnome-\d\d$/ && $CI_PIPELINE_SOURCE != "schedule" + - if: $EMERGENCY || $BST_TRACK_TAGS != "false" + when: never + - if: $CI_COMMIT_REF_NAME == "master" + - if: $CI_COMMIT_REF_NAME =~ /^gnome-\d\d$/ && $CI_PIPELINE_SOURCE != "schedule" .ostree-template: extends: .deploy-rules stage: deploy script: - - | - export FLAT_MANAGER_SERVER=https://flat-manager-ostree.gnome.org/ - export FLAT_MANAGER_REPO=gnomeos - export REPO_TOKEN=$OSTREE_REPO_TOKEN + - | + export FLAT_MANAGER_SERVER=https://flat-manager-ostree.gnome.org/ + export FLAT_MANAGER_REPO=gnomeos + export REPO_TOKEN=$OSTREE_REPO_TOKEN - - ostree init --repo repo/ --mode archive + - ostree init --repo repo/ --mode archive - - ${BST} -o arch "${ARCH}" pull vm/repo.bst vm/repo-devel.bst + - ${BST} -o arch "${ARCH}" pull vm/repo.bst vm/repo-devel.bst - - | - for element in vm/repo.bst vm/repo-devel.bst; do - ${BST} -o arch "${ARCH}" checkout --hardlinks $element checkout-repo/ - ostree pull-local --repo=repo/ checkout-repo/ - rm -rf checkout-repo/ - done + - | + for element in vm/repo.bst vm/repo-devel.bst; do + ${BST} -o arch "${ARCH}" checkout --hardlinks $element checkout-repo/ + ostree pull-local --repo=repo/ checkout-repo/ + rm -rf checkout-repo/ + done - - BUILD_ID=$(flat-manager-client create $FLAT_MANAGER_SERVER $FLAT_MANAGER_REPO) - - flat-manager-client push --commit --publish --wait $BUILD_ID repo/ $(ostree --repo=repo/ refs) || result=$? - - flat-manager-client purge $BUILD_ID - - exit $result + - BUILD_ID=$(flat-manager-client create $FLAT_MANAGER_SERVER $FLAT_MANAGER_REPO) + - flat-manager-client push --commit --publish --wait $BUILD_ID repo/ $(ostree --repo=repo/ refs) || result=$? + - flat-manager-client purge $BUILD_ID + - exit $result # # "Real" CI jobs @@ -123,103 +139,100 @@ track: interruptible: true timeout: 15m script: - - 'sed -i "s/track-tags: false/track-tags: ${BST_TRACK_TAGS}/" project.conf' - - ${BST} track --deps all core.bst flatpak-runtimes.bst vm/image.bst boards/pinebook-pro/image.bst boards/rock64/image.bst boards/raspberrypi-4/image.bst vm/repo-devel.bst iso/image.bst - - echo $CI_JOB_ID > track-job.id + - 'sed -i "s/track-tags: false/track-tags: ${BST_TRACK_TAGS}/" project.conf' + - ${BST} track --deps all core.bst flatpak-runtimes.bst vm/image.bst boards/pinebook-pro/image.bst boards/rock64/image.bst boards/raspberrypi-4/image.bst vm/repo-devel.bst iso/image.bst + - echo $CI_JOB_ID > track-job.id retry: 2 # only run on branches targeting master rules: - - if: $FLATPAK_BRANCH == 'master' && $CI_MERGE_REQUEST_ID == null + - if: $FLATPAK_BRANCH == 'master' && $CI_MERGE_REQUEST_ID == null artifacts: paths: - - project.refs - - track-job.id - + - project.refs + - track-job.id build-x86_64: extends: - - .build-template - - .x86_64 + - .build-template + - .x86_64 build-i386: extends: - - .build-template - - .i686 + - .build-template + - .i686 build-aarch64: extends: - - .build-template - - .aarch64 - + - .build-template + - .aarch64 generate-deploy-config: extends: - - .arch-indep - - .deploy-rules + - .arch-indep + - .deploy-rules needs: - - job: 'track' - optional: true - - job: 'build-x86_64' - artifacts: false - - job: 'build-i386' - artifacts: false - - job: 'build-aarch64' - artifacts: false + - job: "track" + optional: true + - job: "build-x86_64" + artifacts: false + - job: "build-i386" + artifacts: false + - job: "build-aarch64" + artifacts: false stage: deploy-config script: - - test -f track-job.id && TRACK_JOB_ID=$(cat track-job.id) - - | - case "$FLATPAK_BRANCH" in - master) - FLAT_MANAGER_SERVER=https://flat-manager.gnome.org/ - ENVIRONMENT_NAME=flatpak-nightly - FLAT_MANAGER_REPO=nightly - SUPPORTED_ARCHES="x86_64 i686 aarch64" - ;; - *beta) - FLAT_MANAGER_SERVER=https://hub.flathub.org/ - ENVIRONMENT_NAME=flathub/$FLATPAK_BRANCH - FLAT_MANAGER_REPO=beta - SUPPORTED_ARCHES="x86_64 i686 aarch64" - ;; - *) - FLAT_MANAGER_SERVER=https://hub.flathub.org/ - ENVIRONMENT_NAME=flathub/$FLATPAK_BRANCH - FLAT_MANAGER_REPO=stable - SUPPORTED_ARCHES="x86_64 i686 aarch64" - ;; - esac - - - | - cat > flatpak-variables.yml << END - variables: - BST: '$BST' - TRACK_JOB_ID: '$TRACK_JOB_ID' - FLAT_MANAGER_SERVER: '$FLAT_MANAGER_SERVER' - FLAT_MANAGER_REPO: '$FLAT_MANAGER_REPO' - TARGETS: flatpak-runtimes.bst - TARGETS_nightly: flatpak-platform-extensions.bst - ENVIRONMENT_NAME: '$ENVIRONMENT_NAME' - DOCKER_REGISTRY: '$DOCKER_REGISTRY' - DOCKER_IMAGE_ID: '$DOCKER_IMAGE_ID' - - END - - cat flatpak-variables.yml .gitlab-ci/flat-manager.yml > flatpak-deploy.yml - - - | - for ARCH in $SUPPORTED_ARCHES; do - cat >> flatpak-deploy.yml << END - - flatmgr-$ARCH: - extends: - - .flatmgr-template - - .$ARCH - END - done + - test -f track-job.id && TRACK_JOB_ID=$(cat track-job.id) + - | + case "$FLATPAK_BRANCH" in + master) + FLAT_MANAGER_SERVER=https://flat-manager.gnome.org/ + ENVIRONMENT_NAME=flatpak-nightly + FLAT_MANAGER_REPO=nightly + SUPPORTED_ARCHES="x86_64 i686 aarch64" + ;; + *beta) + FLAT_MANAGER_SERVER=https://hub.flathub.org/ + ENVIRONMENT_NAME=flathub/$FLATPAK_BRANCH + FLAT_MANAGER_REPO=beta + SUPPORTED_ARCHES="x86_64 i686 aarch64" + ;; + *) + FLAT_MANAGER_SERVER=https://hub.flathub.org/ + ENVIRONMENT_NAME=flathub/$FLATPAK_BRANCH + FLAT_MANAGER_REPO=stable + SUPPORTED_ARCHES="x86_64 i686 aarch64" + ;; + esac + + - | + cat > flatpak-variables.yml << END + variables: + BST: '$BST' + TRACK_JOB_ID: '$TRACK_JOB_ID' + FLAT_MANAGER_SERVER: '$FLAT_MANAGER_SERVER' + FLAT_MANAGER_REPO: '$FLAT_MANAGER_REPO' + TARGETS: flatpak-runtimes.bst + TARGETS_nightly: flatpak-platform-extensions.bst + ENVIRONMENT_NAME: '$ENVIRONMENT_NAME' + DOCKER_REGISTRY: '$DOCKER_REGISTRY' + DOCKER_IMAGE_ID: '$DOCKER_IMAGE_ID' + + END + - cat flatpak-variables.yml .gitlab-ci/flat-manager.yml > flatpak-deploy.yml + - | + for ARCH in $SUPPORTED_ARCHES; do + cat >> flatpak-deploy.yml << END + + flatmgr-$ARCH: + extends: + - .flatmgr-template + - .$ARCH + END + done artifacts: paths: - - flatpak-deploy.yml + - flatpak-deploy.yml deploy-flatpak: extends: .deploy-rules @@ -227,199 +240,220 @@ deploy-flatpak: trigger: strategy: depend include: - - artifact: flatpak-deploy.yml - job: generate-deploy-config + - artifact: flatpak-deploy.yml + job: generate-deploy-config vm-image-aarch64: extends: - - .manual-image-template - - .aarch64 + - .manual-image-template + - .aarch64 needs: - - job: 'track' - optional: true - - job: 'build-aarch64' - artifacts: false + - job: "track" + optional: true + - job: "build-aarch64" + artifacts: false variables: IMAGE: vm/image.bst vm-image-x86_64: extends: - - .manual-image-template - - .x86_64 + - .manual-image-template + - .x86_64 needs: - - job: 'track' - optional: true - - job: 'build-x86_64' - artifacts: false + - job: "track" + optional: true + - job: "build-x86_64" + artifacts: false variables: IMAGE: vm/image.bst pinebook-pro-image: extends: - - .manual-image-template - - .aarch64 + - .manual-image-template + - .aarch64 needs: - - job: 'track' - optional: true - - job: 'build-aarch64' - artifacts: false + - job: "track" + optional: true + - job: "build-aarch64" + artifacts: false variables: IMAGE: boards/pinebook-pro/image.bst +pinephone-image: + extends: + - .image-template + - .aarch64 + needs: + - job: "track" + optional: true + - job: "build-aarch64" + artifacts: false + variables: + IMAGE: boards/pinephone/image.bst + +pinephone-pro-image: + extends: + - .image-template + - .aarch64 + needs: + - job: "track" + optional: true + - job: "build-aarch64" + artifacts: false + variables: + IMAGE: boards/pinephone-pro/image.bst + rock64-image: extends: - - .manual-image-template - - .aarch64 + - .manual-image-template + - .aarch64 needs: - - job: 'track' - optional: true - - job: 'build-aarch64' - artifacts: false + - job: "track" + optional: true + - job: "build-aarch64" + artifacts: false variables: IMAGE: boards/rock64/image.bst raspberrypi-4-image: extends: - - .manual-image-template - - .aarch64 + - .manual-image-template + - .aarch64 needs: - - job: 'track' - optional: true - - job: 'build-aarch64' - artifacts: false + - job: "track" + optional: true + - job: "build-aarch64" + artifacts: false variables: IMAGE: boards/raspberrypi-4/image.bst iso-installer-x86_64: extends: - - .manual-image-template - - .x86_64 + - .manual-image-template + - .x86_64 variables: IMAGE: iso/image.bst needs: - - job: 'track' - optional: true - - job: 'build-x86_64' - artifacts: false + - job: "track" + optional: true + - job: "build-x86_64" + artifacts: false s3-image: extends: .x86_64 stage: deploy needs: - - job: 'track' - optional: true - - job: 'build-x86_64' - artifacts: false + - job: "track" + optional: true + - job: "build-x86_64" + artifacts: false script: - - ${BST_NO_PUSH} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build vm/image.bst iso/image.bst - - ${BST} -o arch "${ARCH}" checkout --hardlinks vm/image.bst image - - ${BST} -o arch "${ARCH}" checkout --hardlinks iso/image.bst iso - - - | - if [ -n "$CI_COMMIT_TAG" ]; then - aws s3 cp --acl public-read iso/installer.iso \ - s3://gnome-build-meta/tag/$CI_COMMIT_TAG/gnome_os_installer_$CI_COMMIT_TAG.iso - else - aws s3 cp --acl public-read image/disk.img.xz \ - s3://gnome-build-meta/nightly/$CI_PIPELINE_ID/disk_$CI_PIPELINE_ID.img.xz - aws s3 cp --acl public-read iso/installer.iso \ - s3://gnome-build-meta/nightly/$CI_PIPELINE_ID/gnome_os_installer_$CI_PIPELINE_ID.iso - fi - - - aws s3 ls --recursive --human-readable s3://gnome-build-meta/ + - ${BST_NO_PUSH} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build vm/image.bst iso/image.bst + - ${BST} -o arch "${ARCH}" checkout --hardlinks vm/image.bst image + - ${BST} -o arch "${ARCH}" checkout --hardlinks iso/image.bst iso + + - | + if [ -n "$CI_COMMIT_TAG" ]; then + aws s3 cp --acl public-read iso/installer.iso \ + s3://gnome-build-meta/tag/$CI_COMMIT_TAG/gnome_os_installer_$CI_COMMIT_TAG.iso + else + aws s3 cp --acl public-read image/disk.img.xz \ + s3://gnome-build-meta/nightly/$CI_PIPELINE_ID/disk_$CI_PIPELINE_ID.img.xz + aws s3 cp --acl public-read iso/installer.iso \ + s3://gnome-build-meta/nightly/$CI_PIPELINE_ID/gnome_os_installer_$CI_PIPELINE_ID.iso + fi + + - aws s3 ls --recursive --human-readable s3://gnome-build-meta/ rules: - - if: $EMERGENCY || $BST_TRACK_TAGS != "false" - when: never - - if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_COMMIT_TAG + - if: $EMERGENCY || $BST_TRACK_TAGS != "false" + when: never + - if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_TAG openh264-x86_64: extends: - - .x86_64 + - .x86_64 stage: deploy needs: [] allow_failure: true rules: - - if: $EMERGENCY || $BST_TRACK_TAGS != "false" - when: never - - if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" - when: manual + - if: $EMERGENCY || $BST_TRACK_TAGS != "false" + when: never + - if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" + when: manual script: - - git clone https://gitlab.com/freedesktop-sdk/openh264-extension.git - - cd openh264-extension - - bst build flatpak-repo.bst - - bst checkout flatpak-repo.bst repo - - BUILD_ID=$(flat-manager-client create https://nightly.gnome.org/ nightly) - - flat-manager-client push --commit --publish --wait $BUILD_ID repo/ $(ostree --repo=repo/ refs) || result=$? - - flat-manager-client purge $BUILD_ID - - exit $result - + - git clone https://gitlab.com/freedesktop-sdk/openh264-extension.git + - cd openh264-extension + - bst build flatpak-repo.bst + - bst checkout flatpak-repo.bst repo + - BUILD_ID=$(flat-manager-client create https://nightly.gnome.org/ nightly) + - flat-manager-client push --commit --publish --wait $BUILD_ID repo/ $(ostree --repo=repo/ refs) || result=$? + - flat-manager-client purge $BUILD_ID + - exit $result s3-image-static: extends: .arch-indep stage: reports needs: - - job: s3-image - artifacts: false + - job: s3-image + artifacts: false allow_failure: true rules: - - if: $EMERGENCY || $BST_TRACK_TAGS != "false" - when: never - - if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" - when: manual + - if: $EMERGENCY || $BST_TRACK_TAGS != "false" + when: never + - if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" + when: manual script: - - | - echo nightly/$CI_PIPELINE_ID/gnome_os_installer_$CI_PIPELINE_ID.iso > latest-iso - echo nightly/$CI_PIPELINE_ID/disk_$CI_PIPELINE_ID.img.xz > latest-disk - - | - aws s3 cp --acl public-read latest-iso s3://gnome-build-meta/latest-iso - aws s3 cp --acl public-read latest-disk s3://gnome-build-meta/latest-disk + - | + echo nightly/$CI_PIPELINE_ID/gnome_os_installer_$CI_PIPELINE_ID.iso > latest-iso + echo nightly/$CI_PIPELINE_ID/disk_$CI_PIPELINE_ID.img.xz > latest-disk + - | + aws s3 cp --acl public-read latest-iso s3://gnome-build-meta/latest-iso + aws s3 cp --acl public-read latest-disk s3://gnome-build-meta/latest-disk - - aws s3 ls --recursive --human-readable s3://gnome-build-meta/ + - aws s3 ls --recursive --human-readable s3://gnome-build-meta/ ostree-x86_64: extends: - - .ostree-template - - .x86_64 + - .ostree-template + - .x86_64 needs: - - job: 'track' - optional: true - - job: 'build-x86_64' - artifacts: false - + - job: "track" + optional: true + - job: "build-x86_64" + artifacts: false cve_report: extends: .x86_64 - stage: 'deploy' + stage: "deploy" needs: - - job: 'track' - optional: true - - job: 'build-x86_64' - artifacts: false + - job: "track" + optional: true + - job: "build-x86_64" + artifacts: false script: - - ${BST} pull flatpak/platform-manifest.bst flatpak/sdk-manifest.bst + - ${BST} pull flatpak/platform-manifest.bst flatpak/sdk-manifest.bst - - ${BST} checkout flatpak/platform-manifest.bst platform-manifest/ - - ${BST} checkout flatpak/sdk-manifest.bst sdk-manifest/ + - ${BST} checkout flatpak/platform-manifest.bst platform-manifest/ + - ${BST} checkout flatpak/sdk-manifest.bst sdk-manifest/ - - mkdir -p cve - - cd cve - - ../utils/update-local-cve-database.py + - mkdir -p cve + - cd cve + - ../utils/update-local-cve-database.py - - mkdir -p ../cve-reports - - ../utils/generate-cve-report.py ../sdk-manifest/usr/manifest.json ../cve-reports/sdk.html - - ../utils/generate-cve-report.py ../platform-manifest/usr/manifest.json ../cve-reports/platform.html + - mkdir -p ../cve-reports + - ../utils/generate-cve-report.py ../sdk-manifest/usr/manifest.json ../cve-reports/sdk.html + - ../utils/generate-cve-report.py ../platform-manifest/usr/manifest.json ../cve-reports/platform.html cache: key: cve paths: - - cve + - cve artifacts: paths: - - cve-reports + - cve-reports rules: - - if: $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^gnome-\d\d$/ - + - if: $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^gnome-\d\d$/ test-iso-installer-x86_64: stage: test @@ -433,57 +467,118 @@ test-iso-installer-x86_64: CI: 1 OPENQA_TEST_TIMEOUT_SCALE_CI: 4 needs: - - job: 'iso-installer-x86_64' - artifacts: true + - job: "iso-installer-x86_64" + artifacts: true script: - - | - mkdir -p /data/factory/iso/ - ln -s $(pwd)/image/installer.iso /data/factory/iso/installer.iso - - | - rm /etc/openqa/* - cat >/etc/openqa/client.conf < /tmp/machine_id - /run_openqa_worker.sh &> worker.log & - - | - openqa/utils/start_job.sh ${worker_class} master > /tmp/job_id - echo "Test job has been started, visit $OPENQA_HOST/tests/$(cat /tmp/job_id) to see the progress" - - openqa/utils/wait_for_job.sh $(cat /tmp/job_id) > /tmp/exit_code - - exit $(cat /tmp/exit_code) + - | + mkdir -p /data/factory/iso/ + ln -s $(pwd)/image/installer.iso /data/factory/iso/installer.iso + - | + rm /etc/openqa/* + cat >/etc/openqa/client.conf < /tmp/machine_id + /run_openqa_worker.sh &> worker.log & + - | + openqa/utils/start_job.sh ${worker_class} master > /tmp/job_id + echo "Test job has been started, visit $OPENQA_HOST/tests/$(cat /tmp/job_id) to see the progress" + - openqa/utils/wait_for_job.sh $(cat /tmp/job_id) > /tmp/exit_code + - exit $(cat /tmp/exit_code) after_script: - - | - if [ -e /tmp/machine_id ]; then - echo "Cleaning up worker" - openqa/utils/teardown_worker.sh $(cat /tmp/machine_id) - rm /tmp/machine_id - fi - - if [ ! -e /tmp/exit_code ]; then echo "Job creation failed, log below." cat openqa.log - - fi + - | + if [ -e /tmp/machine_id ]; then + echo "Cleaning up worker" + openqa/utils/teardown_worker.sh $(cat /tmp/machine_id) + rm /tmp/machine_id + fi + - if [ ! -e /tmp/exit_code ]; then echo "Job creation failed, log below." cat openqa.log + - fi artifacts: when: always paths: - - openqa.log - - worker.log - expire_in: '1 week' + - openqa.log + - worker.log + expire_in: "1 week" + tags: + - x86_64 + - gnome-build-meta + +test-pinephone-aarch64: + image: ubuntu:latest + stage: test + when: always + variables: + IMAGE: boards/pinephone/image.bst + needs: + - job: "pinephone-image" + artifacts: true + before_script: + - export DEBIAN_FRONTEND=noninteractive + - apt update -y + - apt install software-properties-common -y + - add-apt-repository ppa:deadsnakes/ppa + - apt update + - apt install python3.8 -yqq + - python3 --version + - apt-get install qemu-system-arm expect wget -y + - wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.img.gz + - gunzip QEMU_EFI.img.gz + - qemu-img create -f qcow2 debian.img 32G + - qemu-img create -f qcow2 varstore.img 64M + - mv $(pwd)/image/disk.img.xz ./disk.img.xz + - unxz -T$(nproc) disk.img.xz + - chmod +x utils/test_pinephone_image.py + script: + - python3 utils/test_pinephone_image.py tags: - - x86_64 - - gnome-build-meta + - aarch64 + - gnome-build-meta +test-pinephone-pro-aarch64: + image: ubuntu:latest + stage: test + when: always + variables: + IMAGE: boards/pinephone-pro/image.bst + needs: + - job: "pinephone-pro-image" + artifacts: true + before_script: + - export DEBIAN_FRONTEND=noninteractive + - apt update -y + - apt install software-properties-common -y + - add-apt-repository ppa:deadsnakes/ppa + - apt update + - apt install python3.8 -yqq + - python3 --version + - apt-get install qemu-system-arm expect wget -y + - wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.img.gz + - gunzip QEMU_EFI.img.gz + - qemu-img create -f qcow2 debian.img 32G + - qemu-img create -f qcow2 varstore.img 64M + - mv $(pwd)/image/disk.img.xz ./disk.img.xz + - unxz -T$(nproc) disk.img.xz + - chmod +x utils/test_pinephone_pro_image.py + script: + - python3 utils/test_pinephone_pro_image.py + tags: + - aarch64 + - gnome-build-meta pages: - stage: 'reports' + stage: "reports" needs: - - job: 'cve_report' - artifacts: true + - job: "cve_report" + artifacts: true script: - - 'mv cve-reports/ public/' + - "mv cve-reports/ public/" artifacts: paths: - - 'public' + - "public" rules: - - if: $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^gnome-\d\d$/ + - if: $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^gnome-\d\d$/ diff --git a/elements/boards/common/arm-none-eabi-binutils.bst b/elements/boards/common/arm-none-eabi-binutils.bst index 1b436c193b79f42858fd3fbc4a6414be6f7de4fd..a28eeaad5f05342cc280dbed9ff8318a8b734f70 100644 --- a/elements/boards/common/arm-none-eabi-binutils.bst +++ b/elements/boards/common/arm-none-eabi-binutils.bst @@ -3,7 +3,8 @@ kind: autotools sources: - kind: tar url: ftp_gnu_org:binutils/binutils-2.32.tar.xz - + ref: 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04 + depends: - freedesktop-sdk.bst:bootstrap-import.bst diff --git a/elements/boards/common/arm-none-eabi-gcc.bst b/elements/boards/common/arm-none-eabi-gcc.bst index 70f7d2987861c4e94512d31659ccc27d27546155..994643baf14bfb7b28576bb6293e4641ebad4159 100644 --- a/elements/boards/common/arm-none-eabi-gcc.bst +++ b/elements/boards/common/arm-none-eabi-gcc.bst @@ -3,16 +3,20 @@ kind: autotools sources: - kind: tar url: ftp_gnu_org:gcc/gcc-9.2.0/gcc-9.2.0.tar.xz + ref: ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206 - kind: tar url: ftp_gnu_org:gmp/gmp-6.1.2.tar.xz directory: gmp + ref: 87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912 - kind: tar url: ftp_gnu_org:mpfr/mpfr-4.0.2.tar.xz directory: mpfr + ref: 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a - kind: tar url: ftp_gnu_org:mpc/mpc-1.1.0.tar.gz directory: mpc - + ref: 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e + build-depends: - freedesktop-sdk.bst:components/tar.bst diff --git a/elements/boards/generic/deps.bst b/elements/boards/generic/deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..5d52645c8be47228902e7678448ece101bc6c5bf --- /dev/null +++ b/elements/boards/generic/deps.bst @@ -0,0 +1,26 @@ +kind: stack + +depends: +- vm/wpa-supplicant-config.bst +- vm/NetworkManager-openvpn.bst +- vm/NetworkManager-openconnect.bst +- vm/NetworkManager-fortisslvpn.bst +- vm/NetworkManager-vpnc.bst +- freedesktop-sdk.bst:components/wireless-regdb-bin.bst +- core-deps/ModemManager.bst +- freedesktop-sdk.bst:components/linux-firmware.bst +- core/meta-gnome-core-mobile.bst +- vm/common-deps.bst +- vm/os-release-user.bst +- custom/gsettings/gsettings.bst +- custom/jq/jq.bst +- custom/gnome_tweaks/gnome_tweaks.bst +- custom/gnome_extensions/extension_installer/extension_installer.bst +- custom/utility/removal/removal.bst +- core-deps/feedbackd.bst +- core/calls.bst +- freedesktop-sdk.bst:components/iputils.bst +- custom/atinout.bst +- custom/iw.bst +- freedesktop-sdk.bst:components/usbutils.bst +- custom/eg25-manager.bst \ No newline at end of file diff --git a/elements/boards/generic/initramfs/deps.bst b/elements/boards/generic/initramfs/deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..65752f3d1da7bf6c5434dd30a3e8ac41eead4491 --- /dev/null +++ b/elements/boards/generic/initramfs/deps.bst @@ -0,0 +1,17 @@ +kind: stack + +depends: +- freedesktop-sdk.bst:bootstrap-import.bst +- freedesktop-sdk.bst:components/util-linux.bst +- freedesktop-sdk.bst:components/systemd.bst +- freedesktop-sdk.bst:components/dbus.bst +- freedesktop-sdk.bst:components/dracut.bst +- freedesktop-sdk.bst:components/os-release.bst +- freedesktop-sdk.bst:components/shadow.bst +- freedesktop-sdk.bst:components/tzdata.bst +- freedesktop-sdk.bst:components/pkg-config.bst +- vm/plymouth-gnome-theme.bst +- freedesktop-sdk.bst:components/linux-firmware.bst +- freedesktop-sdk.bst:components/wireless-regdb-bin.bst +- core-deps/libostree.bst +- vm/eos-repartition.bst diff --git a/elements/boards/pinephone-pro/arm-trusted-firmware.bst b/elements/boards/pinephone-pro/arm-trusted-firmware.bst new file mode 100644 index 0000000000000000000000000000000000000000..23407d8f582436e70d25b526df8b9d32b0f5e816 --- /dev/null +++ b/elements/boards/pinephone-pro/arm-trusted-firmware.bst @@ -0,0 +1,27 @@ +kind: manual + +sources: +- kind: git_tag + url: github:ARM-software/arm-trusted-firmware.git + track: v2.7 + ref: v2.7.0-0-g35f4c7295bafeb32c8bcbdfb6a3f2e74a57e732b + +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst +# This is required because at part of the firmware has to be built for +# armv7. freedesktop-sdk.bst:cross-compilers/gcc-arm.bst does not +# seem to be able to compile like needed. +- boards/common/arm-none-eabi-gcc.bst + +variables: + board: pinephone-pro-rk3399 + +environment: + CFLAGS: '-fno-stack-protector' + LDFLAGS: '' + +config: + build-commands: + - make -j$(nproc) PLAT=rk3399 DEBUG=1 all + install-commands: + - install -Dm644 -t "%{install-root}%{indep-libdir}/u-boot/%{board}" build/rk3399/debug/bl31/bl31.elf diff --git a/elements/boards/pinephone-pro/deps.bst b/elements/boards/pinephone-pro/deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..72e9bb8446f0768c7cfdc9dc9efb5979fa29ac49 --- /dev/null +++ b/elements/boards/pinephone-pro/deps.bst @@ -0,0 +1,5 @@ +kind: stack + +depends: +- boards/pinephone-pro/initramfs.bst +- boards/generic/deps.bst \ No newline at end of file diff --git a/elements/boards/pinephone-pro/filesystem.bst b/elements/boards/pinephone-pro/filesystem.bst new file mode 100644 index 0000000000000000000000000000000000000000..a9e559f0a8672122cab435a1cb352b2a1e1e2b43 --- /dev/null +++ b/elements/boards/pinephone-pro/filesystem.bst @@ -0,0 +1,10 @@ +kind: compose + +build-depends: +- boards/pinephone-pro/deps.bst +- boards/pinephone-pro/initramfs.bst + +config: + exclude: + - devel + - debug diff --git a/elements/boards/pinephone-pro/image-deps.bst b/elements/boards/pinephone-pro/image-deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..7746ffb0bd6366ddb6c4ace8cbdaa0cbc72dec34 --- /dev/null +++ b/elements/boards/pinephone-pro/image-deps.bst @@ -0,0 +1,7 @@ +kind: stack + +depends: +- boards/pinephone-pro/u-boot.bst +- core-deps/libostree.bst +- freedesktop-sdk.bst:components/genimage.bst +- freedesktop-sdk.bst:integration/mtab.bst diff --git a/elements/boards/pinephone-pro/image.bst b/elements/boards/pinephone-pro/image.bst new file mode 100644 index 0000000000000000000000000000000000000000..8581e1c85b5aeb0a79b6df2df352b43c43b91fd0 --- /dev/null +++ b/elements/boards/pinephone-pro/image.bst @@ -0,0 +1,126 @@ +kind: script + +build-depends: +- boards/pinephone-pro/image-deps.bst +- boards/pinephone-pro/repo.bst +- boards/pinephone-pro/linux.bst + +variables: + linux-root: B921B045-1DF0-41C3-AF44-4C6F280D3FAE + ostree-branch: gnome-os/aarch64/pinephone-pro + board: pinephone-pro-rk3399 + + sysroot: "/sysroot" + +environment: + OSTREE_REPO: "%{sysroot}/ostree/repo" + XZFLAGS: -T%{max-jobs} + board: pinephone-pro-rk3399 + +environment-nocache: +- XZFLAGS + + +config: + layout: + - element: '' + destination: '/sysroot' + - element: components/genimage.bst + destination: '/' + - element: boards/pinephone-pro/repo.bst + destination: '/source-repo' + - element: boards/pinephone-pro/image-deps.bst + destination: '/' + - element: boards/pinephone-pro/linux.bst + destination: '/kernel' + + commands: + - mkdir -p "${OSTREE_REPO}" + - ostree init --repo="${OSTREE_REPO}" --mode=bare + + - ostree config --group sysroot set bootloader auto + - ostree pull-local "/source-repo" %{ostree-branch} + + - mkdir -p "%{sysroot}/boot" + + - ostree admin init-fs "%{sysroot}" + - ostree admin os-init --sysroot="%{sysroot}" gnome-os + + # U-Boot does not provide EFI variables at runtime. So /dev/gpt-auto-root + # is not available. + - | + ostree admin deploy --os="gnome-os" \ + --sysroot="%{sysroot}" %{ostree-branch} \ + --karg="rw"\ + --karg="root=LABEL=root" --karg="splash" \ + --karg="console=tty0,115200n8" \ + --karg="console=ttyS2,115200n8" \ + --karg="earlycon=tty0,115200n8" \ + --karg="earlycon=ttyS2,115200n8" + + + - | + mkdir -p "%{sysroot}/etc/ostree" + cp -r "%{sysroot}"/ostree/boot.1/gnome-os/*/*/etc/ostree/remotes.d "%{sysroot}/etc/ostree/remotes.d" + + - | + ostree admin set-origin --sysroot="%{sysroot}" \ + --index=0 \ + gnome-os dummy \ + %{ostree-branch} + + - cp -r "%{sysroot}"/ostree/boot.1/gnome-os/*/*/boot/EFI/ "%{sysroot}/boot/" + + - cp -r "/kernel/boot/dtbs" "%{sysroot}/boot/dtb" + + - | + size=$(($(du -s -B 4K "%{sysroot}" | cut -f1)*4+200*1024)) + cat >%{install-root}/genimage.cfg </dev/null + + - | + mkdir -p "%{install-root}/usr/lib/" + cp -r /usr/lib/modules "%{install-root}/usr/lib/" + + - | + version="$(ls -1 /lib/modules | head -n1)" + mkdir -p "%{install-root}/usr/lib/modules/${version}" + dracut -v --fstab \ + --no-machineid \ + --kver "${version}" \ + --add ostree \ + --add plymouth \ + --add eos-repartition \ + --add-drivers "rockchipdrm panfrost panel_simple analogix_dp pwm_bl drm_kms_helper" \ + --install 'fsck.ext4' \ + "%{install-root}/usr/lib/modules/${version}/initramfs" + + - | + version="$(ls -1 /lib/modules | head -n1)" + cp /boot/vmlinuz "%{install-root}/usr/lib/modules/${version}/vmlinuz" + + - dbus-uuidgen >/etc/machine-id + - SYSTEMD_RELAX_ESP_CHECKS=1 bootctl --path='/efi' --no-variables install + - rm /etc/machine-id + + - | + cp -r /efi "%{install-root}/boot" + + - | + cat <"%{install-root}/boot/loader/loader.conf" + timeout 3 + editor yes + console-mode keep + default * + EOF diff --git a/elements/boards/pinephone-pro/initramfs/deps.bst b/elements/boards/pinephone-pro/initramfs/deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..93e60ae4e5622b155aab33a2aec415c304ce28b9 --- /dev/null +++ b/elements/boards/pinephone-pro/initramfs/deps.bst @@ -0,0 +1,5 @@ +kind: stack + +depends: +- boards/generic/initramfs/deps.bst +- boards/pinephone-pro/linux.bst diff --git a/elements/boards/pinephone-pro/initramfs/initial-scripts.bst b/elements/boards/pinephone-pro/initramfs/initial-scripts.bst new file mode 100644 index 0000000000000000000000000000000000000000..ee5294ce02fceaa21aa5064583364c37f1911faa --- /dev/null +++ b/elements/boards/pinephone-pro/initramfs/initial-scripts.bst @@ -0,0 +1,7 @@ +kind: collect_initial_scripts + +build-depends: +- boards/pinephone-pro/initramfs/deps.bst + +config: + path: /etc/fdsdk/initial_scripts diff --git a/elements/boards/pinephone-pro/linux.bst b/elements/boards/pinephone-pro/linux.bst new file mode 100644 index 0000000000000000000000000000000000000000..cfe6af72b674fd1d1a02ba9fc3465f4658ee9ce6 --- /dev/null +++ b/elements/boards/pinephone-pro/linux.bst @@ -0,0 +1,304 @@ +kind: manual + +sources: +- kind: git_tag + url: github:torvalds/linux.git + track: v5.10 + ref: v5.10-0-g2c85ebc57b3e1817b6ce1a6b703928e113a90442 + +- kind: patch + path: files/linux/0262-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch + +- kind: patch + path: files/linux/0449-arm64-dts-rk3399-pinephone-pro-Use-DCLK_VOP-_FRAC-to.patch + +- kind: patch + path: files/linux/0447-arm64-dts-rk3399-pinephone-pro-Use-a-new-rk818-batte.patch + +- kind: patch + path: files/linux/0442-arm64-dts-rk3399-pinephone-pro-Correct-the-battery-s.patch + +- kind: patch + path: files/linux/0441-arm64-dts-rk3399-pinephone-pro-Fix-SD-card-power-sup.patch + +#- kind: patch +# path: files/linux/0451-arm64-dts-rk3399-pinephone-pro-Add-audio-support.patch + +- kind: patch + path: files/linux/0268-arm64-dts-rk3399-pinephone-pro-Power-off-goodix-touc.patch + +- kind: patch + path: files/linux/0444-arm64-dts-rk3399-pinephone-pro-Fix-PDOs-to-be-more-r.patch + +- kind: patch + path: files/linux/0457-arm64-dts-rk3399-pinephone-pro-Add-flash-LED.patch + +- kind: patch + path: files/linux/0454-arm64-dts-rk3399-pinephone-pro-STK3311A-INT-pin-is-o.patch + +- kind: patch + path: files/linux/0263-arm64-dts-rk3399-pinephone-pro-Fix-blue-LED-gpio.patch + +- kind: patch + path: files/linux/0450-arm64-dts-rk3399-pinephone-pro-Add-support-for-power.patch + +#- kind: patch +# path: files/linux/0458-arm64-dts-rk3399-pinephone-pro-improve-sound-device-.patch + +#- kind: patch +# path: files/linux/0453-arm64-dts-rk3399-pinephone-pro-Improve-vcc5v0_typec-.patch + +- kind: patch + path: files/linux/0445-arm64-dts-rk3399-pinephone-pro-Add-chassis-type-hand.patch + +#- kind: patch +# path: files/linux/0455-arm64-dts-rk3399-pinephone-pro-Magnetometer-is-AF813.patch + +- kind: patch + path: files/linux/0266-arm64-dts-rk3399-pinephone-pro-Fix-goodix-toucscreen.patch + +- kind: patch + path: files/linux/0461-arm64-dts-rk3399-pinephone-pro-Enable-Pinephone-Keyb.patch + +#- kind: patch +# path: files/linux/0264-arm64-dts-rk3399-pinephone-pro-Fixup-DT-validation-i.patch + +#- kind: patch +# path: files/linux/0261-arm64-dts-rk3399-Disable-debug-nodes-they-hang-boot.patch + +- kind: patch + path: files/linux/0460-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch + +# Error: arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts:756.35-36 syntax error +# FATAL ERROR: Unable to parse input tree +#- kind: patch +# path: files/linux/0440-arm64-dts-rk3399-pinephone-pro-Add-support-for-both-.patch + +- kind: patch + path: files/linux/0459-arm64-dts-rk3399-pinephone-pro-add-SPI-flash.patch + +- kind: patch + path: files/linux/0456-arm64-dts-rk3399-pinephone-pro-Fix-leds.patch + +- kind: patch + path: files/linux/0265-arm64-dts-rk3399-pinephone-pro-Make-charging-and-per.patch + +- kind: patch + path: files/linux/0443-arm64-dts-rk3399-pinephone-pro-Cleanup-some-USB-node.patch + +#- kind: patch +# path: files/linux/0519-arm64-dts-rk3399-pinephone-pro-Use-4-lane-mode-for-s.patch + +- kind: patch + path: files/linux/0267-arm64-dts-rk3399-pinephone-pro-Correct-the-pmu1830-i.patch + +- kind: patch + path: files/linux/0446-arm64-dts-rk3399-pinephone-pro-Add-mmc-aliases-to-ge.patch + +#- kind: patch +# path: files/linux/0448-arm64-dts-rk3399-pinephone-pro-Full-support-for-Type.patch + +#- kind: patch +# path: files/linux/0452-arm64-dts-rk3399-pinephone-pro-Add-POGO-i2c-bus.patch + +depends: +- freedesktop-sdk.bst:components/kmod.bst + +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst +- freedesktop-sdk.bst:components/bison.bst +- freedesktop-sdk.bst:components/flex.bst +- freedesktop-sdk.bst:components/bc.bst +- freedesktop-sdk.bst:components/gzip.bst +- freedesktop-sdk.bst:components/openssl.bst + +variables: + bootdir: /boot + kernel_arch: arm64 + image-name: arch/arm64/boot/Image + +environment: + ARCH: '%{kernel_arch}' + +config: + configure-commands: + - | + # Generate the default kernel config for the target architecture + make clean defconfig + + - | + # Kernel Config Options + scripts/config -e DEVTMPFS + scripts/config -e CGROUPS + scripts/config -e INOTIFY_USER + scripts/config -e SIGNALFD + scripts/config -e TIMERFD + scripts/config -e EPOLL + scripts/config -e NET + scripts/config -e SYSFS + scripts/config -e PROC_FS + scripts/config -e FHANDLE + + # Kernel crypto/hash API + scripts/config -e CRYPTO_USER_API_HASH + scripts/config -e CRYPTO_HMAC + scripts/config -e CRYPTO_SHA256 + + # udev will fail to work with legacy sysfs + scripts/config -d SYSFS_DEPRECATED + + # Boot is very slow with systemd when legacy PTYs are present + scripts/config -d LEGACY_PTYS + scripts/config -d LEGACY_PTY_COUNT + + # Legacy hotplug confuses udev + scripts/config --set-str UEVENT_HELPER_PATH "" + + # Userspace firmware loading not supported + scripts/config -d FW_LOADER_USER_HELPER + + # Some udev/virtualization requires + scripts/config -e DMIID + + # Support for some SCSI devices serial number retrieval + scripts/config -e BLK_DEV_BSG + + # Required for PrivateNetwork= in service units + scripts/config -e NET_NS + scripts/config -e USER_NS + + # Required for 9p support + # scripts/config -e NET_9P + # scripts/config -e NET_9P_VIRTIO + # scripts/config -e 9P_FS + # scripts/config -e 9P_FS_POSIX_ACL + # scripts/config -e 9P_FS_SECURITY + # scripts/config -e VIRTIO_PCI + + # Strongly Recommended + scripts/config -e IPV6 + scripts/config -e AUTOFS4_FS + scripts/config -e TMPFS_XATTR + scripts/config -e TMPFS_POSIX_ACL + scripts/config -e EXT4_FS_POSIX_ACL + scripts/config -e EXT4_FS_SECURITY + scripts/config -e XFS_POSIX_ACL + scripts/config -e BTRFS_FS_POSIX_ACL + scripts/config -e SECCOMP + scripts/config -e SECCOMP_FILTER + scripts/config -e CHECKPOINT_RESTORE + + # Required for CPUShares= in resource control unit settings + scripts/config -e CGROUP_SCHED + scripts/config -e FAIR_GROUP_SCHED + + # Required for CPUQuota= in resource control unit settings + scripts/config -e CFS_BANDWIDTH + + # Required for IPAddressDeny=, IPAddressAllow= in resource control unit settings + scripts/config -e CGROUP_BPF + + # For UEFI systems + scripts/config -e EFIVAR_FS + scripts/config -e EFI_PARTITION + + # RT group scheduling (effectively) makes RT scheduling unavailable for userspace + scripts/config -d RT_GROUP_SCHED + + # Required for 3D acceleration in qemu + # scripts/config -e CONFIG_DRM_VIRTIO_GPU + + # Required for systemd-nspawn + scripts/config -e DEVPTS_MULTIPLE_INSTANCES + + # Sound with QEMU + # scripts/config -e SND_HDA_GENERIC + + scripts/config -e MMC + scripts/config -m PWRSEQ_SD8787 + scripts/config -e MMC_BLOCK_MINORS=32 + scripts/config -m SDIO_UART + scripts/config -e MMC_SDHCI + scripts/config -e MMC_SDHCI_PCI + scripts/config -e MMC_SDHCI_ACPI + scripts/config -e MMC_SDHCI_PLTFM + scripts/config -e MMC_SDHCI_OF_ARASAN + scripts/config -e MMC_SPI + scripts/config -e MMC_DW + scripts/config -e MMC_DW_PCI + scripts/config -e MMC_DW_ROCKCHIP + + scripts/config -d DRM_LIMA + + scripts/config -e DRM_PANFROST + scripts/config -m DRM_MALI_DISPLAY + scripts/config -m DRM_ANALOGIX_ANX78XX + scripts/config -m DRM_DW_HDMI_CEC + scripts/config -e DRM_LOAD_EDID_FIRMWARE + + scripts/config -m BATTERY_CW2015 + + scripts/config -e FIRMWARE_EDID + + scripts/config -m CRYPTO_DEV_ROCKCHIP + scripts/config -e PCIE_ROCKCHIP_HOST + scripts/config -e PHY_ROCKCHIP_DP + scripts/config -e PHY_ROCKCHIP_INNO_HDMI + scripts/config -e PHY_ROCKCHIP_PCIE + scripts/config -e ROCKCHIP_LVDS + scripts/config -e ROCKCHIP_MBOX + scripts/config -e ROCKCHIP_RGB + scripts/config -m SND_SOC_ROCKCHIP_MAX98090 + scripts/config -m SND_SOC_ROCKCHIP_PDM + scripts/config -m VIDEO_ROCKCHIP_RGA + scripts/config -e ROCKCHIP_SUSPEND_MODE + scripts/config -e ROCKCHIP_SIP + + scripts/config -e DRM_PANEL + scripts/config -m DRM_PANEL_LVDS + scripts/config -m DRM_PANEL_SIMPLE + + scripts/config -m HID_MULTITOUCH + + scripts/config -m SND_SOC_ES8316 + scripts/config -m SND_SOC_SIMPLE_AMPLIFIER + scripts/config -m SND_SIMPLE_CARD + + scripts/config -e CHARGER_GPIO + scripts/config -m PWRSEQ_SD8787 + scripts/config -m PWRSEQ_SIMPLE + scripts/config -e GPIO_SYSCON + + scripts/config -e RTC_DRV_RK808 + + scripts/config -e WIRELESS + scripts/config -m CFG80211 + scripts/config -e CFG80211_WEXT + scripts/config -e MAC80211 + scripts/config -e NETDEVICES + scripts/config -e WLAN + + build-commands: + - make -j$(nproc) + + install-commands: + - | + install -Dm644 "%{image-name}" '%{install-root}%{bootdir}/vmlinuz' + install -Dm644 System.map '%{install-root}%{bootdir}/System.map' + make INSTALL_MOD_PATH='%{install-root}%{prefix}' modules_install + rm %{install-root}%{indep-libdir}/modules/*/{source,build} + make INSTALL_DTBS_PATH='%{install-root}%{bootdir}/dtbs' dtbs_install + +public: + bst: + integration-commands: + - | + cd '%{indep-libdir}/modules' + for version in *; do + depmod -b '%{prefix}' -a "$version"; + done + + split-rules: + devel: + (>): + - '%{bootdir}/System.map' diff --git a/elements/boards/pinephone-pro/repo.bst b/elements/boards/pinephone-pro/repo.bst new file mode 100644 index 0000000000000000000000000000000000000000..e48216810a2a31365807818bc709a5c49da7d0b3 --- /dev/null +++ b/elements/boards/pinephone-pro/repo.bst @@ -0,0 +1,29 @@ +kind: ostree + +build-depends: +- freedesktop-sdk.bst:vm/prepare-image.bst +- core-deps/libostree.bst +- boards/pinephone-pro/filesystem.bst +- boards/pinephone-pro/initial-scripts.bst + +variables: + uuidnamespace: aea54278-2587-4075-ae67-8688ace4ce3d + ostree-branch: gnome-os/aarch64/pinephone-pro + +config: + environment: + - core-deps/libostree.bst + - vm/prepare-image.bst + - boards/pinephone-pro/initial-scripts.bst + ostree-branch: '%{ostree-branch}' + initial-commands: + - | + prepare-image.sh \ + --sysroot %{sysroot} \ + --seed "%{uuidnamespace}" \ + --rootsource LABEL=root \ + --rootpasswd root \ + --efisource LABEL=EFI \ + --efipath /boot >/dev/null + + - mv %{sysroot}/etc %{sysroot}/usr/etc diff --git a/elements/boards/pinephone-pro/u-boot.bst b/elements/boards/pinephone-pro/u-boot.bst new file mode 100644 index 0000000000000000000000000000000000000000..1c90baed72879c0ec60ea09717af124c94e7bcde --- /dev/null +++ b/elements/boards/pinephone-pro/u-boot.bst @@ -0,0 +1,41 @@ +kind: manual + +sources: +- kind: git + url: github:u-boot/u-boot.git + track: v2022.07 + ref: 127ba75b48ab4ba0388c65b08251213d343c8d9c + +- kind: patch + path: files/u-boot/add-initial-pinephone-pro-support.patch + +build-depends: +- freedesktop-sdk.bst:components/bison.bst +- freedesktop-sdk.bst:components/dtc.bst +- freedesktop-sdk.bst:components/flex.bst +- freedesktop-sdk.bst:components/gzip.bst +- freedesktop-sdk.bst:components/bc.bst +- freedesktop-sdk.bst:components/swig.bst +- core-deps/qemu.bst +- freedesktop-sdk.bst:components/python3-setuptools.bst +- boards/common/python3-as-python2.bst +- boards/pinephone-pro/arm-trusted-firmware.bst + +environment: + BL31: "%{indep-libdir}/u-boot/%{board}/bl31.elf" + +variables: + board: pinephone-pro-rk3399 + config: pinephone-pro-rk3399 + +config: + configure-commands: + - make distclean + - make "%{config}_defconfig" + + build-commands: + - make V=1 all + + install-commands: + - install -Dm644 -t "%{install-root}%{indep-libdir}/u-boot/%{board}" idbloader.img + - install -Dm644 -t "%{install-root}%{indep-libdir}/u-boot/%{board}" u-boot.itb diff --git a/elements/boards/pinephone/arm-trusted-firmware.bst b/elements/boards/pinephone/arm-trusted-firmware.bst new file mode 100644 index 0000000000000000000000000000000000000000..8068586a783db5d41c5ae99cee691288e9ac15c3 --- /dev/null +++ b/elements/boards/pinephone/arm-trusted-firmware.bst @@ -0,0 +1,28 @@ +kind: manual + +sources: +- kind: git_tag + url: github:ARM-software/arm-trusted-firmware.git + track: v2.7 + ref: v2.7.0-0-g35f4c7295bafeb32c8bcbdfb6a3f2e74a57e732b + +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst +# This is required because at part of the firmware has to be built for +# armv7. freedesktop-sdk.bst:cross-compilers/gcc-arm.bst does not +# seem to be able to compile like needed. +- boards/common/arm-none-eabi-gcc.bst + +variables: + board: sun50i_a64 + +environment: + CFLAGS: '-fno-stack-protector' + LDFLAGS: '' + +config: + build-commands: + - make -j$(nproc) PLAT=%{board} DEBUG=1 all + + install-commands: + - install -Dm644 -t "%{install-root}%{indep-libdir}/u-boot/pinephone" build/%{board}/debug/bl31/bl31.elf diff --git a/elements/boards/pinephone/deps.bst b/elements/boards/pinephone/deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..f690f71a4123c3a35473a346024545a032f3b31e --- /dev/null +++ b/elements/boards/pinephone/deps.bst @@ -0,0 +1,5 @@ +kind: stack + +depends: +- boards/pinephone/initramfs.bst +- boards/generic/deps.bst \ No newline at end of file diff --git a/elements/boards/pinephone/filesystem.bst b/elements/boards/pinephone/filesystem.bst new file mode 100644 index 0000000000000000000000000000000000000000..40f33bf4fecff154014fc2c1f5053fc1080c5a78 --- /dev/null +++ b/elements/boards/pinephone/filesystem.bst @@ -0,0 +1,10 @@ +kind: compose + +build-depends: +- boards/pinephone/deps.bst +- boards/pinephone/initramfs.bst + +config: + exclude: + - devel + - debug diff --git a/elements/boards/pinephone/image-deps.bst b/elements/boards/pinephone/image-deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..b95c0713af6e3495d4e943d5e8b8d8b27829d1cb --- /dev/null +++ b/elements/boards/pinephone/image-deps.bst @@ -0,0 +1,7 @@ +kind: stack + +depends: +- boards/pinephone/u-boot.bst +- core-deps/libostree.bst +- freedesktop-sdk.bst:components/genimage.bst +- freedesktop-sdk.bst:integration/mtab.bst diff --git a/elements/boards/pinephone/image.bst b/elements/boards/pinephone/image.bst new file mode 100644 index 0000000000000000000000000000000000000000..f30368a4b87718d23d20f07796454bf264780f25 --- /dev/null +++ b/elements/boards/pinephone/image.bst @@ -0,0 +1,126 @@ +kind: script + +build-depends: +- boards/pinephone/image-deps.bst +- boards/pinephone/repo.bst +- boards/pinephone/linux.bst + +variables: + linux-root: b921b045-1df0-41c3-af44-4c6f280d3fae + ostree-branch: gnome-os/aarch64/pinephone + board: pinephone + + sysroot: "/sysroot" + +environment: + OSTREE_REPO: "%{sysroot}/ostree/repo" + XZFLAGS: -T%{max-jobs} + +environment-nocache: +- XZFLAGS + + +config: + layout: + - element: '' + destination: '/sysroot' + - element: components/genimage.bst + destination: '/' + - element: boards/pinephone/repo.bst + destination: '/source-repo' + - element: boards/pinephone/image-deps.bst + destination: '/' + - element: core-deps/libostree.bst + destination: '/' + - element: boards/pinephone/linux.bst + destination: '/kernel' + + commands: + - mkdir -p "${OSTREE_REPO}" + - ostree init --repo="${OSTREE_REPO}" --mode=bare + + - ostree config --group sysroot set bootloader auto + - ostree pull-local "/source-repo" %{ostree-branch} + + - mkdir -p "%{sysroot}/boot" + + - ostree admin init-fs "%{sysroot}" + - ostree admin os-init --sysroot="%{sysroot}" gnome-os + + # U-Boot does not provide EFI variables at runtime. So /dev/gpt-auto-root + # is not available. + - | + ostree admin deploy --os="gnome-os" \ + --sysroot="%{sysroot}" %{ostree-branch} \ + --karg="rw" --karg="splash" \ + --karg="root=LABEL=root" \ + --karg="console=ttyS0,115200n8" \ + --karg="earlycon=ttyS0,115200n8" + + - | + mkdir -p "%{sysroot}/etc/ostree" + cp -r "%{sysroot}"/ostree/boot.1/gnome-os/*/*/etc/ostree/remotes.d "%{sysroot}/etc/ostree/remotes.d" + + - | + ostree admin set-origin --sysroot="%{sysroot}" \ + --index=0 \ + gnome-os dummy \ + %{ostree-branch} + + - cp -r "%{sysroot}"/ostree/boot.1/gnome-os/*/*/boot/EFI/ "%{sysroot}/boot/" + + - cp -r "/kernel/boot/dtbs" "%{sysroot}/boot/dtb" + + - | + size=$(($(du -s -B 4K "%{sysroot}" | cut -f1)*4+200*1024)) + cat >%{install-root}/genimage.cfg </dev/null + + - | + mkdir -p "%{install-root}/usr/lib/" + cp -r /usr/lib/modules "%{install-root}/usr/lib/" + + - | + version="$(ls -1 /lib/modules | head -n1)" + mkdir -p "%{install-root}/usr/lib/modules/${version}" + dracut -v --fstab \ + --no-machineid \ + --kver "${version}" \ + --add ostree \ + --add plymouth \ + --add eos-repartition \ + --add-drivers "rockchipdrm panfrost panel_simple analogix_dp pwm_bl drm_kms_helper" \ + --install 'fsck.ext4' \ + "%{install-root}/usr/lib/modules/${version}/initramfs" + + - | + version="$(ls -1 /lib/modules | head -n1)" + cp /boot/vmlinuz "%{install-root}/usr/lib/modules/${version}/vmlinuz" + + - dbus-uuidgen >/etc/machine-id + - SYSTEMD_RELAX_ESP_CHECKS=1 bootctl --path='/efi' --no-variables install + - rm /etc/machine-id + + - cp -r /efi "%{install-root}/boot" + + - | + cat <"%{install-root}/boot/loader/loader.conf" + timeout 3 + editor no + console-mode max + default * + EOF diff --git a/elements/boards/pinephone/initramfs/deps.bst b/elements/boards/pinephone/initramfs/deps.bst new file mode 100644 index 0000000000000000000000000000000000000000..5d958e1c2bf2ef77687bc4cb84649da2389acc8d --- /dev/null +++ b/elements/boards/pinephone/initramfs/deps.bst @@ -0,0 +1,6 @@ +kind: stack + +depends: +- boards/pinephone/linux.bst +- boards/generic/initramfs/deps.bst + diff --git a/elements/boards/pinephone/initramfs/initial-scripts.bst b/elements/boards/pinephone/initramfs/initial-scripts.bst new file mode 100644 index 0000000000000000000000000000000000000000..ea5223955945ad91c486608100db694882ca49f8 --- /dev/null +++ b/elements/boards/pinephone/initramfs/initial-scripts.bst @@ -0,0 +1,7 @@ +kind: collect_initial_scripts + +build-depends: +- boards/pinephone/initramfs/deps.bst + +config: + path: /etc/fdsdk/initial_scripts diff --git a/elements/boards/pinephone/linux.bst b/elements/boards/pinephone/linux.bst new file mode 100644 index 0000000000000000000000000000000000000000..59e276df2436c5a96b541773bd8e2faa26afa777 --- /dev/null +++ b/elements/boards/pinephone/linux.bst @@ -0,0 +1,584 @@ +kind: manual + +sources: +- kind: git_tag + url: github:megous/linux.git + track: orange-pi-5.10 + ref: orange-pi-5.10-20210226-1254-0-g5aa571dfc47b2fa92615ea5774475fa3650e8eb3 + +depends: +- freedesktop-sdk.bst:components/kmod.bst + +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst +- freedesktop-sdk.bst:components/bison.bst +- freedesktop-sdk.bst:components/flex.bst +- freedesktop-sdk.bst:components/bc.bst +- freedesktop-sdk.bst:components/gzip.bst +- freedesktop-sdk.bst:components/openssl.bst + +variables: + bootdir: /boot + kernel_arch: arm64 + image-name: arch/arm64/boot/Image + +environment: + ARCH: '%{kernel_arch}' + +config: + configure-commands: + - make clean defconfig + + - | + scripts/config -e SYSVIPC + scripts/config -e POSIX_MQUEUE + scripts/config -e NO_HZ + scripts/config -e HIGH_RES_TIMERS + scripts/config -e PREEMPT_VOLUNTARY + scripts/config -e BSD_PROCESS_ACCT + scripts/config -e BSD_PROCESS_ACCT_V3 + scripts/config -e TASKSTATS + scripts/config -e TASK_DELAY_ACCT + scripts/config -e TASK_XACCT + scripts/config -e TASK_IO_ACCOUNTING + scripts/config -e MEMCG + scripts/config -e BLK_CGROUP + scripts/config -e CFS_BANDWIDTH + scripts/config -e RT_GROUP_SCHED + scripts/config -e CGROUP_PIDS + scripts/config -e CGROUP_FREEZER + scripts/config -e CPUSETS + scripts/config -e CGROUP_DEVICE + scripts/config -e CGROUP_CPUACCT + scripts/config -e CGROUP_BPF + scripts/config -e USER_NS + scripts/config -e SCHED_AUTOGROUP + scripts/config -e BOOT_CONFIG + scripts/config -e BPF_SYSCALL + scripts/config -e BPF_JIT_ALWAYS_ON + scripts/config -e PERF_EVENTS + scripts/config -e ARCH_SUNXI + scripts/config -e SCHED_MC + scripts/config -e COMPAT + scripts/config -e PM_AUTOSLEEP + scripts/config -e PM_WAKELOCKS + scripts/config -e PM_DEBUG + scripts/config -e WQ_POWER_EFFICIENT_DEFAULT + scripts/config -e ENERGY_MODEL + scripts/config -e CPU_IDLE + scripts/config -e CPU_IDLE_GOV_LADDER + scripts/config -e ARM_CPUIDLE + scripts/config -e ARM_PSCI_CPUIDLE + scripts/config -e CPU_FREQ + scripts/config -e CPU_FREQ_STAT + scripts/config -e CPU_FREQ_DEFAULT_GOV_PERFORMANCE + scripts/config -e CPU_FREQ_GOV_POWERSAVE + scripts/config -e CPU_FREQ_GOV_USERSPACE + scripts/config -e CPU_FREQ_GOV_ONDEMAND + scripts/config -e CPU_FREQ_GOV_CONSERVATIVE + scripts/config -e CPU_FREQ_GOV_SCHEDUTIL + scripts/config -e CPUFREQ_DT + scripts/config -e ARM_SCPI_PROTOCOL + scripts/config -m CRYPTO_SHA1_ARM64_CE + scripts/config -m CRYPTO_SHA2_ARM64_CE + scripts/config -m CRYPTO_SHA512_ARM64_CE + scripts/config -m CRYPTO_SHA3_ARM64 + scripts/config -m CRYPTO_SM3_ARM64_CE + scripts/config -m CRYPTO_SM4_ARM64_CE + scripts/config -m CRYPTO_GHASH_ARM64_CE + scripts/config -m CRYPTO_CRCT10DIF_ARM64_CE + scripts/config -m CRYPTO_AES_ARM64_CE_CCM + scripts/config -m CRYPTO_AES_ARM64_CE_BLK + scripts/config -m CRYPTO_AES_ARM64_BS + scripts/config -e JUMP_LABEL + scripts/config -e MODULES + scripts/config -e MODULE_UNLOAD + scripts/config -e MODVERSIONS + scripts/config -e BLK_DEV_THROTTLING + scripts/config -e BLK_WBT + scripts/config -e BLK_CGROUP_IOLATENCY + scripts/config -e BLK_CGROUP_IOCOST + scripts/config -e PARTITION_ADVANCED + scripts/config -e IOSCHED_BFQ + scripts/config -e BFQ_GROUP_IOSCHED + scripts/config -e CMA + scripts/config -e CMA_DEBUGFS + scripts/config -e ZPOOL + scripts/config -e ZBUD + scripts/config -e Z3FOLD + scripts/config -e ZSMALLOC + scripts/config -e NET + scripts/config -e PACKET + scripts/config -e PACKET_DIAG + scripts/config -e UNIX + scripts/config -e UNIX_DIAG + scripts/config -e XFRM_USER + scripts/config -m NET_KEY + scripts/config -e INET + scripts/config -e IP_MULTICAST + scripts/config -e IP_ADVANCED_ROUTER + scripts/config -e SYN_COOKIES + scripts/config -e MPTCP + scripts/config -e NETFILTER + scripts/config -m NETFILTER_NETLINK_QUEUE + scripts/config -m NETFILTER_NETLINK_LOG + scripts/config -m NF_CONNTRACK + scripts/config -m NF_LOG_NETDEV + scripts/config -e NF_CONNTRACK_MARK + scripts/config -m NF_CONNTRACK_FTP + scripts/config -m NF_CONNTRACK_H323 + scripts/config -m NF_CONNTRACK_IRC + scripts/config -m NF_CONNTRACK_NETBIOS_NS + scripts/config -m NF_CONNTRACK_SNMP + scripts/config -m NF_CONNTRACK_PPTP + scripts/config -m NF_CONNTRACK_SIP + scripts/config -m NF_CONNTRACK_TFTP + scripts/config -m NF_CT_NETLINK + scripts/config -e NETFILTER_NETLINK_GLUE_CT + scripts/config -m NF_TABLES + scripts/config -e NF_TABLES_INET + scripts/config -e NF_TABLES_NETDEV + scripts/config -m NFT_NUMGEN + scripts/config -m NFT_CT + scripts/config -m NFT_COUNTER + scripts/config -m NFT_CONNLIMIT + scripts/config -m NFT_LOG + scripts/config -m NFT_LIMIT + scripts/config -m NFT_MASQ + scripts/config -m NFT_REDIR + scripts/config -m NFT_NAT + scripts/config -m NFT_TUNNEL + scripts/config -m NFT_OBJREF + scripts/config -m NFT_QUEUE + scripts/config -m NFT_QUOTA + scripts/config -m NFT_REJECT + scripts/config -m NFT_HASH + scripts/config -m NFT_FIB_INET + scripts/config -m NFT_SOCKET + scripts/config -m NFT_OSF + scripts/config -m NFT_DUP_NETDEV + scripts/config -m NFT_FWD_NETDEV + scripts/config -m NF_FLOW_TABLE_INET + scripts/config -m NF_FLOW_TABLE + scripts/config -m IP_SET + scripts/config -m IP_SET_BITMAP_IP + scripts/config -m IP_SET_BITMAP_IPMAC + scripts/config -m IP_SET_BITMAP_PORT + scripts/config -m IP_SET_HASH_IP + scripts/config -m IP_SET_HASH_IPMARK + scripts/config -m IP_SET_HASH_IPPORT + scripts/config -m IP_SET_HASH_IPPORTIP + scripts/config -m IP_SET_HASH_IPPORTNET + scripts/config -m IP_SET_HASH_IPMAC + scripts/config -m IP_SET_HASH_MAC + scripts/config -m IP_SET_HASH_NETPORTNET + scripts/config -m IP_SET_HASH_NET + scripts/config -m IP_SET_HASH_NETNET + scripts/config -m IP_SET_HASH_NETPORT + scripts/config -m IP_SET_HASH_NETIFACE + scripts/config -m IP_SET_LIST_SET + scripts/config -m NFT_FIB_IPV4 + scripts/config -e NF_TABLES_ARP + scripts/config -m NF_FLOW_TABLE_IPV4 + scripts/config -m NF_LOG_ARP + scripts/config -m NF_LOG_IPV4 + scripts/config -m NFT_DUP_IPV6 + scripts/config -m NFT_FIB_IPV6 + scripts/config -m NF_FLOW_TABLE_IPV6 + scripts/config -m NF_LOG_IPV6 + scripts/config -e BPFILTER + scripts/config -e BPFILTER_UMH + scripts/config -e NET_SCHED + scripts/config -m NET_SCH_CBQ + scripts/config -m NET_SCH_HTB + scripts/config -m NET_CLS_BASIC + scripts/config -m NET_CLS_ROUTE4 + scripts/config -m NET_CLS_FW + scripts/config -m NET_CLS_CGROUP + scripts/config -e NET_CLS_ACT + scripts/config -m NET_ACT_POLICE + scripts/config -m NET_ACT_GACT + scripts/config -m NET_ACT_MIRRED + scripts/config -m NETLINK_DIAG + scripts/config -e BPF_JIT + scripts/config -m BT + scripts/config -m BT_RFCOMM + scripts/config -e BT_RFCOMM_TTY + scripts/config -m BT_BNEP + scripts/config -e BT_BNEP_MC_FILTER + scripts/config -e BT_BNEP_PROTO_FILTER + scripts/config -m BT_HIDP + scripts/config -e BT_HS + scripts/config -e BT_LEDS + scripts/config -m BT_HCIUART + scripts/config -e BT_HCIUART_RTL + scripts/config -m CFG80211 + scripts/config -e CFG80211_DEBUGFS + scripts/config -e CFG80211_WEXT + scripts/config -m MAC80211 + scripts/config -e MAC80211_LEDS + scripts/config -m RFKILL + scripts/config -m RFKILL_GPIO + scripts/config -e UEVENT_HELPER + scripts/config -e DEVTMPFS + scripts/config -e DEVTMPFS_MOUNT + scripts/config -m ZRAM + scripts/config -e ZRAM_WRITEBACK + scripts/config -e ZRAM_MEMORY_TRACKING + scripts/config -m BLK_DEV_LOOP + scripts/config -m BLK_DEV_NBD + scripts/config -m MODEM_POWER + scripts/config -m SCSI + scripts/config -m BLK_DEV_SD + scripts/config -e MD + scripts/config -e BLK_DEV_DM + scripts/config -e DM_CRYPT + scripts/config -e DM_INIT + scripts/config -e DM_UEVENT + scripts/config -e NETDEVICES + scripts/config -m WIREGUARD + scripts/config -m TUN + scripts/config -m VETH + scripts/config -m PPP + scripts/config -m PPP_BSDCOMP + scripts/config -m PPP_DEFLATE + scripts/config -e PPP_FILTER + scripts/config -m PPP_MPPE + scripts/config -m USB_RTL8152 + scripts/config -m USB_USBNET + scripts/config -m USB_NET_CDC_EEM + scripts/config -m USB_NET_CDC_MBIM + scripts/config -m USB_NET_QMI_WWAN + scripts/config -e INPUT_POLLDEV + scripts/config -m INPUT_MOUSEDEV + scripts/config -e INPUT_MOUSEDEV_PSAUX + scripts/config -e INPUT_EVDEV + scripts/config -e KEYBOARD_GPIO + scripts/config -e KEYBOARD_GPIO_POLLED + scripts/config -e KEYBOARD_SUN4I_LRADC + scripts/config -e INPUT_TOUCHSCREEN + scripts/config -m TOUCHSCREEN_GOODIX + scripts/config -e INPUT_MISC + scripts/config -e INPUT_GPIO_VIBRA + scripts/config -e INPUT_AXP20X_PEK + scripts/config -e INPUT_UINPUT + scripts/config -e SERIAL_8250 + scripts/config -e SERIAL_8250_CONSOLE + scripts/config -e SERIAL_8250_DW + scripts/config -e SERIAL_OF_PLATFORM + scripts/config -e SERIAL_DEV_BUS + scripts/config -e I2C_CHARDEV + scripts/config -e I2C_MUX + scripts/config -e I2C_GPIO + scripts/config -e I2C_MV64XXX + scripts/config -e PINCTRL_AXP209 + scripts/config -e PINCTRL_SINGLE + scripts/config -e GPIO_SYSFS + scripts/config -e CHARGER_AXP20X + scripts/config -e BATTERY_AXP20X + scripts/config -e AXP20X_POWER + scripts/config -e THERMAL + scripts/config -e THERMAL_STATISTICS + scripts/config -e THERMAL_WRITABLE_TRIPS + scripts/config -e THERMAL_GOV_FAIR_SHARE + scripts/config -e THERMAL_GOV_BANG_BANG + scripts/config -e CPU_THERMAL + scripts/config -e SUN8I_THERMAL + scripts/config -e WATCHDOG + scripts/config -e SUNXI_WATCHDOG + scripts/config -e MFD_SUN4I_GPADC + scripts/config -e MFD_AXP20X_RSB + scripts/config -e MFD_SYSCON + scripts/config -e REGULATOR + scripts/config -e REGULATOR_FIXED_VOLTAGE + scripts/config -e REGULATOR_AXP20X + scripts/config -e REGULATOR_GPIO + scripts/config -m MEDIA_SUPPORT + scripts/config -e MEDIA_CAMERA_SUPPORT + scripts/config -e MEDIA_PLATFORM_SUPPORT + scripts/config -m V4L2_FLASH_LED_CLASS + scripts/config -e V4L_PLATFORM_DRIVERS + scripts/config -m VIDEO_SUN6I_CSI + scripts/config -e V4L_MEM2MEM_DRIVERS + scripts/config -m VIDEO_MEM2MEM_DEINTERLACE + scripts/config -m VIDEO_SUN8I_DEINTERLACE + scripts/config -m VIDEO_SUN8I_ROTATE + scripts/config -m VIDEO_OV5640 + scripts/config -m VIDEO_GC2145 + scripts/config -e DRM + scripts/config -e DRM_LOAD_EDID_FIRMWARE + scripts/config -e DRM_SUN4I + scripts/config -e DRM_SUN6I_DSI + scripts/config -e DRM_SUN8I_DW_HDMI + scripts/config -e DRM_SUN8I_MIXER + scripts/config -e DRM_PANEL_ILITEK_ILI9881C + scripts/config -e DRM_PANEL_SITRONIX_ST7703 + scripts/config -m DRM_DW_HDMI_AHB_AUDIO + scripts/config -m DRM_DW_HDMI_I2S_AUDIO + scripts/config -e DRM_DW_HDMI_CEC + scripts/config -m DRM_LIMA + scripts/config -e FB_SIMPLE + scripts/config -e BACKLIGHT_CLASS_DEVICE + scripts/config -e BACKLIGHT_PWM + scripts/config -e FRAMEBUFFER_CONSOLE_ROTATION + scripts/config -e FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER + scripts/config -m SOUND + scripts/config -m SND + scripts/config -e SND_OSSEMUL + scripts/config -m SND_MIXER_OSS + scripts/config -m SND_PCM_OSS + scripts/config -m SND_HRTIMER + scripts/config -m SND_SEQUENCER + scripts/config -m SND_SEQ_DUMMY + scripts/config -m SND_SEQUENCER_OSS + scripts/config -m SND_ALOOP + scripts/config -m SND_USB_AUDIO + scripts/config -m SND_SOC + scripts/config -m SND_SUN4I_CODEC + scripts/config -m SND_SUN8I_CODEC + scripts/config -m SND_SUN8I_CODEC_ANALOG + scripts/config -m SND_SUN50I_CODEC_ANALOG + scripts/config -m SND_SUN4I_I2S + scripts/config -m SND_SUN4I_SPDIF + scripts/config -m SND_SOC_BT_SCO + scripts/config -m SND_SOC_EC25 + scripts/config -m SND_SOC_SIMPLE_AMPLIFIER + scripts/config -m SND_SIMPLE_CARD + scripts/config -m SND_AUDIO_GRAPH_CARD + scripts/config -m HID + scripts/config -e USB_HIDDEV + scripts/config -e USB_LED_TRIG + scripts/config -m USB + scripts/config -e USB_ANNOUNCE_NEW_DEVICES + scripts/config -e USB_OTG + scripts/config -m USB_OTG_FSM + scripts/config -m USB_LEDS_TRIGGER_USBPORT + scripts/config -m USB_MON + scripts/config -m USB_EHCI_HCD + scripts/config -m USB_EHCI_HCD_PLATFORM + scripts/config -m USB_OHCI_HCD + scripts/config -m USB_OHCI_HCD_PLATFORM + scripts/config -m USB_ACM + scripts/config -m USB_STORAGE + scripts/config -m USB_UAS + scripts/config -m USBIP_CORE + scripts/config -m USBIP_VHCI_HCD + scripts/config -m USBIP_HOST + scripts/config -m USBIP_VUDC + scripts/config -m USB_MUSB_HDRC + scripts/config -m USB_MUSB_SUNXI + scripts/config -e MUSB_PIO_ONLY + scripts/config -m USB_SERIAL + scripts/config -m USB_SERIAL_SIMPLE + scripts/config -m USB_SERIAL_CH341 + scripts/config -m USB_SERIAL_CP210X + scripts/config -m USB_SERIAL_FTDI_SIO + scripts/config -m USB_SERIAL_QCAUX + scripts/config -m USB_SERIAL_QUALCOMM + scripts/config -m USB_SERIAL_OPTION + scripts/config -m NOP_USB_XCEIV + scripts/config -m USB_GADGET + scripts/config -e U_SERIAL_CONSOLE + scripts/config -m USB_CONFIGFS + scripts/config -e USB_CONFIGFS_SERIAL + scripts/config -e USB_CONFIGFS_ACM + scripts/config -e USB_CONFIGFS_OBEX + scripts/config -e USB_CONFIGFS_NCM + scripts/config -e USB_CONFIGFS_ECM + scripts/config -e USB_CONFIGFS_ECM_SUBSET + scripts/config -e USB_CONFIGFS_RNDIS + scripts/config -e USB_CONFIGFS_EEM + scripts/config -e USB_CONFIGFS_MASS_STORAGE + scripts/config -e USB_CONFIGFS_F_LB_SS + scripts/config -e USB_CONFIGFS_F_FS + scripts/config -e USB_CONFIGFS_F_UAC1 + scripts/config -e USB_CONFIGFS_F_UAC2 + scripts/config -e USB_CONFIGFS_F_MIDI + scripts/config -e USB_CONFIGFS_F_HID + scripts/config -e USB_CONFIGFS_F_UVC + scripts/config -e USB_CONFIGFS_F_PRINTER + scripts/config -m USB_AUDIO + scripts/config -m USB_ETH + scripts/config -e USB_ETH_EEM + scripts/config -m USB_G_NCM + scripts/config -m USB_GADGETFS + scripts/config -m USB_FUNCTIONFS + scripts/config -e USB_FUNCTIONFS_ETH + scripts/config -e USB_FUNCTIONFS_RNDIS + scripts/config -e USB_FUNCTIONFS_GENERIC + scripts/config -m USB_MASS_STORAGE + scripts/config -m USB_G_SERIAL + scripts/config -m USB_MIDI_GADGET + scripts/config -m USB_G_PRINTER + scripts/config -m USB_CDC_COMPOSITE + scripts/config -m USB_G_ACM_MS + scripts/config -m USB_G_MULTI + scripts/config -e USB_G_MULTI_CDC + scripts/config -m USB_G_HID + scripts/config -m USB_G_WEBCAM + scripts/config -m USB_RAW_GADGET + scripts/config -e TYPEC + scripts/config -m TYPEC_TCPM + scripts/config -m TYPEC_TCPCI + scripts/config -m TYPEC_UCSI + scripts/config -m TYPEC_ANX7688 + scripts/config -m TYPEC_DP_ALTMODE + scripts/config -e MMC + scripts/config -e MMC_SUNXI + scripts/config -e NEW_LEDS + scripts/config -e LEDS_CLASS + scripts/config -e LEDS_CLASS_FLASH + scripts/config -e LEDS_GPIO + scripts/config -m LEDS_SGM3140 + scripts/config -e LEDS_TRIGGER_TIMER + scripts/config -e LEDS_TRIGGER_ONESHOT + scripts/config -e LEDS_TRIGGER_HEARTBEAT + scripts/config -e LEDS_TRIGGER_CPU + scripts/config -e LEDS_TRIGGER_ACTIVITY + scripts/config -e LEDS_TRIGGER_GPIO + scripts/config -e LEDS_TRIGGER_DEFAULT_ON + scripts/config -m LEDS_TRIGGER_TRANSIENT + scripts/config -m LEDS_TRIGGER_CAMERA + scripts/config -e LEDS_TRIGGER_PANIC + scripts/config -e LEDS_TRIGGER_NETDEV + scripts/config -e LEDS_TRIGGER_PATTERN + scripts/config -e RTC_CLASS + scripts/config -e RTC_DRV_SUN6I + scripts/config -e DMADEVICES + scripts/config -e DMA_SUN6I + scripts/config -e DMABUF_HEAPS + scripts/config -e DMABUF_HEAPS_SYSTEM + scripts/config -e DMABUF_HEAPS_CMA + scripts/config -e STAGING + scripts/config -e STAGING_MEDIA + scripts/config -e VIDEO_SUNXI + scripts/config -m VIDEO_SUNXI_CEDRUS + scripts/config -e ASHMEM + scripts/config -m RTL8723CS + scripts/config -e MAILBOX + scripts/config -e IOMMU_IO_PGTABLE_LPAE + scripts/config -m DEVFREQ_GOV_PERFORMANCE + scripts/config -m DEVFREQ_GOV_POWERSAVE + scripts/config -m DEVFREQ_GOV_USERSPACE + scripts/config -m DEVFREQ_GOV_PASSIVE + scripts/config -e PM_DEVFREQ_EVENT + scripts/config -e IIO + scripts/config -m IIO_BUFFER_CB + scripts/config -m IIO_BUFFER_HW_CONSUMER + scripts/config -m IIO_SW_DEVICE + scripts/config -m IIO_SW_TRIGGER + scripts/config -e AXP20X_ADC + scripts/config -m INV_MPU6050_I2C + scripts/config -m STK3310 + scripts/config -m IIO_ST_MAGN_3AXIS + scripts/config -m IIO_HRTIMER_TRIGGER + scripts/config -m IIO_INTERRUPT_TRIGGER + scripts/config -m IIO_SYSFS_TRIGGER + scripts/config -e PWM + scripts/config -e PWM_SUN4I + scripts/config -e PHY_SUN4I_USB + scripts/config -e ARM_CCI_PMU + scripts/config -e ANDROID + scripts/config -e ANDROID_BINDER_IPC + scripts/config -e ANDROID_BINDERFS + scripts/config -e ANDROID_BINDER_IPC_SELFTEST + scripts/config -e NVMEM_SUNXI_SID + scripts/config -e VALIDATE_FS_PARSER + scripts/config -e EXT4_FS + scripts/config -e EXT4_FS_POSIX_ACL + scripts/config -m XFS_FS + scripts/config -e XFS_POSIX_ACL + scripts/config -e BTRFS_FS + scripts/config -e BTRFS_FS_POSIX_ACL + scripts/config -m NILFS2_FS + scripts/config -e F2FS_FS + scripts/config -e F2FS_FS_SECURITY + scripts/config -e F2FS_CHECK_FS + scripts/config -e F2FS_FS_COMPRESSION + scripts/config -e FS_ENCRYPTION + scripts/config -e FANOTIFY + scripts/config -m AUTOFS_FS + scripts/config -m FUSE_FS + scripts/config -m CUSE + scripts/config -m OVERLAY_FS + scripts/config -e OVERLAY_FS_INDEX + scripts/config -e OVERLAY_FS_METACOPY + scripts/config -e VFAT_FS + scripts/config -e PROC_CHILDREN + scripts/config -e TMPFS + scripts/config -e TMPFS_POSIX_ACL + scripts/config -e CONFIGFS_FS + scripts/config -m ECRYPT_FS + scripts/config -e ECRYPT_FS_MESSAGING + scripts/config -m SQUASHFS + scripts/config -e SQUASHFS_FILE_DIRECT + scripts/config -e SQUASHFS_DECOMP_MULTI + scripts/config -e SQUASHFS_XATTR + scripts/config -e SQUASHFS_LZ4 + scripts/config -e SQUASHFS_LZO + scripts/config -e SQUASHFS_XZ + scripts/config -e SQUASHFS_ZSTD + scripts/config -e NLS_CODEPAGE_437 + scripts/config -e NLS_CODEPAGE_852 + scripts/config -e NLS_ISO8859_1 + scripts/config -e NLS_ISO8859_2 + scripts/config -e NLS_UTF8 + scripts/config -e PERSISTENT_KEYRINGS + scripts/config -e ENCRYPTED_KEYS + scripts/config -m CRYPTO_USER + scripts/config -m CRYPTO_PCRYPT + scripts/config -e CRYPTO_CRYPTD + scripts/config -m CRYPTO_CURVE25519 + scripts/config -m CRYPTO_CHACHA20POLY1305 + scripts/config -m CRYPTO_SEQIV + scripts/config -m CRYPTO_ECHAINIV + scripts/config -m CRYPTO_BLAKE2S + scripts/config -m CRYPTO_MD4 + scripts/config -e CRYPTO_SHA1 + scripts/config -e CRYPTO_SHA3 + scripts/config -e CRYPTO_SM3 + scripts/config -m CRYPTO_ARC4 + scripts/config -m CRYPTO_SALSA20 + scripts/config -e CRYPTO_SM4 + scripts/config -e CRYPTO_DEFLATE + scripts/config -e CRYPTO_LZO + scripts/config -e CRYPTO_LZ4 + scripts/config -e CRYPTO_ZSTD + scripts/config -m CRYPTO_ANSI_CPRNG + scripts/config -m CRYPTO_USER_API_HASH + scripts/config -m CRYPTO_USER_API_SKCIPHER + scripts/config -m CRYPTO_USER_API_RNG + scripts/config -m CRYPTO_USER_API_AEAD + scripts/config -m CRYPTO_DEV_SUN8I_CE + scripts/config -m PKCS8_PRIVATE_KEY_PARSER + scripts/config -e CRC_T10DIF + scripts/config -e DMA_CMA + scripts/config -e DYNAMIC_DEBUG + scripts/config -e MAGIC_SYSRQ + scripts/config -e DEBUG_FS + scripts/config -e STACKTRACE + + + build-commands: + - make -j$(nproc) + + install-commands: + - install -Dm644 "%{image-name}" '%{install-root}%{bootdir}/vmlinuz' + - install -Dm644 System.map '%{install-root}%{bootdir}/System.map' + - make INSTALL_MOD_PATH='%{install-root}%{prefix}' modules_install + - rm %{install-root}%{indep-libdir}/modules/*/{source,build} + - make INSTALL_DTBS_PATH='%{install-root}%{bootdir}/dtbs' dtbs_install + +public: + bst: + integration-commands: + - | + cd '%{indep-libdir}/modules' + for version in *; do + depmod -b '%{prefix}' -a "$version"; + done + + split-rules: + devel: + (>): + - '%{bootdir}/System.map' diff --git a/elements/boards/pinephone/repo.bst b/elements/boards/pinephone/repo.bst new file mode 100644 index 0000000000000000000000000000000000000000..9d2409098e9b2f54382c550ac9d91ad2454e6abf --- /dev/null +++ b/elements/boards/pinephone/repo.bst @@ -0,0 +1,29 @@ +kind: ostree + +build-depends: +- freedesktop-sdk.bst:vm/prepare-image.bst +- core-deps/libostree.bst +- boards/pinephone/filesystem.bst +- boards/pinephone/initial-scripts.bst + +variables: + uuidnamespace: aea54278-2587-4075-ae67-8688ace4ce3d + ostree-branch: gnome-os/aarch64/pinephone + +config: + environment: + - core-deps/libostree.bst + - vm/prepare-image.bst + - boards/pinephone/initial-scripts.bst + ostree-branch: '%{ostree-branch}' + initial-commands: + - | + prepare-image.sh \ + --sysroot %{sysroot} \ + --seed "%{uuidnamespace}" \ + --rootpasswd root \ + --rootsource LABEL=root \ + --efisource LABEL=EFI \ + --efipath /boot >/dev/null + + - mv %{sysroot}/etc %{sysroot}/usr/etc diff --git a/elements/boards/pinephone/u-boot.bst b/elements/boards/pinephone/u-boot.bst new file mode 100644 index 0000000000000000000000000000000000000000..ccb3d4fbf94b1e26b1a51fc13802c7c89347f568 --- /dev/null +++ b/elements/boards/pinephone/u-boot.bst @@ -0,0 +1,38 @@ +kind: manual + +sources: +- kind: git + url: gitlab:pine64-org/u-boot.git + track: pinephone-2021-06-22 + ref: 378121422954a58bc0072b0c8965fdc7b2332e55 + +build-depends: +- freedesktop-sdk.bst:components/bison.bst +- freedesktop-sdk.bst:components/dtc.bst +- freedesktop-sdk.bst:components/flex.bst +- freedesktop-sdk.bst:components/gzip.bst +- freedesktop-sdk.bst:components/bc.bst +- freedesktop-sdk.bst:components/swig.bst +- freedesktop-sdk.bst:components/python3-setuptools.bst +- boards/common/python3-as-python2.bst +- boards/pinephone/arm-trusted-firmware.bst + +environment: + BL31: "%{indep-libdir}/u-boot/pinephone/bl31.elf" + +variables: + board: pinephone + +config: + configure-commands: + - make distclean + - make "%{board}_defconfig" + + build-commands: + - make -j$(nproc) V=1 all + + install-commands: + - mv u-boot.img idbloader.img + - install -Dm644 -t "%{install-root}%{indep-libdir}/u-boot/%{board}" idbloader.img + - mv u-boot-sunxi-with-spl.fit.itb u-boot.itb + - install -Dm644 -t "%{install-root}%{indep-libdir}/u-boot/%{board}" u-boot.itb diff --git a/elements/core/gnome-shell.bst b/elements/core/gnome-shell.bst index 4359e12206f17f8e3772c5aae55c91fd72b49963..f3604829e253de3db612da45f155aa882f481ec4 100644 --- a/elements/core/gnome-shell.bst +++ b/elements/core/gnome-shell.bst @@ -1,9 +1,10 @@ kind: meson sources: -- kind: tar - url: gnome_downloads:gnome-shell/42/gnome-shell-42.2.tar.xz - ref: 67eb13cd175e2031a838ccea92e90374ae0e9ccba61683fbacd67ff6afdd590e +- kind: git + url: https://gitlab.gnome.org/verdre/gnome-shell.git + track: is-phone-property + ref: 6ef660f50f4a930aca60f4830f6a12e7ee574e59 build-depends: - sdk-deps/sassc.bst - freedesktop-sdk.bst:components/asciidoc.bst diff --git a/elements/core/mutter.bst b/elements/core/mutter.bst index 733809961634eeb524376a1acc59eeb0ed916ad7..ef8ab28f2950bc1cfb43686b62b088143f691c0f 100644 --- a/elements/core/mutter.bst +++ b/elements/core/mutter.bst @@ -1,9 +1,10 @@ kind: meson sources: -- kind: tar - url: gnome_downloads:mutter/42/mutter-42.2.tar.xz - ref: bd30d78be7d170013a0a8bcc837cec5ee6c44d770ff00674dcdfc28b3426b34c +- kind: git + url: https://gitlab.gnome.org/OwenPark/mutter + track: owen/ppintegration + ref: 984f78b469051f55f66a5d02b55a8c274d619630 build-depends: # Need the whole thing over just the capture for the dbus interface. # /usr/share/dbus-1/interfaces/org.gnome.Sysprof3.Profiler.xml diff --git a/elements/custom/atinout.bst b/elements/custom/atinout.bst new file mode 100644 index 0000000000000000000000000000000000000000..0cd75776a905f45d38219867f7fe33b84593df78 --- /dev/null +++ b/elements/custom/atinout.bst @@ -0,0 +1,13 @@ +description: atinout is a low level application for communicating with modems over + serial. +kind: make +sources: +- kind: tar + url: https://sourceforge.net/projects/atinout/files/v0.9.1/atinout-0.9.1.tar.gz/download + ref: 4d15c8288aca414e11cd304686b172696104c5e42bf776300311c005634854a2 +- kind: patch + path: files/atinout/0001-make-gcc-happy-by-adding-fallthrough-comment.patch +- kind: patch + path: files/atinout/0002-do-not-rely-on-CR-in-modem-output.patch +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst diff --git a/elements/custom/eg25-manager.bst b/elements/custom/eg25-manager.bst new file mode 100644 index 0000000000000000000000000000000000000000..fcd1cd7d9caeb71526ac1ef2a2e49d9abe165c9f --- /dev/null +++ b/elements/custom/eg25-manager.bst @@ -0,0 +1,16 @@ +# eg25-manager +kind: meson +sources: +- kind: git + url: https://gitlab.com/mobian1/eg25-manager.git + track: 0.4.4 + ref: f53ba5c5bae2d882b6ba5cd378fd55beadd29d14 +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst +- freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst +depends: +- sdk/glib.bst +- custom/libgpiod.bst +- freedesktop-sdk.bst:components/libgudev.bst +- freedesktop-sdk.bst:components/libusb.bst +- freedesktop-sdk.bst:components/curl.bst diff --git a/elements/custom/gnome_extensions/app_grid_tweaks/app_grid_tweaks.bst b/elements/custom/gnome_extensions/app_grid_tweaks/app_grid_tweaks.bst new file mode 100644 index 0000000000000000000000000000000000000000..3ecb92ea259ee06bf839b4ab6335820fe9ef5622 --- /dev/null +++ b/elements/custom/gnome_extensions/app_grid_tweaks/app_grid_tweaks.bst @@ -0,0 +1,36 @@ +kind: import + +# Stage the files/src directory for building +sources: +- kind: git + url: github:tanvirroshid/App-Grid-Tweaks.git + track: main + ref: 0e5ed380c58644d10bb7d2018c3369b4a29233c9 + +# The import element simply stages the given sources +# directly to the root of the sandbox and then collects +# the output to create an output artifact. +# +config: + + # By default we collect everything staged, specify a + # directory here to output only a subset of the staged + # input sources. + source: / + + # Prefix the output with an optional directory, by default + # the input is found at the root of the produced artifact. + target: /app_grid_tweaks + +public: + bst: + integration-commands: + - |- + UUID=$(cat < ./app_grid_tweaks/app-grid-tweaks@Selenium-H/metadata.json | jq -r '.uuid') + NEW_DIR="/usr/share/gnome-shell/extensions/${UUID}" + mkdir -p ${NEW_DIR} + mv -v ./app_grid_tweaks/app-grid-tweaks@Selenium-H/* ./app_grid_tweaks/ + rm -rf ./app_grid_tweaks/app-grid-tweaks@Selenium-H + mv -v ./app_grid_tweaks/* ${NEW_DIR} + glib-compile-schemas ${NEW_DIR}/schemas/ + rm -rf ./app_grid_tweaks/ \ No newline at end of file diff --git a/elements/custom/gnome_extensions/extension_installer/extension_installer.bst b/elements/custom/gnome_extensions/extension_installer/extension_installer.bst new file mode 100644 index 0000000000000000000000000000000000000000..69b8997bf514f05372e382c5c14f3b4136e17046 --- /dev/null +++ b/elements/custom/gnome_extensions/extension_installer/extension_installer.bst @@ -0,0 +1,16 @@ +kind: stack + +depends: +- custom/gnome_extensions/max_size/max_size.bst +- custom/gnome_extensions/app_grid_tweaks/app_grid_tweaks.bst + +- custom/utility/xml_editor/xml_editor.bst + +public: + bst: + integration-commands: + - | + python xml_editor.py usr/share/glib-2.0/schemas/org.gnome.shell.gschema.xml key name disable-extension-version-validation default true + python xml_editor.py usr/share/glib-2.0/schemas/org.gnome.shell.gschema.xml key name enabled-extensions default\ + "['gnome-shell-extension-maximized-by-default@axe1.github.com', 'app-grid-tweaks@Selenium-H']" + glib-compile-schemas usr/share/glib-2.0/schemas \ No newline at end of file diff --git a/elements/custom/gnome_extensions/max_size/max_size.bst b/elements/custom/gnome_extensions/max_size/max_size.bst new file mode 100644 index 0000000000000000000000000000000000000000..61fcecc2481765888a134b2c61cc1ec8608cea1c --- /dev/null +++ b/elements/custom/gnome_extensions/max_size/max_size.bst @@ -0,0 +1,35 @@ +kind: import + +# Stage the files/src directory for building +sources: +- kind: git + url: github:aXe1/gnome-shell-extension-maximized-by-default.git + track: master + ref: 56af23ca3550edfacc6fe88a9caed16953da4b1c + +# The import element simply stages the given sources +# directly to the root of the sandbox and then collects +# the output to create an output artifact. +# +config: + + # By default we collect everything staged, specify a + # directory here to output only a subset of the staged + # input sources. + source: / + + # Prefix the output with an optional directory, by default + # the input is found at the root of the produced artifact. + target: /max_size + +public: + bst: + integration-commands: + - | + UUID=$(cat < ./max_size/src/metadata.json | jq -r '.uuid') + NEW_DIR="/usr/share/gnome-shell/extensions/${UUID}" + mkdir -p ${NEW_DIR} + mv ./max_size/* ${NEW_DIR} + mv ${NEW_DIR}/src/* ${NEW_DIR} + rm -rf ${NEW_DIR}/src/ + rm -rf ./max_size/ \ No newline at end of file diff --git a/elements/custom/gnome_tweaks/gnome_tweaks.bst b/elements/custom/gnome_tweaks/gnome_tweaks.bst new file mode 100644 index 0000000000000000000000000000000000000000..6ed6799ed0b9da7369b591110bfd11fe992fd592 --- /dev/null +++ b/elements/custom/gnome_tweaks/gnome_tweaks.bst @@ -0,0 +1,13 @@ +kind: meson + +depends: +- freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst + +runtime-depends: +- custom/gnome_tweaks/runtime_dependencies/runtime_dependencies.bst + +# Stage the files/src directory for building +sources: +- kind: tar + url: gnome_downloads:gnome-tweaks/40/gnome-tweaks-40.0.tar.xz + ref: f95f3fe031b0b01c02f79a1659f889152d3772ae3e44df8403d1460ba5eec36a \ No newline at end of file diff --git a/elements/custom/gnome_tweaks/runtime_dependencies/runtime_dependencies.bst b/elements/custom/gnome_tweaks/runtime_dependencies/runtime_dependencies.bst new file mode 100644 index 0000000000000000000000000000000000000000..a094d33f12cd751707e023528ea0fed3f4af0505 --- /dev/null +++ b/elements/custom/gnome_tweaks/runtime_dependencies/runtime_dependencies.bst @@ -0,0 +1,38 @@ +kind: import + +sources: +- kind: git + url: freedesktop:xdg/sound-theme-spec + track: master + ref: b38cb3916fbb7243a3f4e78284d5613cc9321c8c + +depends: +- vm/buildstream/python3-fastimport.bst +- sdk/pygobject.bst +- core/gnome-settings-daemon.bst +- sdk/glib.bst +- sdk/gtk.bst +- core/gnome-desktop.bst +- sdk/libhandy.bst +- sdk/libsoup.bst +- sdk/libnotify.bst +- sdk/pango.bst +- sdk/gsettings-desktop-schemas.bst +- core/gnome-shell.bst +- core/mutter.bst +- core/gnome-software.bst +- core/nautilus.bst + +# The import element simply stages the given sources +# directly to the root of the sandbox and then collects +# the output to create an output artifact. +config: + + # By default we collect everything staged, specify a + # directory here to output only a subset of the staged + # input sources. + source: / + + # Prefix the output with an optional directory, by default + # the input is found at the root of the produced artifact. + target: /gnome_tweaks/runtime_dependencies \ No newline at end of file diff --git a/elements/custom/gsettings/gsettings.bst b/elements/custom/gsettings/gsettings.bst new file mode 100644 index 0000000000000000000000000000000000000000..77ceb018183f533a3814790ebf16ebf5cc838113 --- /dev/null +++ b/elements/custom/gsettings/gsettings.bst @@ -0,0 +1,11 @@ +kind: stack + +depends: +- custom/utility/xml_editor/xml_editor.bst + +public: + bst: + integration-commands: + - python xml_editor.py usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml key name text-scaling-factor default 1.50 + - python xml_editor.py usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml key name scaling-factor default 1 + - glib-compile-schemas usr/share/glib-2.0/schemas \ No newline at end of file diff --git a/elements/custom/iw.bst b/elements/custom/iw.bst new file mode 100644 index 0000000000000000000000000000000000000000..2abe3bb7911145e8089591bed0b146ecefc6f123 --- /dev/null +++ b/elements/custom/iw.bst @@ -0,0 +1,13 @@ +# iw +kind: make +sources: +- kind: git + url: https://git.sipsolutions.net/iw.git + track: v5.19 + ref: c2a322113d5b4320ce39823d96dce8ac527a397a +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst +- freedesktop-sdk.bst:components/pkg-config.bst +- freedesktop-sdk.bst:components/gzip.bst +depends: +- freedesktop-sdk.bst:components/libnl.bst diff --git a/elements/custom/jq/jq.bst b/elements/custom/jq/jq.bst new file mode 100644 index 0000000000000000000000000000000000000000..2bb4dc82e3f699cdfe4f6727cafc0ce29e625050 --- /dev/null +++ b/elements/custom/jq/jq.bst @@ -0,0 +1,4 @@ +kind: stack + +depends: +- freedesktop-sdk.bst:components/jq.bst \ No newline at end of file diff --git a/elements/custom/libgpiod.bst b/elements/custom/libgpiod.bst new file mode 100644 index 0000000000000000000000000000000000000000..712391481b01d1ea775b21dfc65f3ce3cdb57f64 --- /dev/null +++ b/elements/custom/libgpiod.bst @@ -0,0 +1,15 @@ +# libgpiod-dev +kind: autotools +sources: +- kind: git + url: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git + track: v1.6.3 + ref: dfc5d361e6748d5f48b706e5c4ac949d133b5470 +build-depends: +- freedesktop-sdk.bst:bootstrap-import.bst +- freedesktop-sdk.bst:public-stacks/buildsystem-autotools.bst +#depends: + +variables: + conf-local: --enable-tools=yes + diff --git a/elements/custom/utility/removal/removal.bst b/elements/custom/utility/removal/removal.bst new file mode 100644 index 0000000000000000000000000000000000000000..6cf6a571fb854b4d94f5a3b4022df27e571001be --- /dev/null +++ b/elements/custom/utility/removal/removal.bst @@ -0,0 +1,6 @@ +kind: stack + +public: + bst: + integration-commands: + - rm xml_editor.py \ No newline at end of file diff --git a/elements/custom/utility/xml_editor/xml_editor.bst b/elements/custom/utility/xml_editor/xml_editor.bst new file mode 100644 index 0000000000000000000000000000000000000000..7889c7787b2b0862a607b04b2221ab6b87cb0fec --- /dev/null +++ b/elements/custom/utility/xml_editor/xml_editor.bst @@ -0,0 +1,21 @@ +kind: import + +# Stage the files/src directory for building +sources: +- kind: tar + url: gnome_gitlab:tanvirroshid/gnome-os-text-scaling-factor-edit/-/archive/core/gnome-os-text-scaling-factor-edit-core.tar + ref: b24642535b2f63ccb770dc924bb7e1be2572ec86de5fa62e1dc2edac2398c9ae + +# The import element simply stages the given sources +# directly to the root of the sandbox and then collects +# the output to create an output artifact. +config: + + # By default we collect everything staged, specify a + # directory here to output only a subset of the staged + # input sources. + source: / + + # Prefix the output with an optional directory, by default + # the input is found at the root of the produced artifact. + target: / \ No newline at end of file diff --git a/elements/sdk/gsettings-desktop-schemas.bst b/elements/sdk/gsettings-desktop-schemas.bst index de2b13faf48898a7468147473f592a8416bf40b2..e2c18c95f9d98033f872abe386a934940da0fc16 100644 --- a/elements/sdk/gsettings-desktop-schemas.bst +++ b/elements/sdk/gsettings-desktop-schemas.bst @@ -4,6 +4,7 @@ sources: - kind: tar url: gnome_downloads:gsettings-desktop-schemas/42/gsettings-desktop-schemas-42.0.tar.xz ref: 6686335a9ed623f7ae2276fefa50a410d4e71d4231880824714070cb317323d2 + build-depends: - sdk/gobject-introspection.bst - freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst diff --git a/elements/vm/vpnc-scripts.bst b/elements/vm/vpnc-scripts.bst index 916e6604a0eda9ab3b6454dc8d1aef8b6435d2cf..42b1b5c0fb679e059ac8e894ea584cb2a6c08911 100644 --- a/elements/vm/vpnc-scripts.bst +++ b/elements/vm/vpnc-scripts.bst @@ -5,7 +5,7 @@ sources: url: gitlab:openconnect/vpnc-scripts.git track: master - ref: e52f8e66391c4c55ee818841d236ebbb6ae284ed + ref: 918fe78b617c9c6b07ea3abe6426881bc8727789 config: install-commands: - | diff --git a/elements/world/libseat.bst b/elements/world/libseat.bst index 4bed26b16e4c78cbed1d857522985b5378362409..578b37a28d54feb9298c8eb4d00a76e08a626f93 100644 --- a/elements/world/libseat.bst +++ b/elements/world/libseat.bst @@ -4,6 +4,7 @@ sources: - kind: tar url: github_files:kennylevinsen/seatd/archive/refs/tags/0.6.3.tar.gz + ref: 5226850c163b485aebe71da0d3f4941761637e146a5c9393cb40c52617ad84a8 build-depends: - freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst diff --git a/elements/world/phoc.bst b/elements/world/phoc.bst index 81c951e64ffdad74c1cf3dc637ebd21845345855..529d7077d68633dae2304bae132ee9831a1e4af2 100644 --- a/elements/world/phoc.bst +++ b/elements/world/phoc.bst @@ -3,8 +3,8 @@ kind: meson sources: - kind: git_tag url: gnome_gitlab:World/Phosh/phoc.git - track: master - + track: v0.13.1 + ref: v0.13.1-0-g4f72cf1e67a3f0f224326b2662b7dedab3f5a8cf build-depends: - freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst diff --git a/elements/world/phosh.bst b/elements/world/phosh.bst index ca7800ce5db8a3ba3b1df13e1391c4fe949e8f74..6bfa348b6b29827ba3f396cba529611652931f79 100644 --- a/elements/world/phosh.bst +++ b/elements/world/phosh.bst @@ -12,6 +12,7 @@ sources: checkout: true url: gnome_gitlab:World/Phosh/libcall-ui.git + ref: v0.20.0_beta2-18-g8bfc3fde433fff9ed751638a6d171277a3635a22 build-depends: - freedesktop-sdk.bst:components/wayland-protocols.bst - freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst diff --git a/elements/world/wlroots.bst b/elements/world/wlroots.bst index ffa29e414f1d260a157830ffc031086719def90a..917f303b448e4dc735d481b7445eed2ad382635e 100644 --- a/elements/world/wlroots.bst +++ b/elements/world/wlroots.bst @@ -2,8 +2,8 @@ kind: meson sources: - kind: tar - url: freedesktop:wlroots/wlroots/-/archive/0.14.1/wlroots-0.14.1.tar.bz2 - + url: https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/0.14.1/wlroots-0.14.1.tar + ref: 966ef91d4318c04c60d072f65c43eb5da0657175cadbf6ab2e985d8b24fe8ead build-depends: - freedesktop-sdk.bst:components/mesa-headers.bst - freedesktop-sdk.bst:components/wayland-protocols.bst diff --git a/files/atinout/0001-make-gcc-happy-by-adding-fallthrough-comment.patch b/files/atinout/0001-make-gcc-happy-by-adding-fallthrough-comment.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce7800fe0b95a26bdae12941f95dbf593c251cb1 --- /dev/null +++ b/files/atinout/0001-make-gcc-happy-by-adding-fallthrough-comment.patch @@ -0,0 +1,25 @@ +From ca2e04f8b069d269172f0d55d3716a809537f696 Mon Sep 17 00:00:00 2001 +From: Beralt Meppelink +Date: Fri, 27 Oct 2017 09:12:18 +0200 +Subject: [PATCH 1/2] make gcc happy by adding fallthrough comment + +--- + atinout.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/atinout.c b/atinout.c +index d04f300..924b5bc 100644 +--- a/atinout.c ++++ b/atinout.c +@@ -150,7 +150,7 @@ static bool is_final_result(const char * const response) + if (strcmp(&response[1], "K\r\n") == 0) { + return true; + } +- /* no break */ ++ // fallthrough + default: + return false; + } +-- +2.23.0 + diff --git a/files/atinout/0002-do-not-rely-on-CR-in-modem-output.patch b/files/atinout/0002-do-not-rely-on-CR-in-modem-output.patch new file mode 100644 index 0000000000000000000000000000000000000000..593dc853812dc467ccb581f100f811070af72938 --- /dev/null +++ b/files/atinout/0002-do-not-rely-on-CR-in-modem-output.patch @@ -0,0 +1,84 @@ +From 65dae46181119867cd8e93ca5b33d3b0cf3df08c Mon Sep 17 00:00:00 2001 +From: Beralt Meppelink +Date: Fri, 27 Oct 2017 10:42:50 +0200 +Subject: [PATCH 2/2] do not rely on CR in modem output + +--- + atinout.c | 24 +++++++++++------------- + 1 file changed, 11 insertions(+), 13 deletions(-) + +diff --git a/atinout.c b/atinout.c +index 924b5bc..4cd7689 100644 +--- a/atinout.c ++++ b/atinout.c +@@ -34,7 +34,6 @@ + + #define MAX_LINE_LENGTH (4 * 1024) + static char buf[MAX_LINE_LENGTH]; +-static char buf2[MAX_LINE_LENGTH]; + + static struct option long_options[] = { + {"help", no_argument, NULL, 'h'}, +@@ -125,36 +124,36 @@ static bool is_final_result(const char * const response) + } + return false; + case 'B': +- if (strcmp(&response[1], "USY\r\n") == 0) { ++ if (strcmp(&response[1], "USY\n") == 0) { + return true; +- } ++ } ++ + return false; + + case 'E': +- if (strcmp(&response[1], "RROR\r\n") == 0) { ++ if (strcmp(&response[1], "RROR\n") == 0) { + return true; + } + return false; + case 'N': +- if (strcmp(&response[1], "O ANSWER\r\n") == 0) { ++ if (strcmp(&response[1], "O ANSWER\n") == 0) { + return true; + } +- if (strcmp(&response[1], "O CARRIER\r\n") == 0) { ++ if (strcmp(&response[1], "O CARRIER\n") == 0) { + return true; + } +- if (strcmp(&response[1], "O DIALTONE\r\n") == 0) { ++ if (strcmp(&response[1], "O DIALTONE\n") == 0) { + return true; + } + return false; + case 'O': +- if (strcmp(&response[1], "K\r\n") == 0) { ++ if (strcmp(&response[1], "K\n") == 0) { + return true; + } + // fallthrough + default: + return false; + } +- + } + + int main(int argc, char *argv[]) +@@ -248,11 +247,10 @@ int main(int argc, char *argv[]) + fprintf(stderr, "EOF from modem\n"); + return EXIT_FAILURE; + } +- strcpy(buf2, line); +- strip_cr(buf2); +- res = fputs(buf2, output); ++ strip_cr(line); ++ res = fputs(line, output); + if (res < 0) { +- fprintf(stderr, "failed to write '%s' to output file (res = %d)\n", buf2, res); ++ fprintf(stderr, "failed to write '%s' to output file (res = %d)\n", line, res); + return EXIT_FAILURE; + } + } while (! is_final_result(line)); +-- +2.23.0 + diff --git a/files/linux/0261-arm64-dts-rk3399-Disable-debug-nodes-they-hang-boot.patch b/files/linux/0261-arm64-dts-rk3399-Disable-debug-nodes-they-hang-boot.patch new file mode 100644 index 0000000000000000000000000000000000000000..a40f40d7bc6fd87f8a85ad3e0aeebfd2855ac9f6 --- /dev/null +++ b/files/linux/0261-arm64-dts-rk3399-Disable-debug-nodes-they-hang-boot.patch @@ -0,0 +1,34 @@ +From 41c607975f65c1e59eb5090bb8d76de7bc371b54 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Thu, 21 Oct 2021 20:24:34 +0200 +Subject: [PATCH 261/520] arm64: dts: rk3399: Disable debug nodes (they hang + boot) + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi +index 080457a68e3c7..515486a1a4a2b 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi +@@ -373,6 +373,7 @@ + status = "disabled"; + }; + ++/* + debug@fe430000 { + compatible = "arm,coresight-cpu-debug", "arm,primecell"; + reg = <0 0xfe430000 0 0x1000>; +@@ -420,6 +421,7 @@ + clock-names = "apb_pclk"; + cpu = <&cpu_b1>; + }; ++*/ + + usbdrd3_0: usb@fe800000 { + compatible = "rockchip,rk3399-dwc3"; +-- +2.36.1 + diff --git a/files/linux/0262-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch b/files/linux/0262-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch new file mode 100644 index 0000000000000000000000000000000000000000..02f49490026b4de5a9dc0cf2115f52ca7235a872 --- /dev/null +++ b/files/linux/0262-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch @@ -0,0 +1,1078 @@ +From 7c4c141a4fd1c0d1eee385882a4a464ec5c5408f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= +Date: Sat, 2 Jan 2021 12:46:14 +0100 +Subject: [PATCH 262/520] arm64: dts: rk3399-pinephone-pro: Add support for + Pinephone Pro +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +TODO: Sumarize Pinephone Pro HW here... + +Signed-of-by: Martijn Braam +Signed-of-by: Kamil TrzciƄski +--- + arch/arm64/boot/dts/rockchip/Makefile | 1 + + .../dts/rockchip/rk3399-pinephone-pro.dts | 1037 +++++++++++++++++ + 2 files changed, 1038 insertions(+) + create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts + +diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile +index 4ae9f35434b8e..c00e7922d9743 100644 +--- a/arch/arm64/boot/dts/rockchip/Makefile ++++ b/arch/arm64/boot/dts/rockchip/Makefile +@@ -41,6 +41,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinephone-pro.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +new file mode 100644 +index 0000000000000..b53df0d1de53d +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -0,0 +1,1037 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2020 Martijn Braam ++ * Copyright (c) 2021 Kamil TrzciƄski ++ */ ++ ++/dts-v1/; ++#include ++#include ++#include ++#include ++#include "rk3399.dtsi" ++#include "rk3399-opp.dtsi" ++ ++#define WITHOUT_CDN_DP // TODO: everything works, but it is simpler to test mipi ++ ++/ { ++ model = "Pine64 PinePhonePro"; ++ compatible = "pine64,pinephone-pro", "rockchip,rk3399"; ++ ++ chosen { ++ bootargs = "earlycon=uart8250,mmio32,0xff1a0000"; ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ adc-keys { ++ compatible = "adc-keys"; ++ io-channels = <&saradc 1>; ++ io-channel-names = "buttons"; ++ keyup-threshold-microvolt = <1600000>; ++ poll-interval = <100>; ++ ++ button-up { ++ label = "Volume Up"; ++ linux,code = ; ++ press-threshold-microvolt = <100000>; ++ }; ++ ++ button-down { ++ label = "Volume Down"; ++ linux,code = ; ++ press-threshold-microvolt = <300000>; ++ }; ++ }; ++ ++ cluster1_opp_ppp: opp-table1b { ++ compatible = "operating-points-v2"; ++ opp-shared; ++ ++ opp00 { ++ opp-hz = /bits/ 64 <408000000>; ++ opp-microvolt = <800000>; ++ clock-latency-ns = <40000>; ++ }; ++ opp01 { ++ opp-hz = /bits/ 64 <600000000>; ++ opp-microvolt = <800000>; ++ }; ++ opp02 { ++ opp-hz = /bits/ 64 <816000000>; ++ opp-microvolt = <825000>; ++ }; ++ opp03 { ++ opp-hz = /bits/ 64 <1008000000>; ++ opp-microvolt = <875000>; ++ }; ++ opp04 { ++ opp-hz = /bits/ 64 <1200000000>; ++ opp-microvolt = <950000>; ++ }; ++ opp05 { ++ opp-hz = /bits/ 64 <1416000000>; ++ opp-microvolt = <1025000>; ++ }; ++ }; ++ ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm0 0 1000000 0>; ++ pwm-delay-us = <10000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&red_led_pin &green_led_pin &blue_led_pin>; ++ ++ led-standby { ++ color = ; ++ default-state = "off"; ++ function = LED_FUNCTION_STANDBY; ++ gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; ++ label = "red:standby"; ++ panic-indicator; ++ retain-state-suspended; ++ }; ++ ++ led-pwr { ++ color = ; ++ default-state = "on"; ++ function = LED_FUNCTION_POWER; ++ gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>; ++ label = "green:disk-activity"; ++ }; ++ ++ blue-charging { ++ color = ; ++ default-state = "off"; ++ function = LED_FUNCTION_CHARGING; ++ gpios = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>; ++ label = "blue:charging"; ++ }; ++ }; ++ ++ gpio-key-power { ++ compatible = "gpio-keys"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwrbtn_pin>; ++ ++ power { ++ debounce-interval = <20>; ++ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; ++ label = "Power"; ++ linux,code = ; ++ wakeup-source; ++ }; ++ }; ++ ++ sdio_pwrseq: sdio-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rk818 1>; ++ clock-names = "ext_clock"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_enable_h>; ++ post-power-on-delay-ms = <100>; ++ power-off-delay-us = <500000>; ++ ++ /* WL_REG_ON on module */ ++ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ vibrator { ++ compatible = "gpio-vibrator"; ++ enable-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>; ++ vcc-supply = <&vcc3v3_sys>; ++ }; ++ ++ /* Power tree */ ++ /* Root power source */ ++ vcc_sysin: vcc-sysin { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_sysin"; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ ++ vcc5v0_sys: vcc5v0-host-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_sys"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc_sysin>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc5v0_typec: vcc5v0-typec-regulator { ++ compatible = "regulator-fixed"; ++ //enable-active-high; ++ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_typec_en>; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-name = "vcc5v0_typec"; ++ vin-supply = <&vcc5v0_sys>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ /* Main 3.3v supply */ ++ vcc3v3_sys: wifi_bat: vcc3v3-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc_sysin>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc1v8_codec: vcc1v8-codec-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc1v8_codec_en>; ++ regulator-name = "vcc1v8_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ /* micro SD card power */ ++ vcc3v0_sd: vcc3v0-sd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_pwr_h>; ++ regulator-name = "vcc3v0_sd"; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ vin-supply = <&vcc3v3_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ /* MIPI DSI panel 1.8v supply */ ++ vcc1v8_lcd: vcc1v8-lcd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ regulator-name = "vcc1v8_lcd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&display_pwren1>; ++ }; ++ ++ /* MIPI DSI panel 2.8v supply */ ++ vcc2v8_lcd: vcc2v8-lcd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ regulator-name = "vcc2v8_lcd"; ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ vin-supply = <&vcc3v3_sys>; ++ gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&display_pwren>; ++ }; ++ ++ vcca1v8_s3: vcc1v8-s3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcca1v8_s3"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++}; ++ ++&cpu_l0 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l1 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l2 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l3 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_b0 { ++ cpu-supply = <&vdd_cpu_b>; ++ operating-points-v2 = <&cluster1_opp_ppp>; ++}; ++ ++&cpu_b1 { ++ cpu-supply = <&vdd_cpu_b>; ++ operating-points-v2 = <&cluster1_opp_ppp>; ++}; ++ ++#ifndef WITHOUT_CDN_DP ++&cdn_dp { ++ status = "okay"; ++ extcon = <&fusb0>; ++}; ++#endif ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&i2c0 { ++ clock-frequency = <400000>; ++ i2c-scl-rising-time-ns = <168>; ++ i2c-scl-falling-time-ns = <4>; ++ status = "okay"; ++ ++ rk818: pmic@1c { ++ compatible = "rockchip,rk818"; ++ reg = <0x1c>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ #clock-cells = <1>; ++ clock-output-names = "xin32k", "rk808-clkout2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int_l>; ++ rockchip,system-power-controller; ++ wakeup-source; ++ extcon = <&fusb0>; ++ ++ vcc1-supply = <&vcc_sysin>; ++ vcc2-supply = <&vcc_sysin>; ++ vcc3-supply = <&vcc_sysin>; ++ vcc4-supply = <&vcc_sysin>; ++ vcc6-supply = <&vcc_sysin>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc_sysin>; ++ vcc9-supply = <&vcc3v3_sys>; ++ ++ regulators { ++ vdd_cpu_l: DCDC_REG1 { ++ regulator-name = "vdd_cpu_l"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_center: DCDC_REG2 { ++ regulator-name = "vdd_center"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: vcc_wl: DCDC_REG4 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcca3v0_codec: LDO_REG1 { ++ regulator-name = "vcca3v0_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v0_touch: LDO_REG2 { ++ regulator-name = "vcc3v0_touch"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_codec: LDO_REG3 { ++ regulator-name = "vcca1v8_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_power_on: LDO_REG4 { ++ regulator-name = "vcc_power_on"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcc_3v0: LDO_REG5 { ++ regulator-name = "vcc_3v0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcc_1v5: LDO_REG6 { ++ regulator-name = "vcc_1v5"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1500000>; ++ }; ++ }; ++ ++ vcc1v8_dvp: LDO_REG7 { ++ regulator-name = "vcc1v8_dvp"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_s3: LDO_REG8 { ++ regulator-name = "vcc3v3_s3"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_sd: LDO_REG9 { ++ regulator-name = "vcc_sd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcc3v3_s0: SWITCH_REG { ++ regulator-name = "vcc3v3_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ boost_otg: DCDC_BOOST { ++ regulator-name = "boost_otg"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <5000000>; ++ }; ++ }; ++ ++ otg_switch: OTG_SWITCH { ++ regulator-name = "otg_switch"; ++ // TODO: This requires a proper rk818-charger implementation ++ // without this always-on the type-c is not powered on ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ }; ++ ++ battery { ++ compatible = "rk818-battery"; ++ ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780 ++ 3793 3807 3827 3853 3896 3937 3974 4007 4066 ++ 4110 4161 4217 4308>; ++ design_capacity = <2916>; ++ design_qmax = <2708>; ++ bat_res = <65>; ++ max_input_current = <3000>; ++ max_chrg_current = <3000>; ++ max_chrg_voltage = <4350>; ++ sleep_enter_current = <300>; ++ sleep_exit_current = <300>; ++ power_off_thresd = <3400>; ++ zero_algorithm_vol = <3950>; ++ fb_temperature = <105>; ++ sample_res = <20>; ++ max_soc_offset = <60>; ++ energy_mode = <0>; ++ monitor_sec = <5>; ++ virtual_power = <0>; ++ power_dc2otg = <0>; ++ otg5v_suspend_enable = <1>; ++ }; ++ }; ++ ++ vdd_cpu_b: regulator@40 { ++ compatible = "silergy,syr827"; ++ reg = <0x40>; ++ fcs,suspend-voltage-selector = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel1_pin>; ++ regulator-name = "vdd_cpu_b"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: regulator@41 { ++ compatible = "silergy,syr828"; ++ reg = <0x41>; ++ fcs,suspend-voltage-selector = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel2_pin>; ++ regulator-name = "vdd_gpu"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++}; ++ ++&i2c1 { ++ i2c-scl-rising-time-ns = <300>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "okay"; ++}; ++ ++&i2c3 { ++ i2c-scl-rising-time-ns = <450>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "okay"; ++ ++ touchscreen@14 { ++ compatible = "goodix,gt917s"; ++ reg = <0x14>; ++ interrupt-parent = <&gpio3>; ++ interrupts = ; ++ irq-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>; ++ AVDD28-supply = <&vcc3v0_touch>; ++ VDDIO-supply = <&vcc3v0_touch>; ++ touchscreen-size-x = <720>; ++ touchscreen-size-y = <1440>; ++ }; ++ ++ light-sensor@48 { ++ compatible = "sensortek,stk3311"; ++ reg = <0x48>; ++ interrupt-parent = <&gpio4>; ++ interrupts = ; ++ vdd-supply = <&vcc_3v0>; ++ leda-supply = <&vcc_3v0>; ++ }; ++}; ++ ++&i2c4 { ++ i2c-scl-rising-time-ns = <600>; ++ i2c-scl-falling-time-ns = <20>; ++ status = "okay"; ++ ++ fusb0: typec-portc@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&fusb0_int>; ++ vbus-supply = <&vcc5v0_typec>; ++ status = "okay"; ++ ++ connector { ++ compatible = "usb-c-connector"; ++ data-role = "dual"; ++ label = "USB-C"; ++ op-sink-microwatt = <1000000>; ++ power-role = "dual"; ++ sink-pdos = ++ ; ++ source-pdos = ++ ; ++ try-power-role = "sink"; ++ ++ extcon-cables = <1 2 5 6 9 10 12 44>; ++ typec-altmodes = <0xff01 1 0x001c0c00 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ ++ usbc_hs: endpoint { ++ remote-endpoint = ++ <&u2phy0_typec_hs>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ ++ usbc_ss: endpoint { ++ remote-endpoint = ++ <&tcphy0_typec_ss>; ++ }; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ ++ usbc_dp: endpoint { ++ remote-endpoint = ++ <&tcphy0_typec_dp>; ++ }; ++ }; ++ }; ++ }; ++ }; ++ ++ accelerometer@68 { ++ compatible = "invensense,mpu6500"; ++ reg = <0x68>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ vdd-supply = <&vcc_1v8>; ++ vddio-supply = <&vcc_1v8>; ++ ++ mount-matrix = ++ "1", "0", "0", ++ "0", "-1", "0", ++ "0", "0", "1"; ++ }; ++ ++ lis3mdl: magnetometer@1e { ++ compatible = "st,lis3mdl-magn"; ++ reg = <0x1c>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ vdd-supply = <&vcc3v3_sys>; ++ vddio-supply = <&vcc_1v8>; ++ }; ++ ++ // not populated currently ++ ak09911: compass@0c { ++ compatible = "asahi-kasei,ak09911"; ++ reg = <0x0c>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ vdd-supply = <&vcc_3v0>; ++ vid-supply = <&vcc_1v8>; ++ }; ++}; ++ ++&io_domains { ++ status = "okay"; ++ ++ bt656-supply = <&vcc1v8_dvp>; ++ audio-supply = <&vcca1v8_codec>; ++ sdmmc-supply = <&vcc_sd>; ++ gpio1830-supply = <&vcc_3v0>; ++}; ++ ++&mipi_dsi { ++ status = "okay"; ++ clock-master; ++ ++ ports { ++ mipi_out: port@1 { ++ reg = <1>; ++ ++ mipi_out_panel: endpoint { ++ remote-endpoint = <&mipi_in_panel>; ++ }; ++ }; ++ }; ++ ++ panel { ++ compatible = "hannstar,hsd060bhw4"; ++ reg = <0>; ++ backlight = <&backlight>; ++ reset-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_LOW>; ++ vcc-supply = <&vcc2v8_lcd>; // 2v8 ++ iovcc-supply = <&vcc1v8_lcd>; // 1v8 ++ pinctrl-names = "default"; ++ pinctrl-0 = <&display_rst_l>; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ reg = <0>; ++ ++ mipi_in_panel: endpoint { ++ remote-endpoint = <&mipi_out_panel>; ++ }; ++ }; ++ }; ++}; ++ ++ ++&pmu_io_domains { ++ pmu1830-supply = <&vcc_3v0>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ bt { ++ bt_enable_h: bt-enable-h { ++ rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ bt_host_wake_l: bt-host-wake-l { ++ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ bt_wake_l: bt-wake-l { ++ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ buttons { ++ pwrbtn_pin: pwrbtn-pin { ++ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ fusb302x { ++ fusb0_int: fusb0-int { ++ rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ leds { ++ red_led_pin: red-led-pin { ++ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ green_led_pin: green-led-pin { ++ rockchip,pins = <4 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ blue_led_pin: blue-led-pin { ++ rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int_l: pmic-int-l { ++ rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ vsel1_pin: vsel1-pin { ++ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ vsel2_pin: vsel2-pin { ++ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ sdcard { ++ sdmmc0_pwr_h: sdmmc0-pwr-h { ++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ }; ++ ++ sdio-pwrseq { ++ wifi_enable_h: wifi-enable-h { ++ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ usb-typec { ++ vcc5v0_typec_en: vcc5v0_typec_en { ++ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ dsi { ++ display_rst_l: display-rst-l { ++ rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ display_pwren: display-pwren { ++ rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ display_pwren1: display-pwren1 { ++ rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ sound { ++ vcc1v8_codec_en: vcc1v8-codec-en { ++ rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++}; ++ ++&pwm0 { ++ status = "okay"; ++}; ++ ++&pwm1 { ++ status = "okay"; ++}; ++ ++&pwm2 { ++ status = "okay"; ++}; ++ ++&saradc { ++ vref-supply = <&vcca1v8_s3>; ++ status = "okay"; ++}; ++ ++&sdio0 { ++ bus-width = <4>; ++ cap-sd-highspeed; ++ cap-sdio-irq; ++ disable-wp; ++ keep-power-in-suspend; ++ mmc-pwrseq = <&sdio_pwrseq>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; ++ sd-uhs-sdr104; ++ status = "okay"; ++}; ++ ++&sdmmc { ++ bus-width = <4>; ++ cap-sd-highspeed; ++ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ max-frequency = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; ++ vmmc-supply = <&vcc3v0_sd>; ++ vqmmc-supply = <&vcc_sd>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ mmc-hs200-1_8v; ++ non-removable; ++ status = "okay"; ++}; ++ ++&tcphy0 { ++ extcon = <&fusb0>; ++ status = "okay"; ++}; ++ ++&tcphy0_dp { ++ port { ++ tcphy0_typec_dp: endpoint { ++ remote-endpoint = <&usbc_dp>; ++ }; ++ }; ++}; ++ ++&tcphy0_usb3 { ++ port { ++ tcphy0_typec_ss: endpoint { ++ remote-endpoint = <&usbc_ss>; ++ }; ++ }; ++}; ++ ++&tsadc { ++ /* tshut mode 0:CRU 1:GPIO */ ++ rockchip,hw-tshut-mode = <1>; ++ /* tshut polarity 0:LOW 1:HIGH */ ++ rockchip,hw-tshut-polarity = <1>; ++ status = "okay"; ++}; ++ ++&u2phy0 { ++ status = "okay"; ++ ++ u2phy0_otg: otg-port { ++ status = "okay"; ++ }; ++ ++ u2phy0_host: host-port { ++ status = "okay"; ++ phy-supply = <&vcc5v0_sys>; ++ }; ++ ++ port { ++ u2phy0_typec_hs: endpoint { ++ remote-endpoint = <&usbc_hs>; ++ }; ++ }; ++}; ++ ++&u2phy1 { ++ status = "okay"; ++ ++ u2phy1_otg: otg-port { ++ status = "okay"; ++ }; ++ ++ u2phy1_host: host-port { ++ status = "okay"; ++ phy-supply = <&vcc5v0_sys>; ++ }; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; ++ uart-has-rtscts; ++ status = "okay"; ++ ++ bluetooth { ++ compatible = "brcm,bcm4345c5"; ++ clocks = <&rk818 1>; ++ clock-names = "lpo"; ++ device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>; ++ host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; ++ max-speed = <1500000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>; ++ shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; ++ vbat-supply = <&wifi_bat>; ++ vddio-supply = <&vcc_wl>; ++ }; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usbdrd3_0 { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_0 { ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ ++&vopb { ++ status = "okay"; ++}; ++ ++&vopb_mmu { ++ status = "okay"; ++}; ++ ++&vopl { ++ status = "okay"; ++}; ++ ++&vopl_mmu { ++ status = "okay"; ++}; +\ No newline at end of file +-- +2.36.1 + diff --git a/files/linux/0263-arm64-dts-rk3399-pinephone-pro-Fix-blue-LED-gpio.patch b/files/linux/0263-arm64-dts-rk3399-pinephone-pro-Fix-blue-LED-gpio.patch new file mode 100644 index 0000000000000000000000000000000000000000..a9410ffe67ce3a4e217996f8beb74834971ae98e --- /dev/null +++ b/files/linux/0263-arm64-dts-rk3399-pinephone-pro-Fix-blue-LED-gpio.patch @@ -0,0 +1,28 @@ +From 73464864d70b79ce3d223c65b1e11b5113bd44ac Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Sun, 2 Jan 2022 22:02:44 +0100 +Subject: [PATCH 263/520] arm64: dts: rk3399-pinephone-pro: Fix blue LED gpio + +The GPIO was defined incorrectly. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index b53df0d1de53d..26dca78236a91 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -107,7 +107,7 @@ + color = ; + default-state = "off"; + function = LED_FUNCTION_CHARGING; +- gpios = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>; ++ gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>; + label = "blue:charging"; + }; + }; +-- +2.36.1 + diff --git a/files/linux/0264-arm64-dts-rk3399-pinephone-pro-Fixup-DT-validation-i.patch b/files/linux/0264-arm64-dts-rk3399-pinephone-pro-Fixup-DT-validation-i.patch new file mode 100644 index 0000000000000000000000000000000000000000..5cebc07082daeee6bce4d0a3063826045e690442 --- /dev/null +++ b/files/linux/0264-arm64-dts-rk3399-pinephone-pro-Fixup-DT-validation-i.patch @@ -0,0 +1,105 @@ +From 920fbda44e1ab8ff715925a4a7671d5b06b56c0b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Wed, 22 Sep 2021 19:30:39 +0200 +Subject: [PATCH 264/520] arm64: dts: rk3399-pinephone-pro: Fixup DT validation + issues + +Fixes: + +rk3399-pinephone-pro.dts:751.4-14: Warning (reg_format): /mipi@ff960000/panel/port:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) +rk3399-pinephone-pro.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' +rk3399-pinephone-pro.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' +rk3399-pinephone-pro.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' +rk3399-pinephone-pro.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' +rk3399-pinephone-pro.dts:747.8-756.5: Warning (avoid_default_addr_size): /mipi@ff960000/panel/port: Relying on default #address-cells value +rk3399-pinephone-pro.dts:747.8-756.5: Warning (avoid_default_addr_size): /mipi@ff960000/panel/port: Relying on default #size-cells value +rk3399-pinephone-pro.dts:747.8-756.5: Warning (graph_port): /mipi@ff960000/panel/port: graph node unit address error, expected "0" +rk3399-pinephone-pro.dts:748.4-25: Warning (graph_port): /mipi@ff960000/panel/port:#address-cells: graph node '#address-cells' is -1, must be 1 +rk3399-pinephone-pro.dts:749.4-22: Warning (graph_port): /mipi@ff960000/panel/port:#size-cells: graph node '#size-cells' is -1, must be 0 + +Signed-off-by: Ondrej Jirman +--- + .../boot/dts/rockchip/rk3399-pinephone-pro.dts | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 26dca78236a91..8119ac22966b7 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -626,7 +626,6 @@ + pinctrl-names = "default"; + pinctrl-0 = <&fusb0_int>; + vbus-supply = <&vcc5v0_typec>; +- status = "okay"; + + connector { + compatible = "usb-c-connector"; +@@ -691,23 +690,25 @@ + "0", "0", "1"; + }; + +- lis3mdl: magnetometer@1e { ++ lis3mdl: magnetometer@1c { + compatible = "st,lis3mdl-magn"; + reg = <0x1c>; + interrupt-parent = <&gpio1>; + interrupts = ; + vdd-supply = <&vcc3v3_sys>; + vddio-supply = <&vcc_1v8>; ++ status = "disabled"; + }; + + // not populated currently +- ak09911: compass@0c { ++ ak09911: compass@c { + compatible = "asahi-kasei,ak09911"; + reg = <0x0c>; + interrupt-parent = <&gpio1>; + interrupts = ; + vdd-supply = <&vcc_3v0>; + vid-supply = <&vcc_1v8>; ++ status = "disabled"; + }; + }; + +@@ -726,6 +727,8 @@ + + ports { + mipi_out: port@1 { ++ #address-cells = <0>; ++ #size-cells = <0>; + reg = <1>; + + mipi_out_panel: endpoint { +@@ -734,7 +737,7 @@ + }; + }; + +- panel { ++ panel@0 { + compatible = "hannstar,hsd060bhw4"; + reg = <0>; + backlight = <&backlight>; +@@ -745,11 +748,6 @@ + pinctrl-0 = <&display_rst_l>; + + port { +- #address-cells = <1>; +- #size-cells = <0>; +- +- reg = <0>; +- + mipi_in_panel: endpoint { + remote-endpoint = <&mipi_out_panel>; + }; +@@ -757,7 +755,6 @@ + }; + }; + +- + &pmu_io_domains { + pmu1830-supply = <&vcc_3v0>; + status = "okay"; +-- +2.36.1 + diff --git a/files/linux/0265-arm64-dts-rk3399-pinephone-pro-Make-charging-and-per.patch b/files/linux/0265-arm64-dts-rk3399-pinephone-pro-Make-charging-and-per.patch new file mode 100644 index 0000000000000000000000000000000000000000..0687d9bb9d946d5e40f67b67bbadd36249e8edbf --- /dev/null +++ b/files/linux/0265-arm64-dts-rk3399-pinephone-pro-Make-charging-and-per.patch @@ -0,0 +1,38 @@ +From bf713beda13d6fcf8519ed15915d3db6e11e10d8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Mon, 11 Oct 2021 17:32:31 +0200 +Subject: [PATCH 265/520] arm64: dts: rk3399-pinephone-pro: Make charging and + peripheral mode work + +Signed-of-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 8119ac22966b7..420a86d0cb7a7 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -511,8 +511,8 @@ + regulator-name = "otg_switch"; + // TODO: This requires a proper rk818-charger implementation + // without this always-on the type-c is not powered on +- regulator-always-on; +- regulator-boot-on; ++ //regulator-always-on; ++ //regulator-boot-on; + }; + }; + +@@ -1013,7 +1013,7 @@ + }; + + &usbdrd_dwc3_0 { +- dr_mode = "host"; ++ dr_mode = "peripheral"; + status = "okay"; + }; + +-- +2.36.1 + diff --git a/files/linux/0266-arm64-dts-rk3399-pinephone-pro-Fix-goodix-toucscreen.patch b/files/linux/0266-arm64-dts-rk3399-pinephone-pro-Fix-goodix-toucscreen.patch new file mode 100644 index 0000000000000000000000000000000000000000..9ebb5ca227dc3384f39c45ec54d02f21f52bf300 --- /dev/null +++ b/files/linux/0266-arm64-dts-rk3399-pinephone-pro-Fix-goodix-toucscreen.patch @@ -0,0 +1,34 @@ +From a02fc8bbdfdec891fa31c0be30dae0dee98cc72f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Mon, 18 Oct 2021 03:55:15 +0200 +Subject: [PATCH 266/520] arm64: dts: rk3399-pinephone-pro: Fix goodix + toucscreen interrupts + +The interrupt type read from the screen does not work well. It generates +constant stream of interrupts. + +Change to rising edge interrupt, and enforce it in the driver via +'use-dt-irq-flags'. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 420a86d0cb7a7..d07a06afa4852 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -594,7 +594,8 @@ + compatible = "goodix,gt917s"; + reg = <0x14>; + interrupt-parent = <&gpio3>; +- interrupts = ; ++ interrupts = ; ++ use-dt-irq-flags; + irq-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_HIGH>; + AVDD28-supply = <&vcc3v0_touch>; +-- +2.36.1 + diff --git a/files/linux/0267-arm64-dts-rk3399-pinephone-pro-Correct-the-pmu1830-i.patch b/files/linux/0267-arm64-dts-rk3399-pinephone-pro-Correct-the-pmu1830-i.patch new file mode 100644 index 0000000000000000000000000000000000000000..0ec0ce7fb56fcd392996ee3836db2cf32f3ecfb0 --- /dev/null +++ b/files/linux/0267-arm64-dts-rk3399-pinephone-pro-Correct-the-pmu1830-i.patch @@ -0,0 +1,30 @@ +From 17deafe3ec6f972e5acd539956a773921dca02d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Mon, 18 Oct 2021 03:57:56 +0200 +Subject: [PATCH 267/520] arm64: dts: rk3399-pinephone-pro: Correct the pmu1830 + io-domain supply + +It's connected to vcc_1v8 according to datasheet. Credits to carlos +for noticing! + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index d07a06afa4852..f8fab58259c0a 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -757,7 +757,7 @@ + }; + + &pmu_io_domains { +- pmu1830-supply = <&vcc_3v0>; ++ pmu1830-supply = <&vcc_1v8>; + status = "okay"; + }; + +-- +2.36.1 + diff --git a/files/linux/0268-arm64-dts-rk3399-pinephone-pro-Power-off-goodix-touc.patch b/files/linux/0268-arm64-dts-rk3399-pinephone-pro-Power-off-goodix-touc.patch new file mode 100644 index 0000000000000000000000000000000000000000..f7c217bf9e6156d4cba682a61c5e80ad0ffd5842 --- /dev/null +++ b/files/linux/0268-arm64-dts-rk3399-pinephone-pro-Power-off-goodix-touc.patch @@ -0,0 +1,29 @@ +From 88b03288a94034f459c496ccd00babc7c0dca0a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Mon, 18 Oct 2021 03:58:56 +0200 +Subject: [PATCH 268/520] arm64: dts: rk3399-pinephone-pro: Power off goodix + touchscreen in sleep + +Otherwise it consumes 200mW of power when touched during system sleep. +It can't wake up the phone anyway. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index f8fab58259c0a..2e1eeb616e46f 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -602,6 +602,7 @@ + VDDIO-supply = <&vcc3v0_touch>; + touchscreen-size-x = <720>; + touchscreen-size-y = <1440>; ++ poweroff-in-suspend; + }; + + light-sensor@48 { +-- +2.36.1 + diff --git a/files/linux/0440-arm64-dts-rk3399-pinephone-pro-Add-support-for-both-.patch b/files/linux/0440-arm64-dts-rk3399-pinephone-pro-Add-support-for-both-.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce841ccf4e49c18b0a2450aa8cb46ff68bc4f4f1 --- /dev/null +++ b/files/linux/0440-arm64-dts-rk3399-pinephone-pro-Add-support-for-both-.patch @@ -0,0 +1,219 @@ +From 5314a56cab68cd9c4a9a0f2ef505f2193de1aa0c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Thu, 21 Oct 2021 20:25:35 +0200 +Subject: [PATCH 440/520] arm64: dts: rk3399-pinephone-pro: Add support for + both cameras + +IMX258 + OV5640. + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 163 +++++++++++++++++- + 1 file changed, 159 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 2e1eeb616e46f..2ecb6bac5bb25 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -456,8 +456,6 @@ + + vcc1v8_dvp: LDO_REG7 { + regulator-name = "vcc1v8_dvp"; +- regulator-always-on; +- regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { +@@ -579,10 +577,105 @@ + }; + }; + ++/* ++ * Cameras: ++ * ++ * cif clk out = gpio2 B3 / CIF_CLKOUTA_u ++ * ++ * both on i2c1 GPIO4_A1 (SDA) / GPIO4_A2 (SCL) ++ * ++ * both share power: ++ * VCC1V8_DVP - LDO7 - supplied by VCC7 (VCC3V3_SYS) ++ * DVDD_DVP 1.5V - autoenabled by VCC2V8_DVP depends on VCC1V8_S3 (U118 supplies 1.2V, though, not 1.5V) ++ * VCC2V8_DVP af - autoenabled by VCC1V8_DVP depends on VCC3V3_SYS ++ * AVDD2V8_DVP - autoenabled by VCC1V8_DVP depends on VCC3V3_SYS ++ * ++ * isp1 = imx258 ++ * reset = GPIO1_A0 ++ * powerdown = GPIO2_B4 ++ * ++ * isp0 = OV8858 ++ * powerdown = GPIO2_D4 ++ * reset = GPIO1_A4 ++ */ + &i2c1 { ++ status = "okay"; ++ ++ clock-frequency = <400000>; + i2c-scl-rising-time-ns = <300>; + i2c-scl-falling-time-ns = <15>; +- status = "okay"; ++ ++ pinctrl-0 = <&i2c1_xfer &cif_clkouta>; ++ ++ assigned-clocks = <&cru SCLK_CIF_OUT &cru SCLK_CIF_OUT_SRC>; ++ assigned-clock-parents = <&cru SCLK_CIF_OUT_SRC &cru PLL_GPLL>; ++ assigned-clock-rates = <19200000 0>; ++ ++ wcam: camera@1a { ++ compatible = "sony,imx258"; ++ reg = <0x1a>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wcam_rst &wcam_pdn>; ++ ++ clocks = <&cru SCLK_CIF_OUT>; ++ clock-names = "xvclk"; ++ ++ vif-supply = <&vcc1v8_dvp>; ++ i2c-supply = <&vcca1v8_codec>; ++ /*XXX: also depends on vcca1v8_codec for I2C bus power (currently always on) */ ++ ++ reset-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_LOW>; ++ powerdown-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>; ++ ++ rotation = <180>; ++ ++ lens-focus = <&wcam_lens>; ++ flash-leds = <&sgm3140_flash>; ++ ++ port { ++ wcam_out: endpoint { ++ remote-endpoint = <&mipi_in_wcam>; ++ data-lanes = <1 2 3 4>; ++ }; ++ }; ++ }; ++ ++ wcam_lens: camera-lens@c { ++ compatible = "dongwoon,dw9714"; ++ reg = <0x0c>; ++ vcc-supply = <&vcc1v8_dvp>; ++ }; ++ ++ ucam: camera@36 { ++ compatible = "ovti,ov8858"; ++ reg = <0x36>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ucam_pdn &ucam_rst>; ++ ++ clocks = <&cru SCLK_CIF_OUT>; ++ clock-names = "xvclk"; ++ ++ dovdd-supply = <&vcc1v8_dvp>; ++ /*XXX: also depends on vcca1v8_codec for I2C bus power */ ++ ++ reset-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_LOW>; ++ powerdown-gpios = <&gpio2 RK_PB4 GPIO_ACTIVE_LOW>; ++ ++ /* we're using forward ported BSP driver, thus: */ ++ rockchip,camera-module-index = <0x00>; ++ rockchip,camera-module-facing = "front"; ++ rockchip,camera-module-name = "CameraKing"; ++ rockchip,camera-module-lens-name = "Largan-9569A2"; ++ ++ rotation = <180>; ++ ++ port { ++ ucam_out: endpoint { ++ remote-endpoint = <&mipi_in_ucam>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; + }; + + &i2c3 { +@@ -723,6 +816,50 @@ + gpio1830-supply = <&vcc_3v0>; + }; + ++&isp1 { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ mipi_in_wcam: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&wcam_out>; ++ data-lanes = <1 2 3 4>; ++ }; ++ }; ++ }; ++}; ++ ++&mipi_dphy_rx0 { ++ status = "okay"; ++}; ++ ++&isp0 { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ mipi_in_ucam: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&ucam_out>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++}; ++ ++&isp0_mmu { ++ status = "okay"; ++}; ++ ++&isp1_mmu { ++ status = "okay"; ++}; ++ ++&mipi_dsi1 { ++ status = "okay"; ++}; ++ + &mipi_dsi { + status = "okay"; + clock-master; +@@ -783,6 +920,24 @@ + }; + }; + ++ camera { ++ wcam_rst: wcam-rst { ++ rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wcam_pdn: wcam-pdn { ++ rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ ucam_rst: ucam-rst { ++ rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ ucam_pdn: ucam-pdn { ++ rockchip,pins = <2 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ + fusb302x { + fusb0_int: fusb0-int { + rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; +@@ -1033,4 +1188,4 @@ + + &vopl_mmu { + status = "okay"; +-}; +\ No newline at end of file ++}; +-- +2.36.1 + diff --git a/files/linux/0441-arm64-dts-rk3399-pinephone-pro-Fix-SD-card-power-sup.patch b/files/linux/0441-arm64-dts-rk3399-pinephone-pro-Fix-SD-card-power-sup.patch new file mode 100644 index 0000000000000000000000000000000000000000..85c9854f57f86892e1c285cf20a7cb265a4aca29 --- /dev/null +++ b/files/linux/0441-arm64-dts-rk3399-pinephone-pro-Fix-SD-card-power-sup.patch @@ -0,0 +1,75 @@ +From 86b055e9752fea069cf2c5ffd276ca9c17c8669d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Wed, 20 Oct 2021 22:41:43 +0200 +Subject: [PATCH 441/520] arm64: dts: rk3399-pinephone-pro: Fix SD card power + supply definition + +GPIO0_A1 is used for modem's RI. SD card power supply is not changeable. + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 27 ++++--------------- + 1 file changed, 5 insertions(+), 22 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 2ecb6bac5bb25..86970a475d74f 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -215,23 +215,6 @@ + vin-supply = <&vcc3v3_sys>; + }; + +- /* micro SD card power */ +- vcc3v0_sd: vcc3v0-sd { +- compatible = "regulator-fixed"; +- enable-active-high; +- gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; +- pinctrl-names = "default"; +- pinctrl-0 = <&sdmmc0_pwr_h>; +- regulator-name = "vcc3v0_sd"; +- regulator-min-microvolt = <3000000>; +- regulator-max-microvolt = <3000000>; +- vin-supply = <&vcc3v3_sys>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- + /* MIPI DSI panel 1.8v supply */ + vcc1v8_lcd: vcc1v8-lcd { + compatible = "regulator-fixed"; +@@ -474,8 +457,8 @@ + }; + }; + +- vcc_sd: LDO_REG9 { +- regulator-name = "vcc_sd"; ++ vccio_sd: LDO_REG9 { ++ regulator-name = "vccio_sd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { +@@ -812,7 +795,7 @@ + + bt656-supply = <&vcc1v8_dvp>; + audio-supply = <&vcca1v8_codec>; +- sdmmc-supply = <&vcc_sd>; ++ sdmmc-supply = <&vccio_sd>; + gpio1830-supply = <&vcc_3v0>; + }; + +@@ -1051,8 +1034,8 @@ + max-frequency = <150000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; +- vmmc-supply = <&vcc3v0_sd>; +- vqmmc-supply = <&vcc_sd>; ++ vmmc-supply = <&vcc3v3_sys>; ++ vqmmc-supply = <&vccio_sd>; + status = "okay"; + }; + +-- +2.36.1 + diff --git a/files/linux/0442-arm64-dts-rk3399-pinephone-pro-Correct-the-battery-s.patch b/files/linux/0442-arm64-dts-rk3399-pinephone-pro-Correct-the-battery-s.patch new file mode 100644 index 0000000000000000000000000000000000000000..6bc6ff0ebe6055b8c2225aa6d55353f945dc5049 --- /dev/null +++ b/files/linux/0442-arm64-dts-rk3399-pinephone-pro-Correct-the-battery-s.patch @@ -0,0 +1,48 @@ +From 12f951f2edd55b0d7b71c4bad5c3ab5afac797f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Mon, 25 Oct 2021 17:49:41 +0200 +Subject: [PATCH 442/520] arm64: dts: rk3399-pinephone-pro: Correct the battery + specification +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +XLS with ZCV measurements from the manufacturer say that at 25°C, +ZCV is ~200 mOhm. At 50°C it's at ~100 mOhm. Set some value in between. + +Lower the charging current to something less aggressive. + +Fix the current sensing resitor value (it's 10 mOhm in the schematic). + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 86970a475d74f..c011167baab6a 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -504,16 +504,16 @@ + 4110 4161 4217 4308>; + design_capacity = <2916>; + design_qmax = <2708>; +- bat_res = <65>; ++ bat_res = <150>; + max_input_current = <3000>; +- max_chrg_current = <3000>; ++ max_chrg_current = <2000>; + max_chrg_voltage = <4350>; + sleep_enter_current = <300>; + sleep_exit_current = <300>; + power_off_thresd = <3400>; + zero_algorithm_vol = <3950>; + fb_temperature = <105>; +- sample_res = <20>; ++ sample_res = <10>; + max_soc_offset = <60>; + energy_mode = <0>; + monitor_sec = <5>; +-- +2.36.1 + diff --git a/files/linux/0443-arm64-dts-rk3399-pinephone-pro-Cleanup-some-USB-node.patch b/files/linux/0443-arm64-dts-rk3399-pinephone-pro-Cleanup-some-USB-node.patch new file mode 100644 index 0000000000000000000000000000000000000000..11b386a13f889c1dd1ea71ef17f16b55121f7a64 --- /dev/null +++ b/files/linux/0443-arm64-dts-rk3399-pinephone-pro-Cleanup-some-USB-node.patch @@ -0,0 +1,36 @@ +From 54aa854ce081449498862cb01f850c8ba818d778 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Tue, 26 Oct 2021 01:29:50 +0200 +Subject: [PATCH 443/520] arm64: dts: rk3399-pinephone-pro: Cleanup some USB + nodes whitespace + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index c011167baab6a..1fab10d6de011 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -1084,7 +1084,7 @@ + + u2phy0_host: host-port { + status = "okay"; +- phy-supply = <&vcc5v0_sys>; ++ phy-supply = <&vcc5v0_sys>; + }; + + port { +@@ -1103,7 +1103,7 @@ + + u2phy1_host: host-port { + status = "okay"; +- phy-supply = <&vcc5v0_sys>; ++ phy-supply = <&vcc5v0_sys>; + }; + }; + +-- +2.36.1 + diff --git a/files/linux/0444-arm64-dts-rk3399-pinephone-pro-Fix-PDOs-to-be-more-r.patch b/files/linux/0444-arm64-dts-rk3399-pinephone-pro-Fix-PDOs-to-be-more-r.patch new file mode 100644 index 0000000000000000000000000000000000000000..5a8bf210633c7063995ff4c0f7820b62d35fc352 --- /dev/null +++ b/files/linux/0444-arm64-dts-rk3399-pinephone-pro-Fix-PDOs-to-be-more-r.patch @@ -0,0 +1,37 @@ +From 70df35bd6a9cb89eebf6829eea2f400a644b961b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Tue, 26 Oct 2021 01:30:14 +0200 +Subject: [PATCH 444/520] arm64: dts: rk3399-pinephone-pro: Fix PDOs to be more + reasonable + +Let's not overtax the battery and provide only 4.5W to external devices. +Even that may be too much, given what PPP can consume by itself. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 1fab10d6de011..820fc0648ee41 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -709,12 +709,10 @@ + compatible = "usb-c-connector"; + data-role = "dual"; + label = "USB-C"; +- op-sink-microwatt = <1000000>; ++ op-sink-microwatt = <2500000>; + power-role = "dual"; +- sink-pdos = +- ; +- source-pdos = +- ; ++ sink-pdos = ; ++ source-pdos = ; + try-power-role = "sink"; + + extcon-cables = <1 2 5 6 9 10 12 44>; +-- +2.36.1 + diff --git a/files/linux/0445-arm64-dts-rk3399-pinephone-pro-Add-chassis-type-hand.patch b/files/linux/0445-arm64-dts-rk3399-pinephone-pro-Add-chassis-type-hand.patch new file mode 100644 index 0000000000000000000000000000000000000000..777483eb7ba604c4b49aecc8024ed64bf23dea9e --- /dev/null +++ b/files/linux/0445-arm64-dts-rk3399-pinephone-pro-Add-chassis-type-hand.patch @@ -0,0 +1,28 @@ +From 92c9db88c3d6fed52ba450618535584978fdcf8e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Tue, 2 Nov 2021 13:28:24 +0100 +Subject: [PATCH 445/520] arm64: dts: rk3399-pinephone-pro: Add chassis-type = + "handset" to DT + +This way, desktop environment can pick up device type from DT. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 820fc0648ee41..c2dd4ff43c3e9 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -17,6 +17,7 @@ + / { + model = "Pine64 PinePhonePro"; + compatible = "pine64,pinephone-pro", "rockchip,rk3399"; ++ chassis-type = "handset"; + + chosen { + bootargs = "earlycon=uart8250,mmio32,0xff1a0000"; +-- +2.36.1 + diff --git a/files/linux/0446-arm64-dts-rk3399-pinephone-pro-Add-mmc-aliases-to-ge.patch b/files/linux/0446-arm64-dts-rk3399-pinephone-pro-Add-mmc-aliases-to-ge.patch new file mode 100644 index 0000000000000000000000000000000000000000..d7e9d29dc112e0921970843867c18ee3c5a20e56 --- /dev/null +++ b/files/linux/0446-arm64-dts-rk3399-pinephone-pro-Add-mmc-aliases-to-ge.patch @@ -0,0 +1,33 @@ +From 54f5c2522456f3966a71cafdb1615a772464f227 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Tue, 2 Nov 2021 13:29:29 +0100 +Subject: [PATCH 446/520] arm64: dts: rk3399-pinephone-pro: Add mmc aliases to + get stable numbering + +It's better to have stable meanings for /dev/mmcblk* device files. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index c2dd4ff43c3e9..0712244bb3ef3 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -19,6 +19,12 @@ + compatible = "pine64,pinephone-pro", "rockchip,rk3399"; + chassis-type = "handset"; + ++ aliases { ++ mmc0 = &sdio0; ++ mmc1 = &sdmmc; ++ mmc2 = &sdhci; ++ }; ++ + chosen { + bootargs = "earlycon=uart8250,mmio32,0xff1a0000"; + stdout-path = "serial2:1500000n8"; +-- +2.36.1 + diff --git a/files/linux/0447-arm64-dts-rk3399-pinephone-pro-Use-a-new-rk818-batte.patch b/files/linux/0447-arm64-dts-rk3399-pinephone-pro-Use-a-new-rk818-batte.patch new file mode 100644 index 0000000000000000000000000000000000000000..ed6145da3f8875ee91cdf4e98383a15de84b7011 --- /dev/null +++ b/files/linux/0447-arm64-dts-rk3399-pinephone-pro-Use-a-new-rk818-batte.patch @@ -0,0 +1,27 @@ +From 21583aa7648215293d2fcae9a3366f5ff9cb0fb0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Sun, 7 Nov 2021 19:30:46 +0100 +Subject: [PATCH 447/520] arm64: dts: rk3399-pinephone-pro: Use a new + rk818-battery compatible + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 0712244bb3ef3..bdb49f749839b 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -505,7 +505,7 @@ + }; + + battery { +- compatible = "rk818-battery"; ++ compatible = "rockchip,rk818-battery"; + ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780 + 3793 3807 3827 3853 3896 3937 3974 4007 4066 + 4110 4161 4217 4308>; +-- +2.36.1 + diff --git a/files/linux/0448-arm64-dts-rk3399-pinephone-pro-Full-support-for-Type.patch b/files/linux/0448-arm64-dts-rk3399-pinephone-pro-Full-support-for-Type.patch new file mode 100644 index 0000000000000000000000000000000000000000..2735ebb2d7f4c800e399a34dd73981b53f78ce24 --- /dev/null +++ b/files/linux/0448-arm64-dts-rk3399-pinephone-pro-Full-support-for-Type.patch @@ -0,0 +1,299 @@ +From 17a9331ec87cee96e45db23afc5b495db78ceb66 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Sun, 7 Nov 2021 19:39:20 +0100 +Subject: [PATCH 448/520] arm64: dts: rk3399-pinephone-pro: Full support for + Type-C port + +Connect various devices to a extcon bridge. Fix some incorrectly +specified regulators. With this patch, this is now supported: + +- PD charger / current limiting +- Alt-DisplayPort mode +- OTG - host/peripheral USB +- B1.2 detection + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 143 +++++++++++++----- + 1 file changed, 104 insertions(+), 39 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index bdb49f749839b..d1e93c343a16a 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -12,8 +12,6 @@ + #include "rk3399.dtsi" + #include "rk3399-opp.dtsi" + +-#define WITHOUT_CDN_DP // TODO: everything works, but it is simpler to test mipi +- + / { + model = "Pine64 PinePhonePro"; + compatible = "pine64,pinephone-pro", "rockchip,rk3399"; +@@ -50,6 +48,43 @@ + }; + }; + ++ bat: battery { ++ compatible = "simple-battery"; ++ voltage-min-design-microvolt = <3400000>; ++ voltage-max-design-microvolt = <4350000>; ++ energy-full-design-microwatt-hours = <11400000>; ++ charge-full-design-microamp-hours = <3000000>; ++ precharge-current-microamp = <120000>; ++ charge-term-current-microamp = <150000>; ++ constant-charge-current-max-microamp = <1500000>; ++ constant-charge-voltage-max-microvolt = <4350000>; ++ factory-internal-resistance-micro-ohms = <150000>; ++ resistance-temp-table = <20 150>; ++ ocv-capacity-celsius = <20>; ++ ocv-capacity-table-0 = ++ <4308000 100>, ++ <4217000 95>, ++ <4161000 90>, ++ <4110000 85>, ++ <4066000 80>, ++ <4007000 75>, ++ <3974000 70>, ++ <3937000 65>, ++ <3896000 60>, ++ <3853000 55>, ++ <3827000 50>, ++ <3807000 45>, ++ <3793000 40>, ++ <3780000 35>, ++ <3768000 30>, ++ <3756000 25>, ++ <3740000 20>, ++ <3716000 15>, ++ <3689000 10>, ++ <3675000 5>, ++ <3400000 0>; ++ }; ++ + cluster1_opp_ppp: opp-table1b { + compatible = "operating-points-v2"; + opp-shared; +@@ -168,25 +203,35 @@ + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; +- vin-supply = <&vcc_sysin>; ++ vin-supply = <&boost_otg>; + + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + ++ /* ++ * This is not a regulator, but GPIO0_A6 is used to disable ++ * VCC_SYS -> VBAT+ switch that helps boost that power path's ++ * current carrying capacity. ++ * ++ * GPIO0_A6 high: path is disabled no matter what ++ * GPIO0_A6 low: path is enabled if there's 5V voltage on ++ * VBUS_TYPEC ++ * ++ * GPIO0_A6 must be high when the phone is providing VBUS_TYPEC ++ * power. ++ */ + vcc5v0_typec: vcc5v0-typec-regulator { + compatible = "regulator-fixed"; +- //enable-active-high; ++ enable-active-high; + gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_typec_en>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-name = "vcc5v0_typec"; +- vin-supply = <&vcc5v0_sys>; +- regulator-always-on; +- regulator-boot-on; ++ vin-supply = <&boost_otg>; + + regulator-state-mem { + regulator-on-in-suspend; +@@ -257,6 +302,14 @@ + regulator-always-on; + regulator-boot-on; + }; ++ ++ typec_extcon_bridge: typec-extcon { ++ compatible = "linux,typec-extcon-bridge"; ++ usb-role-switch; ++ orientation-switch; ++ mode-switch; ++ svid = /bits/ 16 <0xff01>; ++ }; + }; + + &cpu_l0 { +@@ -285,12 +338,11 @@ + operating-points-v2 = <&cluster1_opp_ppp>; + }; + +-#ifndef WITHOUT_CDN_DP + &cdn_dp { + status = "okay"; +- extcon = <&fusb0>; ++ extcon = <&typec_extcon_bridge>; ++ phys = <&tcphy0_dp>; + }; +-#endif + + &emmc_phy { + status = "okay"; +@@ -318,7 +370,6 @@ + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; +- extcon = <&fusb0>; + + vcc1-supply = <&vcc_sysin>; + vcc2-supply = <&vcc_sysin>; +@@ -328,6 +379,7 @@ + vcc7-supply = <&vcc3v3_sys>; + vcc8-supply = <&vcc_sysin>; + vcc9-supply = <&vcc3v3_sys>; ++ usb-supply = <&vcc5v0_typec>; + + regulators { + vdd_cpu_l: DCDC_REG1 { +@@ -497,13 +549,13 @@ + + otg_switch: OTG_SWITCH { + regulator-name = "otg_switch"; +- // TODO: This requires a proper rk818-charger implementation +- // without this always-on the type-c is not powered on +- //regulator-always-on; +- //regulator-boot-on; + }; + }; + ++ /* ++ * XXX: Backported BSP stuff, drop this. Use standard ++ * "monitored-battery" property. ++ */ + battery { + compatible = "rockchip,rk818-battery"; + ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780 +@@ -528,6 +580,12 @@ + power_dc2otg = <0>; + otg5v_suspend_enable = <1>; + }; ++ ++ charger { ++ compatible = "rockchip,rk818-charger"; ++ power-supplies = <&fusb0>; ++ monitored-battery = <&bat>; ++ }; + }; + + vdd_cpu_b: regulator@40 { +@@ -710,7 +768,9 @@ + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&fusb0_int>; +- vbus-supply = <&vcc5v0_typec>; ++ extcon = <&typec_extcon_bridge>; ++ usb-role-switch = <&typec_extcon_bridge>; ++ vbus-supply = <&otg_switch>; + + connector { + compatible = "usb-c-connector"; +@@ -718,12 +778,18 @@ + label = "USB-C"; + op-sink-microwatt = <2500000>; + power-role = "dual"; +- sink-pdos = ; +- source-pdos = ; ++ sink-pdos = ; ++ source-pdos = ; + try-power-role = "sink"; ++ mode-switch = <&typec_extcon_bridge>; ++ orientation-switch = <&typec_extcon_bridge>; + +- extcon-cables = <1 2 5 6 9 10 12 44>; +- typec-altmodes = <0xff01 1 0x001c0c00 1>; ++ altmodes { ++ dp { ++ svid = <0xff01>; ++ vdo = <0x0c46>; ++ }; ++ }; + + ports { + #address-cells = <1>; +@@ -1052,7 +1118,7 @@ + }; + + &tcphy0 { +- extcon = <&fusb0>; ++ extcon = <&typec_extcon_bridge>; + status = "okay"; + }; + +@@ -1082,15 +1148,8 @@ + + &u2phy0 { + status = "okay"; +- +- u2phy0_otg: otg-port { +- status = "okay"; +- }; +- +- u2phy0_host: host-port { +- status = "okay"; +- phy-supply = <&vcc5v0_sys>; +- }; ++ extcon = <&typec_extcon_bridge>; ++ extcon,ignore-usb; + + port { + u2phy0_typec_hs: endpoint { +@@ -1099,17 +1158,22 @@ + }; + }; + +-&u2phy1 { ++&u2phy0_otg { + status = "okay"; ++}; + +- u2phy1_otg: otg-port { +- status = "okay"; +- }; ++&u2phy0_host { ++ status = "okay"; ++ phy-supply = <&vcc5v0_sys>; ++}; + +- u2phy1_host: host-port { +- status = "okay"; +- phy-supply = <&vcc5v0_sys>; +- }; ++&u2phy1 { ++ status = "okay"; ++}; ++ ++&u2phy1_host { ++ status = "okay"; ++ phy-supply = <&vcc5v0_sys>; + }; + + &uart0 { +@@ -1158,7 +1222,8 @@ + }; + + &usbdrd_dwc3_0 { +- dr_mode = "peripheral"; ++ dr_mode = "otg"; ++ extcon = <&typec_extcon_bridge>; + status = "okay"; + }; + +-- +2.36.1 + diff --git a/files/linux/0449-arm64-dts-rk3399-pinephone-pro-Use-DCLK_VOP-_FRAC-to.patch b/files/linux/0449-arm64-dts-rk3399-pinephone-pro-Use-DCLK_VOP-_FRAC-to.patch new file mode 100644 index 0000000000000000000000000000000000000000..8dffaa09793d850dd066aaf0c24764bf81be35ec --- /dev/null +++ b/files/linux/0449-arm64-dts-rk3399-pinephone-pro-Use-DCLK_VOP-_FRAC-to.patch @@ -0,0 +1,41 @@ +From d6bb577d8d6c855ad69ed4ebcb153b8946b32e79 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Mon, 15 Nov 2021 23:52:40 +0100 +Subject: [PATCH 449/520] arm64: dts: rk3399-pinephone-pro: Use DCLK_VOP*_FRAC + to achieve precise rates + +By setting parents of DCLK_VOP1_DIV to frac/cpll we can achieve +various clock rates needed by display engine precisely. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index d1e93c343a16a..446b3696559fe 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -1229,6 +1229,9 @@ + + &vopb { + status = "okay"; ++ assigned-clocks = <&cru DCLK_VOP0_DIV>, <&cru DCLK_VOP0>, <&cru ACLK_VOP0>, <&cru HCLK_VOP0>; ++ assigned-clock-rates = <0>, <0>, <400000000>, <100000000>; ++ assigned-clock-parents = <&cru PLL_CPLL>, <&cru DCLK_VOP0_FRAC>; + }; + + &vopb_mmu { +@@ -1237,6 +1240,9 @@ + + &vopl { + status = "okay"; ++ assigned-clocks = <&cru DCLK_VOP1_DIV>, <&cru DCLK_VOP1>, <&cru ACLK_VOP1>, <&cru HCLK_VOP1>; ++ assigned-clock-rates = <0>, <0>, <400000000>, <100000000>; ++ assigned-clock-parents = <&cru PLL_CPLL>, <&cru DCLK_VOP1_FRAC>; + }; + + &vopl_mmu { +-- +2.36.1 + diff --git a/files/linux/0450-arm64-dts-rk3399-pinephone-pro-Add-support-for-power.patch b/files/linux/0450-arm64-dts-rk3399-pinephone-pro-Add-support-for-power.patch new file mode 100644 index 0000000000000000000000000000000000000000..9e23673d68a531883e4343f448a67d74bdabdc5b --- /dev/null +++ b/files/linux/0450-arm64-dts-rk3399-pinephone-pro-Add-support-for-power.patch @@ -0,0 +1,118 @@ +From ab95c27da0fdea25b0083d40ae67084a7f062ef4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Tue, 23 Nov 2021 23:26:26 +0100 +Subject: [PATCH 450/520] arm64: dts: rk3399-pinephone-pro: Add support for + powering up the modem + +Pinephone Pro has the same modem that's already supported by modem-power. +Add support for it do DT. + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 76 +++++++++++++++++++ + 1 file changed, 76 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 446b3696559fe..9172dc6a90fb4 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -253,6 +253,30 @@ + }; + }; + ++ vcc_4g_5v: vcc-4g-5v { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio1 RK_PC7 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc_4g_5v_en>; ++ regulator-name = "vcc_4g_5v"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc_4g: vcc-4g { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio4 RK_PC7 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc_4g_en>; ++ regulator-name = "vcc_4g"; ++ regulator-min-microvolt = <3800000>; ++ regulator-max-microvolt = <3800000>; ++ vin-supply = <&vcc_sysin>; ++ }; ++ + vcc1v8_codec: vcc1v8-codec-regulator { + compatible = "regulator-fixed"; + enable-active-high; +@@ -948,6 +972,35 @@ + }; + }; + ++&uart3 { ++ status = "okay"; ++ ++ modem { ++ compatible = "quectel,eg25"; ++ char-device-name = "modem-power"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&modem_control_pins>; ++ ++ power-supply = <&vcc_4g>; ++ vbus-supply = <&vcc_4g_5v>; ++ ++ enable-gpios = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>; // W_DISABLE# ++ reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>; ++ status-gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_HIGH>; ++ pwrkey-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>; ++ ++ host-ready-gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>; // apready ++ wakeup-gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; // ri ++ ++ dtr-gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>; ++ cts-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>; ++ rts-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; ++ ++ quectel,qdai = "3,0,0,4,0,0,1,1"; ++ }; ++}; ++ + &pmu_io_domains { + pmu1830-supply = <&vcc_1v8>; + status = "okay"; +@@ -1012,6 +1065,29 @@ + }; + }; + ++ modem { ++ vcc_4g_5v_en: vcc-4g-5v-en-pin { ++ rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ vcc_4g_en: vcc-4g-en-pin { ++ rockchip,pins = <4 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ modem_control_pins: modem-control-pins { ++ rockchip,pins = ++ <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>, ++ <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>, ++ <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>, ++ <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>, ++ <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>, ++ <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>, ++ <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>, ++ <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>, ++ <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; +-- +2.36.1 + diff --git a/files/linux/0451-arm64-dts-rk3399-pinephone-pro-Add-audio-support.patch b/files/linux/0451-arm64-dts-rk3399-pinephone-pro-Add-audio-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..b4ebe9bc63e8076ad9f822388396823f5c02d019 --- /dev/null +++ b/files/linux/0451-arm64-dts-rk3399-pinephone-pro-Add-audio-support.patch @@ -0,0 +1,143 @@ +From 71aacc8447cc53a9a9fd945e94fc2280cccd37c5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Wed, 24 Nov 2021 01:58:45 +0100 +Subject: [PATCH 451/520] arm64: dts: rk3399-pinephone-pro: Add audio support + +The codec is complicated, good luck! :D + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 96 +++++++++++++++++++ + 1 file changed, 96 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 9172dc6a90fb4..3410c5b2aed3e 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -168,6 +168,69 @@ + }; + }; + ++ // in1 - digital mic daughhterboard ++ // in2 - headset mic ++ // in3 - modem output (muxed with mono) ++ // spol - earphone ++ // hpo - heaphones ++ // lout - modem input ++ // spaker - amp enabled by SPK_CTL_H ++ // ++ // mclk - GPIO4_A0/I2S_CLK ++ // ++ // some gpio-jack-detection driver? ++ //pinctrl-0 = <&hp_det>; // GPIO4_D4 ++ ++ rt5640-sound { ++ compatible = "simple-audio-card"; ++ simple-audio-card,name = "rockchip,rt5640-codec"; ++ simple-audio-card,aux-devs = <&speaker_amp>; ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,mclk-fs = <256>; ++ ++ simple-audio-card,widgets = ++ "Microphone", "Headset Microphone", ++ "Microphone", "Internal Microphone", ++ "Headphone", "Headphone Jack", ++ "Speaker", "Internal Earpiece", ++ "Speaker", "Internal Speaker", ++ "Line", "Line In Modem", ++ "Line", "Line Out Modem"; ++ ++ simple-audio-card,routing = ++ "Headphone Jack", "HPOL", ++ "Headphone Jack", "HPOR", ++ "Internal Earpiece", "SPOLP", ++ "Internal Earpiece", "SPOLN", ++ "Internal Speaker", "Speaker Amp OUTL", ++ "Internal Speaker", "Speaker Amp OUTR", ++ "Speaker Amp INL", "HPOL", ++ "Speaker Amp INR", "HPOR", ++ "DMIC1", "Internal Microphone", ++ "Headset Microphone", "MICBIAS1", ++ "IN2P", "Headset Microphone", ++ "Line Out Modem", "LOUTL", ++ "Line Out Modem", "LOUTR", ++ "IN3P", "Line In Modem", ++ "IN3N", "Line In Modem"; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s0>; ++ }; ++ ++ simple-audio-card,codec { ++ sound-dai = <&rt5640>; ++ }; ++ }; ++ ++ speaker_amp: audio-amplifier { ++ compatible = "simple-audio-amplifier"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spk_en>; ++ enable-gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>; ++ sound-name-prefix = "Speaker Amp"; ++ }; ++ + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rk818 1>; +@@ -748,6 +811,24 @@ + }; + }; + }; ++ ++ // XXX: modem codec supplies: ++ // - vcc1v8_codec ++ // - vcca3v0_codec ++ ++ // supplies: (always on currently) ++ // - vcca3v0_codec ++ // - vcca1v8_codec ++ // - vcc5v0_sys - spk_vcc ++ rt5640: rt5640@1c { ++ compatible = "realtek,rt5640"; ++ reg = <0x1c>; ++ clocks = <&cru SCLK_I2S_8CH_OUT>; ++ clock-names = "mclk"; ++ realtek,dmic1-data-pin = <1>; ++ realtek,in3-differential; ++ #sound-dai-cells = <0>; ++ }; + }; + + &i2c3 { +@@ -885,6 +966,13 @@ + }; + }; + ++&i2s0 { ++ rockchip,playback-channels = <2>; ++ rockchip,capture-channels = <2>; ++ pinctrl-0 = <&i2s0_2ch_bus>; ++ status = "okay"; ++}; ++ + &io_domains { + status = "okay"; + +@@ -1139,6 +1227,14 @@ + vcc1v8_codec_en: vcc1v8-codec-en { + rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; + }; ++ ++ hp_det: hp-det { ++ rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ spk_en: spk-en { ++ rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; + }; + }; + +-- +2.36.1 + diff --git a/files/linux/0452-arm64-dts-rk3399-pinephone-pro-Add-POGO-i2c-bus.patch b/files/linux/0452-arm64-dts-rk3399-pinephone-pro-Add-POGO-i2c-bus.patch new file mode 100644 index 0000000000000000000000000000000000000000..d37106c4d7c9ee90456a11dc96661a3c963b47f6 --- /dev/null +++ b/files/linux/0452-arm64-dts-rk3399-pinephone-pro-Add-POGO-i2c-bus.patch @@ -0,0 +1,47 @@ +From 2dac60bc7d4099379e7e0fbe5e3c4221f81eefa8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Wed, 12 Jan 2022 22:54:52 +0100 +Subject: [PATCH 452/520] arm64: dts: rk3399-pinephone-pro: Add POGO i2c bus + +I2C5 is exposed on POGO header. Enable it. + +Signed-off-by: Ondrej Jirman +--- + .../boot/dts/rockchip/rk3399-pinephone-pro.dts | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 3410c5b2aed3e..472a23002c679 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -966,6 +966,14 @@ + }; + }; + ++/* This bus is exposed on POGO pins */ ++&i2c5 { ++ i2c-scl-rising-time-ns = <450>; ++ i2c-scl-falling-time-ns = <15>; ++ pinctrl-0 = <&i2c5_xfer &pogo_int_pin>; ++ status = "okay"; ++}; ++ + &i2s0 { + rockchip,playback-channels = <2>; + rockchip,capture-channels = <2>; +@@ -1190,6 +1198,12 @@ + }; + }; + ++ pogo { ++ pogo_int_pin: pogo-int { ++ rockchip,pins = <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ + sdcard { + sdmmc0_pwr_h: sdmmc0-pwr-h { + rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; +-- +2.36.1 + diff --git a/files/linux/0453-arm64-dts-rk3399-pinephone-pro-Improve-vcc5v0_typec-.patch b/files/linux/0453-arm64-dts-rk3399-pinephone-pro-Improve-vcc5v0_typec-.patch new file mode 100644 index 0000000000000000000000000000000000000000..cf12ae05ec17fe2ba2934055511237f615324815 --- /dev/null +++ b/files/linux/0453-arm64-dts-rk3399-pinephone-pro-Improve-vcc5v0_typec-.patch @@ -0,0 +1,52 @@ +From dd726a3f499757d094c9f37f297dd59297fbfd64 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Sun, 6 Feb 2022 16:08:24 +0100 +Subject: [PATCH 453/520] arm64: dts: rk3399-pinephone-pro: Improve + vcc5v0_typec description + +As noted by dsimic, the original description was incorrect. Update +it to the new consensus from #pinedev chat. + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 22 ++++++++++++------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 472a23002c679..8faf960ae1db2 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -274,16 +274,22 @@ + }; + + /* +- * This is not a regulator, but GPIO0_A6 is used to disable +- * VCC_SYS -> VBAT+ switch that helps boost that power path's +- * current carrying capacity. ++ * This is not a regulator. GPIO0_A6 is used to force enable VCC_SYS <-> ++ * VBAT+ Q7 switch that helps boost the RK818's power path's current carrying ++ * capacity when operating the phone from the battery in case VBUS_TYPEC ++ * has 5V provided by the phone itself and not by the external power ++ * supply. (this happens in USB host mode) + * +- * GPIO0_A6 high: path is disabled no matter what +- * GPIO0_A6 low: path is enabled if there's 5V voltage on +- * VBUS_TYPEC ++ * GPIO0_A6 low: Q7 is enabled if there's 0V on VBUS_TYPEC (phone is not ++ * powered from external power supply) ++ * GPIO0_A6 high: Q7 is enabled no matter what + * +- * GPIO0_A6 must be high when the phone is providing VBUS_TYPEC +- * power. ++ * GPIO0_A6 must be high when the phone is providing VBUS_TYPEC power. ++ * This keeps the power path boost enabled for all cases when the phone ++ * runs from the battery. ++ * ++ * In other words, GPIO0_A6 is used to override the automatic disabling ++ * of Q7 when VBUS_TYPEC has 5V in USB host mode. + */ + vcc5v0_typec: vcc5v0-typec-regulator { + compatible = "regulator-fixed"; +-- +2.36.1 + diff --git a/files/linux/0454-arm64-dts-rk3399-pinephone-pro-STK3311A-INT-pin-is-o.patch b/files/linux/0454-arm64-dts-rk3399-pinephone-pro-STK3311A-INT-pin-is-o.patch new file mode 100644 index 0000000000000000000000000000000000000000..b9a07964eb554aa98dc7013eccc13bf3a1610374 --- /dev/null +++ b/files/linux/0454-arm64-dts-rk3399-pinephone-pro-STK3311A-INT-pin-is-o.patch @@ -0,0 +1,43 @@ +From a8d8e49a96b7b59fb5cd6cef63a59a4ef3cf76f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Wed, 9 Feb 2022 21:15:15 +0100 +Subject: [PATCH 454/520] arm64: dts: rk3399-pinephone-pro: STK3311A INT pin is + open drain + +There's no on-board pull-up resistor and the pin needs to be pulled up, +because it's open drain. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 8faf960ae1db2..b059121cb3de7 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -862,6 +862,8 @@ + reg = <0x48>; + interrupt-parent = <&gpio4>; + interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&stk3311_int>; + vdd-supply = <&vcc_3v0>; + leda-supply = <&vcc_3v0>; + }; +@@ -1243,6 +1245,12 @@ + }; + }; + ++ stk3311 { ++ stk3311_int: stk3311-int { ++ rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ + sound { + vcc1v8_codec_en: vcc1v8-codec-en { + rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; +-- +2.36.1 + diff --git a/files/linux/0455-arm64-dts-rk3399-pinephone-pro-Magnetometer-is-AF813.patch b/files/linux/0455-arm64-dts-rk3399-pinephone-pro-Magnetometer-is-AF813.patch new file mode 100644 index 0000000000000000000000000000000000000000..02d3b632d0194462f3044bfb72bdbf2ea0430694 --- /dev/null +++ b/files/linux/0455-arm64-dts-rk3399-pinephone-pro-Magnetometer-is-AF813.patch @@ -0,0 +1,51 @@ +From 09918b025e7ea4fbc429ac7eb61966105cff644c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Wed, 9 Feb 2022 21:14:58 +0100 +Subject: [PATCH 455/520] arm64: dts: rk3399-pinephone-pro: Magnetometer is + AF8133J + +Magnetometer is neither ak09911 nor lis3mdl. Use the proper chip. + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 23 ++++--------------- + 1 file changed, 5 insertions(+), 18 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index b059121cb3de7..c515c4962397f 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -952,25 +952,12 @@ + "0", "0", "1"; + }; + +- lis3mdl: magnetometer@1c { +- compatible = "st,lis3mdl-magn"; ++ af8133j: compass@1c { ++ compatible = "voltafield,af8133j"; + reg = <0x1c>; +- interrupt-parent = <&gpio1>; +- interrupts = ; +- vdd-supply = <&vcc3v3_sys>; +- vddio-supply = <&vcc_1v8>; +- status = "disabled"; +- }; +- +- // not populated currently +- ak09911: compass@c { +- compatible = "asahi-kasei,ak09911"; +- reg = <0x0c>; +- interrupt-parent = <&gpio1>; +- interrupts = ; +- vdd-supply = <&vcc_3v0>; +- vid-supply = <&vcc_1v8>; +- status = "disabled"; ++ reset-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>; ++ avdd-supply = <&vcc_3v0>; ++ dvdd-supply = <&vcc_1v8>; + }; + }; + +-- +2.36.1 + diff --git a/files/linux/0456-arm64-dts-rk3399-pinephone-pro-Fix-leds.patch b/files/linux/0456-arm64-dts-rk3399-pinephone-pro-Fix-leds.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce9ff121de8e0d916f13a24328275a9b66775bd3 --- /dev/null +++ b/files/linux/0456-arm64-dts-rk3399-pinephone-pro-Fix-leds.patch @@ -0,0 +1,58 @@ +From 18eab79557ea73e333e181b14ed920f570d71765 Mon Sep 17 00:00:00 2001 +From: Arnaud Ferraris +Date: Wed, 1 Dec 2021 20:48:51 +0100 +Subject: [PATCH 456/520] arm64: dts: rk3399-pinephone-pro: Fix leds + +Existing LEDs use different names and functions than what +we're used to, change them all to the same names we use on the OG +PinePhone. + +Signed-off-by: Arnaud Ferraris +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 20 ++++++------------- + 1 file changed, 6 insertions(+), 14 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index c515c4962397f..c07df89e8f849 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -127,30 +127,22 @@ + pinctrl-names = "default"; + pinctrl-0 = <&red_led_pin &green_led_pin &blue_led_pin>; + +- led-standby { ++ led-red { + color = ; +- default-state = "off"; +- function = LED_FUNCTION_STANDBY; ++ function = LED_FUNCTION_INDICATOR; + gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; +- label = "red:standby"; +- panic-indicator; +- retain-state-suspended; + }; + +- led-pwr { ++ led-green { + color = ; +- default-state = "on"; +- function = LED_FUNCTION_POWER; ++ function = LED_FUNCTION_INDICATOR; + gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>; +- label = "green:disk-activity"; + }; + +- blue-charging { ++ led-blue { + color = ; +- default-state = "off"; +- function = LED_FUNCTION_CHARGING; ++ function = LED_FUNCTION_INDICATOR; + gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>; +- label = "blue:charging"; + }; + }; + +-- +2.36.1 + diff --git a/files/linux/0457-arm64-dts-rk3399-pinephone-pro-Add-flash-LED.patch b/files/linux/0457-arm64-dts-rk3399-pinephone-pro-Add-flash-LED.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ccc50bb1dd74385ff0cdb4b2038383b687d0095 --- /dev/null +++ b/files/linux/0457-arm64-dts-rk3399-pinephone-pro-Add-flash-LED.patch @@ -0,0 +1,67 @@ +From efba2423c7ef7fc86e42710b7e8048b9e2b6ee97 Mon Sep 17 00:00:00 2001 +From: Arnaud Ferraris +Date: Wed, 1 Dec 2021 20:48:51 +0100 +Subject: [PATCH 457/520] arm64: dts: rk3399-pinephone-pro: Add flash LED + +The PinePhone Pro has a similar device to the SGM3140 used in the OG +PinePhone. This commit adds the corresponding device-tree node so the +flash/torch can work on this device. + +Signed-off-by: Arnaud Ferraris +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 25 ++++++++++++++++--- + 1 file changed, 21 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index c07df89e8f849..25f83f7dcb8b7 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -395,6 +395,21 @@ + mode-switch; + svid = /bits/ 16 <0xff01>; + }; ++ ++ sgm3140: led-controller { ++ compatible = "sgmicro,sgm3140"; ++ vin-supply = <&vcc3v3_sys>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&flash_pins>; ++ enable-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>; ++ flash-gpios = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; ++ ++ sgm3140_flash: led { ++ function = LED_FUNCTION_FLASH; ++ color = ; ++ flash-max-timeout-us = <250000>; ++ }; ++ }; + }; + + &cpu_l0 { +@@ -1146,6 +1161,12 @@ + blue_led_pin: blue-led-pin { + rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; + }; ++ ++ flash_pins: flash-pins { ++ rockchip,pins = ++ <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>, ++ <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; + }; + + modem { +@@ -1249,10 +1270,6 @@ + status = "okay"; + }; + +-&pwm1 { +- status = "okay"; +-}; +- + &pwm2 { + status = "okay"; + }; +-- +2.36.1 + diff --git a/files/linux/0458-arm64-dts-rk3399-pinephone-pro-improve-sound-device-.patch b/files/linux/0458-arm64-dts-rk3399-pinephone-pro-improve-sound-device-.patch new file mode 100644 index 0000000000000000000000000000000000000000..e8009c743da76902998819810cf6ab81e0a193b6 --- /dev/null +++ b/files/linux/0458-arm64-dts-rk3399-pinephone-pro-improve-sound-device-.patch @@ -0,0 +1,62 @@ +From 119b0eee277d73cbf48b9eb522e1f17002644726 Mon Sep 17 00:00:00 2001 +From: Arnaud Ferraris +Date: Thu, 9 Dec 2021 16:52:29 +0100 +Subject: [PATCH 458/520] arm64: dts: rk3399-pinephone-pro: improve sound + device definition + +This commit renames the sound card and the "Headphone" widget so they +match the names used by the ALSA UCM profiles. + +It also adds a jack detection GPIO to the sound card definition, and +creates a new set of ADC keys for handling headset buttons. + +Signed-off-by: Arnaud Ferraris +--- + .../boot/dts/rockchip/rk3399-pinephone-pro.dts | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 25f83f7dcb8b7..8547b04904bc3 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -169,29 +169,30 @@ + // spaker - amp enabled by SPK_CTL_H + // + // mclk - GPIO4_A0/I2S_CLK +- // +- // some gpio-jack-detection driver? +- //pinctrl-0 = <&hp_det>; // GPIO4_D4 + + rt5640-sound { + compatible = "simple-audio-card"; +- simple-audio-card,name = "rockchip,rt5640-codec"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hp_det>; ++ simple-audio-card,name = "PinePhonePro"; + simple-audio-card,aux-devs = <&speaker_amp>; + simple-audio-card,format = "i2s"; + simple-audio-card,mclk-fs = <256>; ++ simple-audio-card,hp-det-gpio = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>; ++ simple-audio-card,pin-switches = "Internal Speaker"; + + simple-audio-card,widgets = + "Microphone", "Headset Microphone", + "Microphone", "Internal Microphone", +- "Headphone", "Headphone Jack", ++ "Headphone", "Headphones", + "Speaker", "Internal Earpiece", + "Speaker", "Internal Speaker", + "Line", "Line In Modem", + "Line", "Line Out Modem"; + + simple-audio-card,routing = +- "Headphone Jack", "HPOL", +- "Headphone Jack", "HPOR", ++ "Headphones", "HPOL", ++ "Headphones", "HPOR", + "Internal Earpiece", "SPOLP", + "Internal Earpiece", "SPOLN", + "Internal Speaker", "Speaker Amp OUTL", +-- +2.36.1 + diff --git a/files/linux/0459-arm64-dts-rk3399-pinephone-pro-add-SPI-flash.patch b/files/linux/0459-arm64-dts-rk3399-pinephone-pro-add-SPI-flash.patch new file mode 100644 index 0000000000000000000000000000000000000000..e0bd42853ec94420bcb3efe7ca9bbe7f627c659b --- /dev/null +++ b/files/linux/0459-arm64-dts-rk3399-pinephone-pro-add-SPI-flash.patch @@ -0,0 +1,37 @@ +From 35da983874082e892c80afe914e6a89dc3eeda64 Mon Sep 17 00:00:00 2001 +From: Martijn Braam +Date: Sat, 29 Jan 2022 23:07:16 +0100 +Subject: [PATCH 459/520] arm64: dts: rk3399-pinephone-pro: add SPI flash + +According to the schematic the SPI nor flash is GD25LQ128EQIGR. This is +the storage used by the maskrom for the early boot process. + +Signed-off-by: Martijn Braam +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 8547b04904bc3..ba8826f6797c2 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -1314,6 +1314,16 @@ + status = "okay"; + }; + ++&spi1 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <10000000>; ++ }; ++}; ++ + &tcphy0 { + extcon = <&typec_extcon_bridge>; + status = "okay"; +-- +2.36.1 + diff --git a/files/linux/0460-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch b/files/linux/0460-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch new file mode 100644 index 0000000000000000000000000000000000000000..39d979833e49d82b55645ce3583f3c12d0a7e4eb --- /dev/null +++ b/files/linux/0460-arm64-dts-rk3399-pinephone-pro-Add-support-for-Pinep.patch @@ -0,0 +1,171 @@ +From e9c44b4899fecb17a9518181207a601653cc4fc3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Fri, 21 Jan 2022 23:27:24 +0100 +Subject: [PATCH 460/520] arm64: dts: rk3399-pinephone-pro: Add support for + Pinephone keyboard + +Pinephone keyboard can be used with Pinephone Pro. Describe it in +the device tree. + +Signed-off-by: Ondrej Jirman +--- + .../dts/rockchip/rk3399-pinephone-pro.dts | 136 ++++++++++++++++++ + 1 file changed, 136 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index ba8826f6797c2..879255aef1eb2 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -85,6 +85,122 @@ + <3400000 0>; + }; + ++ ppkb_battery: keyboard-battery { ++ compatible = "simple-battery"; ++ voltage-min-design-microvolt = <3000000>; ++ voltage-max-design-microvolt = <4200000>; ++ energy-full-design-microwatt-hours = <20000000>; ++ charge-full-design-microamp-hours = <6000000>; ++ precharge-current-microamp = <130000>; ++ charge-term-current-microamp = <50000>; ++ constant-charge-current-max-microamp = <2000000>; ++ constant-charge-voltage-max-microvolt = <4200000>; ++ factory-internal-resistance-micro-ohms = <187000>; ++ ocv-capacity-celsius = <20>; ++ ocv-capacity-table-0 = ++ <4147328 100>, ++ <4132636 99>, ++ <4121720 98>, ++ <4110905 97>, ++ <4102063 96>, ++ <4092428 95>, ++ <4082371 94>, ++ <4074137 93>, ++ <4064172 92>, ++ <4056387 91>, ++ <4047198 90>, ++ <4038599 89>, ++ <4030933 88>, ++ <4021831 87>, ++ <4012613 86>, ++ <4003863 85>, ++ <3995132 84>, ++ <3986108 83>, ++ <3977434 82>, ++ <3967977 81>, ++ <3960286 80>, ++ <3951737 79>, ++ <3943518 78>, ++ <3935723 77>, ++ <3928692 76>, ++ <3920093 75>, ++ <3912676 74>, ++ <3905481 73>, ++ <3899881 72>, ++ <3892341 71>, ++ <3887140 70>, ++ <3880005 69>, ++ <3876060 68>, ++ <3869195 67>, ++ <3863234 66>, ++ <3857808 65>, ++ <3851464 64>, ++ <3846976 63>, ++ <3840724 62>, ++ <3835254 61>, ++ <3830946 60>, ++ <3826564 59>, ++ <3821275 58>, ++ <3817413 57>, ++ <3811941 56>, ++ <3808947 55>, ++ <3804959 54>, ++ <3800958 53>, ++ <3797447 52>, ++ <3794303 51>, ++ <3790341 50>, ++ <3787022 49>, ++ <3783436 48>, ++ <3779936 47>, ++ <3776176 46>, ++ <3772160 45>, ++ <3769348 44>, ++ <3766705 43>, ++ <3762481 42>, ++ <3760894 41>, ++ <3758396 40>, ++ <3755803 39>, ++ <3753543 38>, ++ <3749691 37>, ++ <3747026 36>, ++ <3743937 35>, ++ <3741872 34>, ++ <3738529 33>, ++ <3737528 32>, ++ <3734059 31>, ++ <3731586 30>, ++ <3728576 29>, ++ <3725939 28>, ++ <3721208 27>, ++ <3718239 26>, ++ <3713032 25>, ++ <3709785 24>, ++ <3704045 23>, ++ <3701203 22>, ++ <3695965 21>, ++ <3691074 20>, ++ <3684562 19>, ++ <3679140 18>, ++ <3670993 17>, ++ <3664243 16>, ++ <3655383 15>, ++ <3647666 14>, ++ <3642747 13>, ++ <3637775 12>, ++ <3632593 11>, ++ <3627120 10>, ++ <3620923 9>, ++ <3611465 8>, ++ <3597536 7>, ++ <3577366 6>, ++ <3545253 5>, ++ <3497377 4>, ++ <3430377 3>, ++ <3337780 2>, ++ <3183953 1>, ++ <3064061 0>; ++ }; ++ + cluster1_opp_ppp: opp-table1b { + compatible = "operating-points-v2"; + opp-shared; +@@ -975,6 +1091,26 @@ + i2c-scl-falling-time-ns = <15>; + pinctrl-0 = <&i2c5_xfer &pogo_int_pin>; + status = "okay"; ++ ++ ppkb: keyboard@15 { ++ compatible = "pine64,pinephone-keyboard"; ++ reg = <0x15>; ++ interrupt-parent = <&gpio3>; ++ interrupts = ; ++ vbat-supply = <&vcc5v0_sys>; ++ wakeup-source; ++ ++ i2c-bus { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ charger@75 { ++ compatible = "injoinic,ip5209"; ++ reg = <0x75>; ++ monitored-battery = <&ppkb_battery>; ++ }; ++ }; ++ }; + }; + + &i2s0 { +-- +2.36.1 + diff --git a/files/linux/0461-arm64-dts-rk3399-pinephone-pro-Enable-Pinephone-Keyb.patch b/files/linux/0461-arm64-dts-rk3399-pinephone-pro-Enable-Pinephone-Keyb.patch new file mode 100644 index 0000000000000000000000000000000000000000..655fc7909414a0532fed5f0fe1ff977d0a0890e9 --- /dev/null +++ b/files/linux/0461-arm64-dts-rk3399-pinephone-pro-Enable-Pinephone-Keyb.patch @@ -0,0 +1,34 @@ +From 08b070493cb508911e7b31ef457ca8e34dc6bbce Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sat, 16 Apr 2022 02:15:10 +0200 +Subject: [PATCH 461/520] arm64: dts: rk3399-pinephone-pro: Enable Pinephone + Keyboard power manager + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index 879255aef1eb2..ebc6e98b79d3b 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -527,6 +527,15 @@ + flash-max-timeout-us = <250000>; + }; + }; ++ ++ keyboard-power { ++ compatible = "megi,pinephone-keyboard-power-manager"; ++ phone-battery = "rk818-battery"; ++ phone-usb = "rk818-usb"; ++ kb-battery = "ip5xxx-battery"; ++ kb-boost = "ip5xxx-boost"; ++ kb-usb = "ip5xxx-usb"; ++ }; + }; + + &cpu_l0 { +-- +2.36.1 + diff --git a/files/linux/0519-arm64-dts-rk3399-pinephone-pro-Use-4-lane-mode-for-s.patch b/files/linux/0519-arm64-dts-rk3399-pinephone-pro-Use-4-lane-mode-for-s.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2070c830481842505b4ae5c892e4bd1344ff661 --- /dev/null +++ b/files/linux/0519-arm64-dts-rk3399-pinephone-pro-Use-4-lane-mode-for-s.patch @@ -0,0 +1,38 @@ +From f87eeb4faa7318b779f858a674821a3cc13e6e35 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Fri, 27 May 2022 16:44:42 +0200 +Subject: [PATCH 519/520] arm64: dts: rk3399-pinephone-pro: Use 4-lane mode for + selfie camera + +It works, enable it. + +Signed-off-by: Ondrej Jirman +--- + arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +index ebc6e98b79d3b..182e042a15baf 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -946,7 +946,7 @@ + port { + ucam_out: endpoint { + remote-endpoint = <&mipi_in_ucam>; +- data-lanes = <1 2>; ++ data-lanes = <1 2 3 4>; + }; + }; + }; +@@ -1164,7 +1164,7 @@ + mipi_in_ucam: endpoint@0 { + reg = <0>; + remote-endpoint = <&ucam_out>; +- data-lanes = <1 2>; ++ data-lanes = <1 2 3 4>; + }; + }; + }; +-- +2.36.1 + diff --git a/files/linux/add-initial-ppp-support.patch b/files/linux/add-initial-ppp-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..9502e26be7bd21823f41901066f0b69fbe07ed49 --- /dev/null +++ b/files/linux/add-initial-ppp-support.patch @@ -0,0 +1,997 @@ +From: Tom Fitzhenry +To: Rob Herring , + Krzysztof Kozlowski , + Heiko Stuebner , + linux-rockchip@lists.infradead.org +Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, + linux-kernel@vger.kernel.org, + Samuel Holland , Ondrej Jirman , + Martijn Braam , + Tom Fitzhenry , + Ondrej Jirman +Subject: [PATCH 2/2] arm64: dts: rockchip: Add initial support for Pine64 PinePhone Pro +Date: Sun, 29 May 2022 13:17:05 +1000 [thread overview] +Message-ID: <20220529031705.278631-3-tom@tom-fitzhenry.me.uk> (raw) +In-Reply-To: <20220529031705.278631-1-tom@tom-fitzhenry.me.uk> + +This is a basic DT that includes only features that are already +supported by mainline drivers. + +Tested to work: booting from eMMC, WiFi, charging. + +Future patches will flesh out the DT. Some components, e.g. the panel, +are awaiting driver mainlining. + +This is derived from a combination of https://gitlab.com/pine64-org/linux +and https://megous.com/git/linux. + +https://wiki.pine64.org/wiki/PinePhone_Pro + +Co-developed-by: Ondrej Jirman +Co-developed-by: Martijn Braam +Signed-off-by: Tom Fitzhenry +--- + arch/arm64/boot/dts/rockchip/Makefile | 1 + + .../dts/rockchip/rk3399-pinephone-pro.dts | 939 ++++++++++++++++++ + 2 files changed, 940 insertions(+) + create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts + +diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile +index 4ae9f35434b8..c00e7922d974 100644 +--- a/arch/arm64/boot/dts/rockchip/Makefile ++++ b/arch/arm64/boot/dts/rockchip/Makefile +@@ -41,6 +41,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinephone-pro.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +new file mode 100644 +index 000000000000..b1a486db1dfe +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +@@ -0,0 +1,939 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2020 Martijn Braam ++ * Copyright (c) 2021 Kamil TrzciƄski ++ */ ++ ++// PinePhone Pro datasheet: https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf ++ ++/dts-v1/; ++#include ++#include ++#include ++#include ++#include "rk3399.dtsi" ++#include "rk3399-opp.dtsi" ++ ++/ { ++ model = "Pine64 PinePhonePro"; ++ compatible = "pine64,pinephone-pro", "rockchip,rk3399"; ++ ++ chosen { ++ bootargs = "earlycon=uart8250,mmio32,0xff1a0000"; ++ stdout-path = "serial2:115200n8"; ++ }; ++ ++ // Per "RK 3399 SARADC", page 8. ++ adc-keys { ++ compatible = "adc-keys"; ++ io-channels = <&saradc 1>; ++ io-channel-names = "buttons"; ++ keyup-threshold-microvolt = <1600000>; ++ poll-interval = <100>; ++ ++ button-up { ++ label = "Volume Up"; ++ linux,code = ; ++ press-threshold-microvolt = <100000>; ++ }; ++ ++ button-down { ++ label = "Volume Down"; ++ linux,code = ; ++ press-threshold-microvolt = <300000>; ++ }; ++ }; ++ ++ cluster1_opp_ppp: opp-table1b { ++ compatible = "operating-points-v2"; ++ opp-shared; ++ ++ opp00 { ++ opp-hz = /bits/ 64 <408000000>; ++ opp-microvolt = <800000>; ++ clock-latency-ns = <40000>; ++ }; ++ opp01 { ++ opp-hz = /bits/ 64 <600000000>; ++ opp-microvolt = <800000>; ++ }; ++ opp02 { ++ opp-hz = /bits/ 64 <816000000>; ++ opp-microvolt = <825000>; ++ }; ++ opp03 { ++ opp-hz = /bits/ 64 <1008000000>; ++ opp-microvolt = <875000>; ++ }; ++ opp04 { ++ opp-hz = /bits/ 64 <1200000000>; ++ opp-microvolt = <950000>; ++ }; ++ opp05 { ++ opp-hz = /bits/ 64 <1416000000>; ++ opp-microvolt = <1025000>; ++ }; ++ }; ++ ++ // Per "BACKLIGHT", page 16. ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm0 0 1000000 0>; ++ pwm-delay-us = <10000>; ++ }; ++ ++ // Per "RK3399 GPIO", page 11. ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&red_led_pin &green_led_pin &blue_led_pin>; ++ ++ led-standby { ++ color = ; ++ default-state = "off"; ++ function = LED_FUNCTION_STANDBY; ++ gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; ++ label = "red:standby"; ++ panic-indicator; ++ retain-state-suspended; ++ }; ++ ++ led-pwr { ++ color = ; ++ default-state = "on"; ++ function = LED_FUNCTION_POWER; ++ gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>; ++ label = "green:disk-activity"; ++ }; ++ ++ blue-charging { ++ color = ; ++ default-state = "off"; ++ function = LED_FUNCTION_CHARGING; ++ gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>; ++ label = "blue:charging"; ++ }; ++ }; ++ ++ gpio-key-power { ++ compatible = "gpio-keys"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwrbtn_pin>; ++ ++ power { ++ debounce-interval = <20>; ++ // Per "PMU Controler", page 4. ++ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; ++ label = "Power"; ++ linux,code = ; ++ wakeup-source; ++ }; ++ }; ++ ++ sdio_pwrseq: sdio-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rk818 1>; ++ clock-names = "ext_clock"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_enable_h>; ++ post-power-on-delay-ms = <100>; ++ power-off-delay-us = <500000>; ++ ++ /* WL_REG_ON on module */ ++ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ vibrator { ++ compatible = "gpio-vibrator"; ++ // Per "GPIO", page 11. ++ enable-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>; ++ // Per "Motor", page 17. ++ vcc-supply = <&vcc3v3_sys>; ++ }; ++ ++ /* Power tree */ ++ /* Root power source */ ++ vcc_sysin: vcc-sysin { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_sysin"; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ ++ vcc5v0_sys: vcc5v0-host-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_sys"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc_sysin>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc5v0_typec: vcc5v0-typec-regulator { ++ compatible = "regulator-fixed"; ++ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_typec_en>; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-name = "vcc5v0_typec"; ++ vin-supply = <&vcc5v0_sys>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ /* Main 3.3v supply */ ++ vcc3v3_sys: wifi_bat: vcc3v3-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc_sysin>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc1v8_codec: vcc1v8-codec-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc1v8_codec_en>; ++ regulator-name = "vcc1v8_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ /* MIPI DSI panel 1.8v supply */ ++ vcc1v8_lcd: vcc1v8-lcd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ regulator-name = "vcc1v8_lcd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&display_pwren1>; ++ }; ++ ++ /* MIPI DSI panel 2.8v supply */ ++ vcc2v8_lcd: vcc2v8-lcd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ regulator-name = "vcc2v8_lcd"; ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ vin-supply = <&vcc3v3_sys>; ++ gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&display_pwren>; ++ }; ++ ++ vcca1v8_s3: vcc1v8-s3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcca1v8_s3"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++}; ++ ++&cpu_l0 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l1 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l2 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l3 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_b0 { ++ cpu-supply = <&vdd_cpu_b>; ++ operating-points-v2 = <&cluster1_opp_ppp>; ++}; ++ ++&cpu_b1 { ++ cpu-supply = <&vdd_cpu_b>; ++ operating-points-v2 = <&cluster1_opp_ppp>; ++}; ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&i2c0 { ++ // Per "SCL clock frequency", page 30, RK818 datasheet. ++ clock-frequency = <400000>; ++ i2c-scl-rising-time-ns = <168>; ++ i2c-scl-falling-time-ns = <4>; ++ status = "okay"; ++ ++ // Per "PMIC RK818-3", page 13. ++ rk818: pmic@1c { ++ compatible = "rockchip,rk818"; ++ reg = <0x1c>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ #clock-cells = <1>; ++ clock-output-names = "xin32k", "rk808-clkout2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int_l>; ++ rockchip,system-power-controller; ++ wakeup-source; ++ extcon = <&fusb0>; ++ ++ vcc1-supply = <&vcc_sysin>; ++ vcc2-supply = <&vcc_sysin>; ++ vcc3-supply = <&vcc_sysin>; ++ vcc4-supply = <&vcc_sysin>; ++ vcc6-supply = <&vcc_sysin>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc_sysin>; ++ vcc9-supply = <&vcc3v3_sys>; ++ ++ regulators { ++ vdd_cpu_l: DCDC_REG1 { ++ regulator-name = "vdd_cpu_l"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_center: DCDC_REG2 { ++ regulator-name = "vdd_center"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ // DDR ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ // Power RAM while suspended. ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: vcc_wl: DCDC_REG4 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ // Audio codec. ++ vcca3v0_codec: LDO_REG1 { ++ regulator-name = "vcca3v0_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ // Touch screen. ++ vcc3v0_touch: LDO_REG2 { ++ regulator-name = "vcc3v0_touch"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_codec: LDO_REG3 { ++ regulator-name = "vcca1v8_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_power_on: LDO_REG4 { ++ regulator-name = "vcc_power_on"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcc_3v0: LDO_REG5 { ++ regulator-name = "vcc_3v0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcc_1v5: LDO_REG6 { ++ regulator-name = "vcc_1v5"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1500000>; ++ }; ++ }; ++ ++ vcc1v8_dvp: LDO_REG7 { ++ regulator-name = "vcc1v8_dvp"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_s3: LDO_REG8 { ++ regulator-name = "vcc3v3_s3"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vccio_sd: LDO_REG9 { ++ regulator-name = "vccio_sd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcc3v3_s0: SWITCH_REG { ++ regulator-name = "vcc3v3_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ boost_otg: DCDC_BOOST { ++ regulator-name = "boost_otg"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <5000000>; ++ }; ++ }; ++ ++ otg_switch: OTG_SWITCH { ++ regulator-name = "otg_switch"; ++ }; ++ }; ++ }; ++ ++ vdd_cpu_b: regulator@40 { ++ compatible = "silergy,syr827"; ++ reg = <0x40>; ++ fcs,suspend-voltage-selector = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel1_pin>; ++ regulator-name = "vdd_cpu_b"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: regulator@41 { ++ compatible = "silergy,syr828"; ++ reg = <0x41>; ++ fcs,suspend-voltage-selector = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel2_pin>; ++ regulator-name = "vdd_gpu"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++}; ++ ++&i2c1 { ++ i2c-scl-rising-time-ns = <300>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "okay"; ++}; ++ ++&i2c3 { ++ i2c-scl-rising-time-ns = <450>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "okay"; ++ ++ // Per "Ambient Light", page 17. ++ light-sensor@48 { ++ compatible = "sensortek,stk3311"; ++ reg = <0x48>; ++ interrupt-parent = <&gpio4>; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&stk3311_int>; ++ vdd-supply = <&vcc_3v0>; ++ leda-supply = <&vcc_3v0>; ++ }; ++}; ++ ++&i2c4 { ++ i2c-scl-rising-time-ns = <600>; ++ i2c-scl-falling-time-ns = <20>; ++ status = "okay"; ++ ++ // Per "TYPE-C", page 23. ++ fusb0: typec-portc@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&fusb0_int>; ++ vbus-supply = <&vcc5v0_typec>; ++ ++ connector { ++ compatible = "usb-c-connector"; ++ data-role = "dual"; ++ label = "USB-C"; ++ op-sink-microwatt = <1000000>; ++ power-role = "dual"; ++ sink-pdos = ++ ; ++ source-pdos = ++ ; ++ try-power-role = "sink"; ++ ++ extcon-cables = <1 2 5 6 9 10 12 44>; ++ typec-altmodes = <0xff01 1 0x001c0c00 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ ++ usbc_hs: endpoint { ++ remote-endpoint = ++ <&u2phy0_typec_hs>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ ++ usbc_ss: endpoint { ++ remote-endpoint = ++ <&tcphy0_typec_ss>; ++ }; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ ++ usbc_dp: endpoint { ++ remote-endpoint = ++ <&tcphy0_typec_dp>; ++ }; ++ }; ++ }; ++ }; ++ }; ++ ++ // Per "Gyro", page 17. ++ accelerometer@68 { ++ compatible = "invensense,mpu6500"; ++ reg = <0x68>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ vdd-supply = <&vcc_1v8>; ++ vddio-supply = <&vcc_1v8>; ++ ++ mount-matrix = ++ "1", "0", "0", ++ "0", "-1", "0", ++ "0", "0", "1"; ++ }; ++}; ++ ++&io_domains { ++ status = "okay"; ++ ++ bt656-supply = <&vcc1v8_dvp>; ++ audio-supply = <&vcca1v8_codec>; ++ sdmmc-supply = <&vccio_sd>; ++ gpio1830-supply = <&vcc_3v0>; ++}; ++ ++&pmu_io_domains { ++ pmu1830-supply = <&vcc_1v8>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ bt { ++ bt_enable_h: bt-enable-h { ++ rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ bt_host_wake_l: bt-host-wake-l { ++ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ bt_wake_l: bt-wake-l { ++ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ buttons { ++ pwrbtn_pin: pwrbtn-pin { ++ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ fusb302x { ++ fusb0_int: fusb0-int { ++ rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ leds { ++ red_led_pin: red-led-pin { ++ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ green_led_pin: green-led-pin { ++ rockchip,pins = <4 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ blue_led_pin: blue-led-pin { ++ rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int_l: pmic-int-l { ++ rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ vsel1_pin: vsel1-pin { ++ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ vsel2_pin: vsel2-pin { ++ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ sdcard { ++ sdmmc0_pwr_h: sdmmc0-pwr-h { ++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ }; ++ ++ sdio-pwrseq { ++ wifi_enable_h: wifi-enable-h { ++ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ usb-typec { ++ vcc5v0_typec_en: vcc5v0_typec_en { ++ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ dsi { ++ display_rst_l: display-rst-l { ++ rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ display_pwren: display-pwren { ++ rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ display_pwren1: display-pwren1 { ++ rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ stk3311 { ++ stk3311_int: stk3311-int { ++ rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ sound { ++ vcc1v8_codec_en: vcc1v8-codec-en { ++ rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++}; ++ ++&pwm0 { ++ status = "okay"; ++}; ++ ++&pwm1 { ++ status = "okay"; ++}; ++ ++&pwm2 { ++ status = "okay"; ++}; ++ ++// Per "SARADC", page 8. ++&saradc { ++ vref-supply = <&vcca1v8_s3>; ++ status = "okay"; ++}; ++ ++&sdio0 { ++ bus-width = <4>; ++ cap-sd-highspeed; ++ cap-sdio-irq; ++ disable-wp; ++ keep-power-in-suspend; ++ mmc-pwrseq = <&sdio_pwrseq>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; ++ sd-uhs-sdr104; ++ status = "okay"; ++}; ++ ++// Per "SDMMC Controler", page 6. ++&sdmmc { ++ bus-width = <4>; ++ cap-sd-highspeed; ++ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ max-frequency = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; ++ vmmc-supply = <&vcc3v3_sys>; ++ vqmmc-supply = <&vccio_sd>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ mmc-hs200-1_8v; ++ non-removable; ++ status = "okay"; ++}; ++ ++&tcphy0 { ++ extcon = <&fusb0>; ++ status = "okay"; ++}; ++ ++&tcphy0_dp { ++ port { ++ tcphy0_typec_dp: endpoint { ++ remote-endpoint = <&usbc_dp>; ++ }; ++ }; ++}; ++ ++&tcphy0_usb3 { ++ port { ++ tcphy0_typec_ss: endpoint { ++ remote-endpoint = <&usbc_ss>; ++ }; ++ }; ++}; ++ ++// Enable thermal sensors. ++&tsadc { ++ /* tshut mode 0:CRU 1:GPIO */ ++ rockchip,hw-tshut-mode = <1>; ++ /* tshut polarity 0:LOW 1:HIGH */ ++ rockchip,hw-tshut-polarity = <1>; ++ status = "okay"; ++}; ++ ++&u2phy0 { ++ status = "okay"; ++ ++ u2phy0_otg: otg-port { ++ status = "okay"; ++ }; ++ ++ u2phy0_host: host-port { ++ status = "okay"; ++ phy-supply = <&vcc5v0_sys>; ++ }; ++ ++ port { ++ u2phy0_typec_hs: endpoint { ++ remote-endpoint = <&usbc_hs>; ++ }; ++ }; ++}; ++ ++&u2phy1 { ++ status = "okay"; ++ ++ u2phy1_otg: otg-port { ++ status = "okay"; ++ }; ++ ++ u2phy1_host: host-port { ++ status = "okay"; ++ phy-supply = <&vcc5v0_sys>; ++ }; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; ++ uart-has-rtscts; ++ status = "okay"; ++ ++ // Per "WIFI/BT MODULE", page 19. ++ bluetooth { ++ compatible = "brcm,bcm4345c5"; ++ clocks = <&rk818 1>; ++ clock-names = "lpo"; ++ device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>; ++ host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; ++ max-speed = <1500000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>; ++ shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; ++ vbat-supply = <&wifi_bat>; ++ vddio-supply = <&vcc_wl>; ++ }; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usbdrd3_0 { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_0 { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&vopb { ++ status = "okay"; ++}; ++ ++&vopb_mmu { ++ status = "okay"; ++}; ++ ++&vopl { ++ status = "okay"; ++}; ++ ++&vopl_mmu { ++ status = "okay"; ++}; +-- +2.36.0 \ No newline at end of file diff --git a/files/linux/ylloc-redef.patch b/files/linux/ylloc-redef.patch new file mode 100644 index 0000000000000000000000000000000000000000..91ca22451ec0f60416a55cad5755277a63c2f36e --- /dev/null +++ b/files/linux/ylloc-redef.patch @@ -0,0 +1,56 @@ +From 11647f99b4de6bc460e106e876f72fc7af3e54a6 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Tue, 14 Jan 2020 18:53:41 +0100 +Subject: [PATCH] scripts/dtc: Remove redundant YYLOC global declaration + +commit e33a814e772cdc36436c8c188d8c42d019fda639 upstream. + +gcc 10 will default to -fno-common, which causes this error at link +time: + + (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here + +This is because both dtc-lexer as well as dtc-parser define the same +global symbol yyloc. Before with -fcommon those were merged into one +defintion. The proper solution would be to to mark this as "extern", +however that leads to: + + dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls] + 26 | extern YYLTYPE yylloc; + | ^~~~~~ +In file included from dtc-lexer.l:24: +dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here + 127 | extern YYLTYPE yylloc; + | ^~~~~~ +cc1: all warnings being treated as errors + +which means the declaration is completely redundant and can just be +dropped. + +Signed-off-by: Dirk Mueller +Signed-off-by: David Gibson +[robh: cherry-pick from upstream] +Cc: stable@vger.kernel.org +Signed-off-by: Rob Herring +[nc: Also apply to dtc-lexer.lex.c_shipped due to a lack of + e039139be8c2, where dtc-lexer.l started being used] +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +Change-Id: I7f299451e99aab09375883546e47505ec0937c26 +--- + scripts/dtc/dtc-lexer.l | 1 - + scripts/dtc/dtc-lexer.l | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l +index c600603044f3..cf7707be43aa 100644 +--- a/scripts/dtc/dtc-lexer.l ++++ b/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ \ No newline at end of file diff --git a/files/u-boot/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch b/files/u-boot/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch new file mode 100644 index 0000000000000000000000000000000000000000..cc1e6a4f63190e9058ec9fe6598cf87ff1131810 --- /dev/null +++ b/files/u-boot/0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch @@ -0,0 +1,32 @@ +From 7f5071f906f79bdc99d6b4b0ccf0cb280abe740b Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Tue, 20 Dec 2016 11:25:12 +0100 +Subject: [PATCH] sunxi: h3: Fix PLL1 setup to never use dividers + +Kernel would lower the divider on first CLK change and cause the +lock up. +--- + arch/arm/mach-sunxi/clock_sun6i.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-sunxi/clock_sun6i.c b/arch/arm/mach-sunxi/clock_sun6i.c +index 50fb302a19..91aa2a0478 100644 +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -94,11 +94,10 @@ void clock_set_pll1(unsigned int clk) + int k = 1; + int m = 1; + +- if (clk > 1152000000) { +- k = 2; +- } else if (clk > 768000000) { ++ if (clk >= 1368000000) { + k = 3; +- m = 2; ++ } else if (clk >= 768000000) { ++ k = 2; + } + + /* Switch to 24MHz clock while changing PLL1 */ +-- +2.11.0 \ No newline at end of file diff --git a/files/u-boot/add-initial-pinephone-pro-support.patch b/files/u-boot/add-initial-pinephone-pro-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..c4f85eafcfd4435f2a78c43d7713d08215305364 --- /dev/null +++ b/files/u-boot/add-initial-pinephone-pro-support.patch @@ -0,0 +1,947 @@ +Authentication-Results: mail-b.sr.ht; dkim=pass header.d=brixit-nl.20210112.gappssmtp.com header.i=@brixit-nl.20210112.gappssmtp.com +Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) + by mail-b.sr.ht (Postfix) with ESMTPS id D253611EFF3 + for <~postmarketos/upstreaming@lists.sr.ht>; Thu, 21 Oct 2021 17:18:46 +0000 (UTC) +Received: by mail-ed1-f66.google.com with SMTP id g10so3710106edj.1 + for <~postmarketos/upstreaming@lists.sr.ht>; Thu, 21 Oct 2021 10:18:46 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=brixit-nl.20210112.gappssmtp.com; s=20210112; + h=from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=3ip80XpahOgzI0hu1UcM/8rGGNr9FBm4bV0TVq3Lo3Y=; + b=IIYfwhl0tAC1ViusRN0zKMKCuH06mxdjhNMxU0XXsZg6xRZ9R3jiDnfrP3JcyLRvf8 + TP/6DpgvG0//kAjnQy8M/pwvI+rsrmMujQ25OjIC+yvAcRx9/9DKBxVBUg3aUy8WhSxM + VSI9lgTZ8PBYORW+shnmQUsYHJ1eqMT20NV3kKj724VlFgO/RDqr8VOdGoRk+mx7AqSg + HR+rl+kTaEbRZqeBSFyaHD4QOhhg+g9CylfWsb4Gpi2F7yOhWKqrHRAXkgs3alDZ/Lvr + J2XkmDC7SgAGlFBElvS7eSlSBsfJqI5kAq7uujgX3lwAT6Z7UURCvehA1b3cwut3EWcl + TAFQ== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20210112; + h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=3ip80XpahOgzI0hu1UcM/8rGGNr9FBm4bV0TVq3Lo3Y=; + b=uSoZvhoDvY/MdQwqGzedBAo8e79/FPBMnhCBnHLp9AOD/ERRhXKrCrbUotAiDMV1Fb + niAKAr5D2Apa3c08ghEYFcSx0Fv3BrDXKmcIXnhsuHGkBQ1VuEKduGwKzaGyv47CLeAE + q1edMHfi/1m0FIp1W/GG40g2IJ667xGqLtugFhJJCDU82iq3NeJonIOh8lEfu6ERnHGj + mEZr6Rin19uxnVkbWsUXkSVof1Mf7HgJJatrMGqOJpM8A7KtWKnJ9PpRzvAuWvmTnIRn + EaBz0qpsFcwM+kzE+YLWveOf3EhelTCl3nm1Do6Jb79TE3BVTrh0M62T2UWmsPdKHNGT + 3/Gw== +X-Gm-Message-State: AOAM531e/rHz0fsyNagJ62VCQwzXaN28AJXmQoL5ww36A67C5FJFGp8s + BwCryJDhjFZ4vEfUzzqAfGecTw== +X-Google-Smtp-Source: ABdhPJzWAx5oxg2k97bknWrjjSlzn+z533POqMkUW8SZGRwOV8AWh6qtwR2aCbgRtrlocerw65NhVw== +X-Received: by 2002:a17:906:2511:: with SMTP id i17mr432703ejb.371.1634836725364; + Thu, 21 Oct 2021 10:18:45 -0700 (PDT) +Received: from msi.net.brixit.nl ([2a00:bba0:120c:9f00:7a8e:8795:650f:7c4e]) + by smtp.gmail.com with ESMTPSA id h18sm2753558ejt.29.2021.10.21.10.18.44 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Thu, 21 Oct 2021 10:18:45 -0700 (PDT) +From: Martijn Braam +To: u-boot@lists.denx.de +Cc: ~postmarketos/upstreaming@lists.sr.ht, + Martijn Braam , + Andre Przywara , + "Arnaud Patard (Rtp)" , + Christian Hewitt , + Fabio Estevam , + Heiko Schocher , + Hugh Cole-Baker , + Jagan Teki , + Kever Yang , + Neil Armstrong , + Peter Robinson , + Philipp Tomsich , + Philipp Tomsich , + Rick Chen , + Simon Glass , + Tim Harvey +Subject: [PATCH] rockchip: Add initial support for the PinePhone Pro +Date: Thu, 21 Oct 2021 19:18:43 +0200 +Message-Id: <20211021171843.6301-1-martijn@brixit.nl> +X-Mailer: git-send-email 2.33.1 +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit + +This is a new device by PINE64 that's very similar to the Pinebook Pro +that's already supported. + +Specification: +- Rockchip RK3399 +- 4GB Dual-Channel LPDDR4 +- 128GB eMMC +- mSD card slot +- AP6255 for 802.11ac WiFi and Bluetooth +- 6 inch 720*1440 DSI display +- Quectel EG25g usb modem +- Type-C port with alt-mode display (DP 1.2) and PD charging. + +Signed-off-by: Martijn Braam +--- + + arch/arm/dts/Makefile | 1 + + arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi | 44 ++ + arch/arm/dts/rk3399-pinephone-pro.dts | 520 ++++++++++++++++++ + arch/arm/mach-rockchip/rk3399/Kconfig | 8 + + board/pine64/pinephone-pro-rk3399/Kconfig | 15 + + board/pine64/pinephone-pro-rk3399/MAINTAINERS | 8 + + board/pine64/pinephone-pro-rk3399/Makefile | 1 + + .../pinephone-pro-rk3399.c | 57 ++ + configs/pinephone-pro-rk3399_defconfig | 92 ++++ + include/configs/pinephone-pro-rk3399.h | 23 + + 10 files changed, 769 insertions(+) + create mode 100644 arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi + create mode 100644 arch/arm/dts/rk3399-pinephone-pro.dts + create mode 100644 board/pine64/pinephone-pro-rk3399/Kconfig + create mode 100644 board/pine64/pinephone-pro-rk3399/MAINTAINERS + create mode 100644 board/pine64/pinephone-pro-rk3399/Makefile + create mode 100644 board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c + create mode 100644 configs/pinephone-pro-rk3399_defconfig + create mode 100644 include/configs/pinephone-pro-rk3399.h + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index ed3d360bb1..3206370226 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -137,6 +137,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ + rk3399-nanopi-r4s.dtb \ + rk3399-orangepi.dtb \ + rk3399-pinebook-pro.dtb \ ++ rk3399-pinephone-pro.dtb \ + rk3399-puma-haikou.dtb \ + rk3399-roc-pc.dtb \ + rk3399-roc-pc-mezzanine.dtb \ +diff --git a/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi +new file mode 100644 +index 0000000000..9d44db5978 +--- /dev/null ++++ b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi +@@ -0,0 +1,44 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2019 Peter Robinson ++ * Copyright (C) 2021 Martijn Braam ++ */ ++ ++#include "rk3399-u-boot.dtsi" ++#include "rk3399-sdram-lpddr4-100.dtsi" ++ ++/ { ++ aliases { ++ spi0 = &spi1; ++ }; ++ ++ chosen { ++ u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; ++ }; ++ ++ config { ++ u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ ++ }; ++}; ++ ++&i2c0 { ++ u-boot,dm-pre-reloc; ++}; ++ ++&rk818 { ++ u-boot,dm-pre-reloc; ++}; ++ ++&rng { ++ status = "okay"; ++}; ++ ++&sdhci { ++ max-frequency = <25000000>; ++ u-boot,dm-pre-reloc; ++}; ++ ++&sdmmc { ++ max-frequency = <20000000>; ++ u-boot,dm-pre-reloc; ++}; +diff --git a/arch/arm/dts/rk3399-pinephone-pro.dts b/arch/arm/dts/rk3399-pinephone-pro.dts +new file mode 100644 +index 0000000000..3fe1845ced +--- /dev/null ++++ b/arch/arm/dts/rk3399-pinephone-pro.dts +@@ -0,0 +1,520 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2021 Martijn Braam ++ */ ++ ++/dts-v1/; ++#include "rk3399.dtsi" ++#include "rk3399-opp.dtsi" ++ ++/ { ++ model = "Pine64 PinePhone Pro"; ++ compatible = "pine64,pinephone-pro", "rockchip,rk3399"; ++ ++ chosen { ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ sdio_pwrseq: sdio-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ pinctrl-names = "default"; ++ }; ++ ++ /* Power tree */ ++ /* Root power source */ ++ vcc_sysin: vcc-sysin { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_sysin"; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ ++ /* Main 3.3v supply */ ++ vcc3v3_sys: vcc3v3-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc_sysin>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++}; ++ ++&cpu_l0 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l1 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l2 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l3 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_b0 { ++ cpu-supply = <&vdd_cpu_b>; ++}; ++ ++&cpu_b1 { ++ cpu-supply = <&vdd_cpu_b>; ++}; ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&i2c0 { ++ clock-frequency = <400000>; ++ i2c-scl-rising-time-ns = <168>; ++ i2c-scl-falling-time-ns = <4>; ++ status = "okay"; ++ ++ rk818: pmic@1c { ++ compatible = "rockchip,rk818"; ++ reg = <0x1c>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ #clock-cells = <1>; ++ clock-output-names = "xin32k", "rk808-clkout2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int_l>; ++ rockchip,system-power-controller; ++ wakeup-source; ++ ++ vcc1-supply = <&vcc_sysin>; ++ vcc2-supply = <&vcc_sysin>; ++ vcc3-supply = <&vcc_sysin>; ++ vcc4-supply = <&vcc_sysin>; ++ vcc6-supply = <&vcc_sysin>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc_sysin>; ++ vcc9-supply = <&vcc3v3_sys>; ++ ++ regulators { ++ vdd_cpu_l: DCDC_REG1 { ++ regulator-name = "vdd_cpu_1"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_center: DCDC_REG2 { ++ regulator-name = "vdd_center"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG4 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcca3v0_codec: LDO_REG1 { ++ regulator-name = "vcca3v0_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v0_touch: LDO_REG2 { ++ regulator-name = "vcc3v0_touch"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_codec: LDO_REG3 { ++ regulator-name = "vcca1v8_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_power_on: LDO_REG4 { ++ regulator-name = "vcc_power_on"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcc_3v0: LDO_REG5 { ++ regulator-name = "vcc_3v0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcc_1v5: LDO_REG6 { ++ regulator-name = "vcc_1v5"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1500000>; ++ }; ++ }; ++ ++ vcc1v8_dvp: LDO_REG7 { ++ regulator-name = "vcc1v8_dvp"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_s3: LDO_REG8 { ++ regulator-name = "vcc3v3_s3"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_sd: LDO_REG9 { ++ regulator-name = "vcc_sd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcc3v3_s0: SWITCH_REG { ++ regulator-name = "vcc3v3_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ boost_otg: DCDC_BOOST { ++ regulator-name = "boost_otg"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <5000000>; ++ }; ++ }; ++ ++ otg_switch: OTG_SWITCH { ++ regulator-name = "otg_switch"; ++ }; ++ }; ++ }; ++ ++ vdd_cpu_b: regulator@40 { ++ compatible = "silergy,syr827"; ++ reg = <0x40>; ++ fcs,suspend-voltage-selector = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel1_pin>; ++ regulator-name = "vdd_cpu_b"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: regulator@41 { ++ compatible = "silergy,syr828"; ++ reg = <0x41>; ++ fcs,suspend-voltage-selector = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel2_pin>; ++ regulator-name = "vdd_gpu"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++}; ++ ++&i2c1 { ++ i2c-scl-rising-time-ns = <300>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "okay"; ++}; ++ ++&i2c3 { ++ i2c-scl-rising-time-ns = <450>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "okay"; ++}; ++ ++&i2c4 { ++ i2c-scl-rising-time-ns = <600>; ++ i2c-scl-falling-time-ns = <20>; ++ status = "okay"; ++ ++ fusb0: typec-portc@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&fusb0_int>; ++ status = "okay"; ++ }; ++}; ++ ++&io_domains { ++ status = "okay"; ++ ++ bt656-supply = <&vcc1v8_dvp>; ++ audio-supply = <&vcca1v8_codec>; ++ sdmmc-supply = <&vcc_sd>; ++ gpio1830-supply = <&vcc_3v0>; ++}; ++ ++&pmu_io_domains { ++ pmu1830-supply = <&vcc_3v0>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ bt { ++ bt_enable_h: bt-enable-h { ++ rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ bt_host_wake_l: bt-host-wake-l { ++ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ bt_wake_l: bt-wake-l { ++ rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ buttons { ++ pwrbtn: pwrbtn { ++ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ fusb302x { ++ fusb0_int: fusb0-int { ++ rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ leds { ++ work_led_pin: work-led-pin { ++ rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ diy_led_pin: diy-led-pin { ++ rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ pcie { ++ pcie_perst: pcie-perst { ++ rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ pcie_pwr_en: pcie-pwr-en { ++ rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int_l: pmic-int-l { ++ rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ vsel1_pin: vsel1-pin { ++ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ vsel2_pin: vsel2-pin { ++ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ sdcard { ++ sdmmc0_pwr_h: sdmmc0-pwr-h { ++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ }; ++ ++ sdio-pwrseq { ++ wifi_enable_h: wifi-enable-h { ++ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ usb-typec { ++ vcc5v0_typec_en: vcc5v0_typec_en { ++ rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ usb2 { ++ vcc5v0_host_en: vcc5v0-host-en { ++ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++&pwm0 { ++ status = "okay"; ++}; ++ ++&pwm1 { ++ status = "okay"; ++}; ++ ++&pwm2 { ++ status = "okay"; ++}; ++ ++&sdio0 { ++ bus-width = <4>; ++ cap-sd-highspeed; ++ cap-sdio-irq; ++ disable-wp; ++ keep-power-in-suspend; ++ mmc-pwrseq = <&sdio_pwrseq>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; ++ sd-uhs-sdr104; ++ status = "okay"; ++}; ++ ++&sdmmc { ++ bus-width = <4>; ++ cap-sd-highspeed; ++ cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ max-frequency = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; ++ vmmc-supply = <&vcc3v3_s3>; ++ vqmmc-supply = <&vcc_1v8>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ mmc-hs200-1_8v; ++ non-removable; ++ status = "okay"; ++}; ++ ++&tsadc { ++ /* tshut mode 0:CRU 1:GPIO */ ++ rockchip,hw-tshut-mode = <1>; ++ /* tshut polarity 0:LOW 1:HIGH */ ++ rockchip,hw-tshut-polarity = <1>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&vopb { ++ status = "okay"; ++}; ++ ++&vopb_mmu { ++ status = "okay"; ++}; ++ ++&vopl { ++ status = "okay"; ++}; ++ ++&vopl_mmu { ++ status = "okay"; ++}; +diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig +index 17628f9171..3ba603ca80 100644 +--- a/arch/arm/mach-rockchip/rk3399/Kconfig ++++ b/arch/arm/mach-rockchip/rk3399/Kconfig +@@ -28,6 +28,13 @@ config TARGET_PINEBOOK_PRO_RK3399 + with 4Gb RAM, onboard eMMC, USB-C, a USB3 and USB2 port, + 1920*1080 screen and all the usual laptop features. + ++config TARGET_PINEPHONE_PRO_RK3399 ++ bool "PinePhone Pro" ++ help ++ PinePhone Pro is a phone based on the Rockchip rk3399 SoC ++ with 4Gb RAM, onboard eMMC, USB-C, a headphone jack, ++ 720x1440 screen and an external Quectel USB modem. ++ + config TARGET_PUMA_RK3399 + bool "Theobroma Systems RK3399-Q7 (Puma)" + help +@@ -154,6 +161,7 @@ endif # BOOTCOUNT_LIMIT + source "board/firefly/roc-pc-rk3399/Kconfig" + source "board/google/gru/Kconfig" + source "board/pine64/pinebook-pro-rk3399/Kconfig" ++source "board/pine64/pinephone-pro-rk3399/Kconfig" + source "board/pine64/rockpro64_rk3399/Kconfig" + source "board/rockchip/evb_rk3399/Kconfig" + source "board/theobroma-systems/puma_rk3399/Kconfig" +diff --git a/board/pine64/pinephone-pro-rk3399/Kconfig b/board/pine64/pinephone-pro-rk3399/Kconfig +new file mode 100644 +index 0000000000..13d6465ae6 +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/Kconfig +@@ -0,0 +1,15 @@ ++if TARGET_PINEPHONE_PRO_RK3399 ++ ++config SYS_BOARD ++ default "pinephone-pro-rk3399" ++ ++config SYS_VENDOR ++ default "pine64" ++ ++config SYS_CONFIG_NAME ++ default "pinephone-pro-rk3399" ++ ++config BOARD_SPECIFIC_OPTIONS ++ def_bool y ++ ++endif +diff --git a/board/pine64/pinephone-pro-rk3399/MAINTAINERS b/board/pine64/pinephone-pro-rk3399/MAINTAINERS +new file mode 100644 +index 0000000000..9ca4fc4cbe +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/MAINTAINERS +@@ -0,0 +1,8 @@ ++PINEPHONE_PRO ++M: Martijn Braam ++S: Maintained ++F: board/pine64/rk3399-pinephone-pro/ ++F: include/configs/rk3399-pinephone-pro.h ++F: arch/arm/dts/rk3399-pinephone-pro.dts ++F: arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi ++F: configs/pinephone-pro-rk3399_defconfig +diff --git a/board/pine64/pinephone-pro-rk3399/Makefile b/board/pine64/pinephone-pro-rk3399/Makefile +new file mode 100644 +index 0000000000..8d9203053e +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/Makefile +@@ -0,0 +1 @@ ++obj-y += pinephone-pro-rk3399.o +diff --git a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c +new file mode 100644 +index 0000000000..8efeb6ea3d +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c +@@ -0,0 +1,57 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * (C) Copyright 2019 Vasily Khoruzhick ++ * (C) Copyright 2021 Martijn Braam ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define GRF_IO_VSEL_BT565_SHIFT 0 ++#define PMUGRF_CON0_VSEL_SHIFT 8 ++ ++#ifdef CONFIG_MISC_INIT_R ++static void setup_iodomain(void) ++{ ++ struct rk3399_grf_regs *grf = ++ syscon_get_first_range(ROCKCHIP_SYSCON_GRF); ++ struct rk3399_pmugrf_regs *pmugrf = ++ syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); ++ ++ /* BT565 is in 1.8v domain */ ++ rk_setreg(&grf->io_vsel, 1 << GRF_IO_VSEL_BT565_SHIFT); ++ ++ /* Set GPIO1 1.8v/3.0v source select to PMU1830_VOL */ ++ rk_setreg(&pmugrf->soc_con0, 1 << PMUGRF_CON0_VSEL_SHIFT); ++} ++ ++int misc_init_r(void) ++{ ++ const u32 cpuid_offset = 0x7; ++ const u32 cpuid_length = 0x10; ++ u8 cpuid[cpuid_length]; ++ int ret; ++ ++ setup_iodomain(); ++ ++ ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); ++ if (ret) ++ return ret; ++ ++ ret = rockchip_cpuid_set(cpuid, cpuid_length); ++ if (ret) ++ return ret; ++ ++ ret = rockchip_setup_macaddr(); ++ ++ return ret; ++} ++ ++#endif +diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig +new file mode 100644 +index 0000000000..2cf80f7d35 +--- /dev/null ++++ b/configs/pinephone-pro-rk3399_defconfig +@@ -0,0 +1,92 @@ ++CONFIG_ARM=y ++CONFIG_SKIP_LOWLEVEL_INIT=y ++CONFIG_ARCH_ROCKCHIP=y ++CONFIG_SYS_TEXT_BASE=0x00200000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x8000 ++CONFIG_ROCKCHIP_RK3399=y ++CONFIG_TARGET_PINEPHONE_PRO_RK3399=y ++CONFIG_DEBUG_UART_BASE=0xFF1A0000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_SPL_SPI_SUPPORT=y ++CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinephone-pro" ++CONFIG_DEBUG_UART=y ++CONFIG_SYS_LOAD_ADDR=0x800800 ++CONFIG_BOOTDELAY=3 ++CONFIG_USE_PREBOOT=y ++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinephone-pro.dtb" ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_MISC_INIT_R=y ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set ++CONFIG_SPL_STACK_R=y ++CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 ++CONFIG_SPL_MTD_SUPPORT=y ++CONFIG_SPL_SPI_LOAD=y ++CONFIG_TPL=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_TIME=y ++CONFIG_CMD_PMIC=y ++CONFIG_CMD_REGULATOR=y ++CONFIG_SPL_OF_CONTROL=y ++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" ++CONFIG_ENV_IS_IN_SPI_FLASH=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_ROCKCHIP_GPIO=y ++CONFIG_SYS_I2C_ROCKCHIP=y ++CONFIG_DM_KEYBOARD=y ++CONFIG_LED=y ++CONFIG_LED_GPIO=y ++CONFIG_MISC=y ++CONFIG_ROCKCHIP_EFUSE=y ++CONFIG_MMC_DW=y ++CONFIG_MMC_DW_ROCKCHIP=y ++CONFIG_MMC_SDHCI=y ++CONFIG_MMC_SDHCI_SDMA=y ++CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_SF_DEFAULT_SPEED=20000000 ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_DM_ETH=y ++CONFIG_PHY_ROCKCHIP_INNO_USB2=y ++CONFIG_PHY_ROCKCHIP_TYPEC=y ++CONFIG_DM_PMIC_FAN53555=y ++CONFIG_PMIC_RK8XX=y ++CONFIG_REGULATOR_PWM=y ++CONFIG_REGULATOR_RK8XX=y ++CONFIG_PWM_ROCKCHIP=y ++CONFIG_RAM_RK3399_LPDDR4=y ++CONFIG_DM_RESET=y ++CONFIG_DM_RNG=y ++CONFIG_RNG_ROCKCHIP=y ++CONFIG_BAUDRATE=1500000 ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_ROCKCHIP_SPI=y ++CONFIG_SYSRESET=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_EHCI_GENERIC=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_USB_OHCI_GENERIC=y ++CONFIG_USB_DWC3=y ++CONFIG_USB_DWC3_GENERIC=y ++CONFIG_USB_KEYBOARD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y ++CONFIG_USB_HOST_ETHER=y ++CONFIG_USB_ETHER_ASIX=y ++CONFIG_USB_ETHER_RTL8152=y ++CONFIG_DM_VIDEO=y ++CONFIG_DISPLAY=y ++CONFIG_VIDEO_ROCKCHIP=y ++CONFIG_DISPLAY_ROCKCHIP_EDP=y ++CONFIG_SPL_TINY_MEMSET=y ++CONFIG_ERRNO_STR=y +diff --git a/include/configs/pinephone-pro-rk3399.h b/include/configs/pinephone-pro-rk3399.h +new file mode 100644 +index 0000000000..fefa793fdd +--- /dev/null ++++ b/include/configs/pinephone-pro-rk3399.h +@@ -0,0 +1,23 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2016 Rockchip Electronics Co., Ltd ++ * Copyright (C) 2020 Peter Robinson ++ * Copyright (C) 2021 Martijn Braam ++ */ ++ ++#ifndef __PINEPHONE_PRO_RK3399_H ++#define __PINEPHONE_PRO_RK3399_H ++ ++#define ROCKCHIP_DEVICE_SETTINGS \ ++ "stdin=serial,usbkbd\0" \ ++ "stdout=serial,vidconsole\0" \ ++ "stderr=serial,vidconsole\0" ++ ++#include ++ ++#define SDRAM_BANK_SIZE (2UL << 30) ++ ++#define CONFIG_USB_OHCI_NEW ++#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 ++ ++#endif +-- +2.33.1 diff --git a/include/aliases.yml b/include/aliases.yml index e14d873d308d6f3f41cdf336903185454552b5c0..4879a131eefcc39bdf6e2e9cee26789d25eb4deb 100644 --- a/include/aliases.yml +++ b/include/aliases.yml @@ -55,3 +55,5 @@ aliases: gnome_gitlab: https://gitlab.gnome.org/ kernel: https://git.kernel.org/pub/scm/ purism: https://source.puri.sm/ + + gnome_extensions: https://extensions.gnome.org/ diff --git a/utils/test_pinephone_image.py b/utils/test_pinephone_image.py new file mode 100644 index 0000000000000000000000000000000000000000..5518dace16c275bd100cbd7c2c1a5543e862c9ac --- /dev/null +++ b/utils/test_pinephone_image.py @@ -0,0 +1,165 @@ +"""test_pinephone_image.py: Boots a disk image and tests that it works.""" + +import argparse +import asyncio +import asyncio.subprocess +import logging +import sys +import os +import signal + +FAILURE_TIMEOUT = 3600 # seconds +BUFFER_SIZE = 80 # how many characters to read at once + +DIALOGS = { + 'default': + [ + # Login + 'login:', + 'root', + 'Password:', + 'root', + '#', + # Check release + 'cat /etc/os-release', + 'ID=org.gnome.gnomeos', + # Modem status + 'eg25-manager', + '#', # currently errors + # UI tweaks + 'gsettings get org.gnome.desktop.interface text-scaling-factor', + '1.5', + 'gsettings get org.gnome.desktop.interface scaling-factor', + '1', + 'gnome-tweaks', + '#', # No output expected without display + # Check usb utils + 'lsusb', + '#', # Output irrelevant + # Check iw + 'iw', + '#', # Output irrelevant + # Check atinout + 'atinout', + '#', # No modem in VM + # Check iputils + 'timeout 15 ping 127.0.0.1', + '#', + 'timeout 15 tracepath 127.0.0.1', + '#', + 'timeout 15 clockdiff 127.0.0.1', + '#', + # Test calls and feedbackd + 'fbcli', + 'Triggering feedback for event \'phone-incoming-call\'', + # Check kernel config + 'cat /proc/config.gz | gunzip > running.config', + '#', + 'cat running.config | grep GOODIX', # Check for goodix touchscreen config + 'CONFIG_TOUCHSCREEN_GOODIX=m', + 'cat running.config | grep TOUCHSCREEN', # Check touchscreen enabled config + 'CONFIG_INPUT_TOUCHSCREEN=y', + 'cat running.config | grep RTL8723CS', # Check for rtl8723cs wifi config + 'CONFIG_RTL8723CS=m', + # Test poweroff + 'sudo shutdown now', + 'Power down' + ] +} + + +def argument_parser(): + parser = argparse.ArgumentParser( + description="Test that PinePhone image works as expected") + parser.add_argument('--dialog', dest='dialog', default='default', + help='dialog to follow\ + (valid values {}, default: default)' + .format(DIALOGS.keys())) + + return parser + + +async def await_line(stream, marker): + """Read from 'stream' until a line appears contains 'marker'.""" + marker = marker.encode("utf-8") + buf = b"" + + while not stream.at_eof(): + chunk = await stream.read(BUFFER_SIZE) + sys.stdout.buffer.write(chunk) + buf += chunk + lines = buf.split(b'\n') + for line in lines: + if marker in line: + try: + return line.decode("utf-8") + except UnicodeDecodeError: + break + buf = lines[-1] + + +async def run_test(command, dialog): + dialog = DIALOGS[dialog] + + logging.debug("Starting process: {}", command) + process = await asyncio.create_subprocess_exec( + *command, + stdin=asyncio.subprocess.PIPE, + stdout=asyncio.subprocess.PIPE, + start_new_session=True) + + success = False + try: + while dialog: + prompt = await await_line(process.stdout, dialog.pop(0)) + + assert prompt is not None + if dialog: + process.stdin.write(dialog.pop(0).encode('ascii') + b'\n') + + print("Test successful") + success = True + except asyncio.CancelledError: + # Move straight to killing the process group + pass + finally: + try: + os.killpg(os.getpgid(process.pid), signal.SIGKILL) + except ProcessLookupError: + pass + + await process.communicate() + await process.wait() + return success + + +def fail_timeout(qemu_task): + sys.stderr.write("Test failed as timeout of %i seconds was reached.\n" % + FAILURE_TIMEOUT) + qemu_task.cancel() + + +def main(): + args = argument_parser().parse_args() + + command = ['qemu-system-aarch64', '-cpu', 'cortex-a57', '-M', 'virt', '-m', + '4096', '--nographic', '-drive', + 'if=pflash,format=raw,file=QEMU_EFI.img', + '-drive', 'if=pflash,file=varstore.img', + '-drive', 'if=virtio,file=debian.img', + '-drive', 'if=virtio,format=raw,file=disk.img'] + + loop = asyncio.get_event_loop() + qemu_task = loop.create_task(run_test(command, args.dialog)) + loop.call_later(FAILURE_TIMEOUT, fail_timeout, qemu_task) + loop.run_until_complete(qemu_task) + loop.close() + + if qemu_task.result(): + return 0 + return 1 + + +if __name__ == '__main__': + result = main() + sys.exit(result) diff --git a/utils/test_pinephone_pro_image.py b/utils/test_pinephone_pro_image.py new file mode 100644 index 0000000000000000000000000000000000000000..90c53037c23f3915ff142e14267af48b68ee4ddc --- /dev/null +++ b/utils/test_pinephone_pro_image.py @@ -0,0 +1,124 @@ +"""test_pinephone_image.py: Boots a disk image and tests that it works.""" + +import argparse +import asyncio +import asyncio.subprocess +import logging +import sys +import os +import signal + +FAILURE_TIMEOUT = 3600 # seconds +BUFFER_SIZE = 80 # how many characters to read at once + +DIALOGS = { + 'default': + [ + # Login + 'login:', + 'root', + 'Password:', + 'root', + '#', + # Test poweroff + 'sudo shutdown now', + 'Power down' + ] +} + + +def argument_parser(): + parser = argparse.ArgumentParser( + description="Test that PinePhone image works as expected") + parser.add_argument('--dialog', dest='dialog', default='default', + help='dialog to follow\ + (valid values {}, default: default)' + .format(DIALOGS.keys())) + + return parser + + +async def await_line(stream, marker): + """Read from 'stream' until a line appears contains 'marker'.""" + marker = marker.encode("utf-8") + buf = b"" + + while not stream.at_eof(): + chunk = await stream.read(BUFFER_SIZE) + sys.stdout.buffer.write(chunk) + buf += chunk + lines = buf.split(b'\n') + for line in lines: + if marker in line: + try: + return line.decode("utf-8") + except UnicodeDecodeError: + break + buf = lines[-1] + + +async def run_test(command, dialog): + dialog = DIALOGS[dialog] + + logging.debug("Starting process: {}", command) + process = await asyncio.create_subprocess_exec( + *command, + stdin=asyncio.subprocess.PIPE, + stdout=asyncio.subprocess.PIPE, + start_new_session=True) + + success = False + try: + while dialog: + prompt = await await_line(process.stdout, dialog.pop(0)) + + assert prompt is not None + if dialog: + process.stdin.write(dialog.pop(0).encode('ascii') + b'\n') + + print("Test successful") + success = True + except asyncio.CancelledError: + # Move straight to killing the process group + pass + finally: + try: + os.killpg(os.getpgid(process.pid), signal.SIGKILL) + except ProcessLookupError: + pass + + await process.communicate() + await process.wait() + return success + + +def fail_timeout(qemu_task): + sys.stderr.write("Test failed as timeout of %i seconds was reached.\n" % + FAILURE_TIMEOUT) + qemu_task.cancel() + + +def main(): + args = argument_parser().parse_args() + + command = ['qemu-system-aarch64', '-cpu', 'cortex-a57', '-M', 'virt', '-m', + '4096', '--nographic', '-drive', + 'if=pflash,format=raw,file=QEMU_EFI.img', + '-drive', 'if=pflash,file=varstore.img', + '-drive', 'if=virtio,file=debian.img', + '-drive', 'if=virtio,format=raw,file=disk.img'] + + loop = asyncio.get_event_loop() + qemu_task = loop.create_task(run_test(command, args.dialog)) + loop.call_later(FAILURE_TIMEOUT, fail_timeout, qemu_task) + loop.run_until_complete(qemu_task) + loop.close() + + if qemu_task.result(): + return 0 + return 1 + + +if __name__ == '__main__': + result = main() + sys.exit(result)