nokia-beatles: new device (Nokia 2720 Flip) (!1097)

This commit is contained in:
Maksym Pertsov 2020-03-24 20:37:11 +01:00 committed by Martijn Braam
parent b020c93299
commit 75afbd7b72
No known key found for this signature in database
GPG key ID: C4280ACB000B060F
9 changed files with 5109 additions and 0 deletions

View file

@ -0,0 +1,25 @@
# Contributor: Max Pertsov <max.pertsov@gmail.com>
# Maintainer: Max Pertsov <max.pertsov@gmail.com>
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-nokia-beatles"
pkgdesc="Nokia 2720 Flip"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-nokia-beatles mkbootimg mesa-dri-swrast msm-fb-refresher"
makedepends="devicepkg-dev"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="334b5a2f3cf72a3b96c0a9ae00026015cd710a4e8048b271199dafb95be5c55baa35180ed8cb1e919f32a91971dc931d51ad57a957bc318c0dbf3c73be2c52d1 deviceinfo"

View file

@ -0,0 +1,31 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Nokia 2720 Flip"
deviceinfo_manufacturer="Nokia"
deviceinfo_codename="nokia-beatles"
deviceinfo_year="2019"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="true"
deviceinfo_external_storage="true"
deviceinfo_screen_width="240"
deviceinfo_screen_height="320"
# Bootloader related
deviceinfo_flash_method="none"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlyprintk androidboot.selinux=permissive"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x80000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,142 @@
From patchwork Tue Aug 12 04:01:30 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: "Gao, Yunpeng" <yunpeng.gao@intel.com>
X-Patchwork-Id: 4710641
Return-Path: <linux-mmc-owner@kernel.org>
X-Original-To: patchwork-linux-mmc@patchwork.kernel.org
Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org
Received: from mail.kernel.org (mail.kernel.org [198.145.19.201])
by patchwork1.web.kernel.org (Postfix) with ESMTP id D35AC9F38D
for <patchwork-linux-mmc@patchwork.kernel.org>;
Tue, 12 Aug 2014 03:59:55 +0000 (UTC)
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id EB1D520115
for <patchwork-linux-mmc@patchwork.kernel.org>;
Tue, 12 Aug 2014 03:59:54 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by mail.kernel.org (Postfix) with ESMTP id A117620125
for <patchwork-linux-mmc@patchwork.kernel.org>;
Tue, 12 Aug 2014 03:59:53 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1754810AbaHLD7s (ORCPT
<rfc822;patchwork-linux-mmc@patchwork.kernel.org>);
Mon, 11 Aug 2014 23:59:48 -0400
Received: from mga01.intel.com ([192.55.52.88]:7200 "EHLO mga01.intel.com"
rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1753033AbaHLD7r (ORCPT <rfc822;linux-mmc@vger.kernel.org>);
Mon, 11 Aug 2014 23:59:47 -0400
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
by fmsmga101.fm.intel.com with ESMTP; 11 Aug 2014 20:59:46 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.01,847,1400050800"; d="scan'208";a="583529905"
Received: from spark-hp-compaq-8000-elite-cmt-pc.bj.intel.com
([172.16.181.71])
by fmsmga002.fm.intel.com with ESMTP; 11 Aug 2014 20:59:43 -0700
From: Yunpeng Gao <yunpeng.gao@intel.com>
To: linux-mmc@vger.kernel.org
Cc: Chuanxiao Dong <chuanxiao.dong@intel.com>,
Yunpeng Gao <yunpeng.gao@intel.com>
Subject: [PATCH] mmc: card: not access RPMB partition for normal read and
write
Date: Tue, 12 Aug 2014 12:01:30 +0800
Message-Id: <1407816090-7671-1-git-send-email-yunpeng.gao@intel.com>
X-Mailer: git-send-email 1.7.9.5
Sender: linux-mmc-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-mmc.vger.kernel.org>
X-Mailing-List: linux-mmc@vger.kernel.org
X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI,
RP_MATCHES_RCVD,
UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
From: Chuanxiao Dong <chuanxiao.dong@intel.com>
During kernel boot, it will try to read some logical sectors
of each block device node for the possible partition table.
But since RPMB partition is special and can not be accessed
by normal eMMC read / write CMDs, it will cause below error
messages during kernel boot:
...
<3>[ 4.890052] mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
<3>[ 4.892160] mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
<4>[ 4.892165] mmcblk0rpmb: retrying using single block read
<3>[ 4.895727] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[ 4.899269] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[ 4.901466] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[ 4.905106] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[ 4.907166] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[ 4.909235] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[ 4.909241] end_request: I/O error, dev mmcblk0rpmb, sector 0
<3>[ 4.909247] Buffer I/O error on device mmcblk0rpmb, logical block 0
<3>[ 4.909263] end_request: I/O error, dev mmcblk0rpmb, sector 8
<3>[ 4.909267] Buffer I/O error on device mmcblk0rpmb, logical block 1
<3>[ 4.909272] end_request: I/O error, dev mmcblk0rpmb, sector 16
<3>[ 4.909275] Buffer I/O error on device mmcblk0rpmb, logical block 2
<3>[ 4.909280] end_request: I/O error, dev mmcblk0rpmb, sector 24
<3>[ 4.909283] Buffer I/O error on device mmcblk0rpmb, logical block 3
...
This patch will discard the access request in eMMC queue if
it is RPMB partition access request. By this way, it avoids
trigger above error messages.
Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
drivers/mmc/card/block.c | 13 +++++++++++++
drivers/mmc/card/queue.c | 2 +-
drivers/mmc/card/queue.h | 2 ++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..4b79592 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1025,6 +1025,18 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
md->reset_done &= ~type;
}
+int mmc_access_rpmb(struct mmc_queue *mq)
+{
+ struct mmc_blk_data *md = mq->data;
+ /*
+ * If this is a RPMB partition access, return true
+ */
+ if (md && md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB)
+ return true;
+
+ return false;
+}
+
static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
{
struct mmc_blk_data *md = mq->data;
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 3e049c1..6ceede0 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -38,7 +38,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
return BLKPREP_KILL;
}
- if (mq && mmc_card_removed(mq->card))
+ if (mq && (mmc_card_removed(mq->card) || mmc_access_rpmb(mq)))
return BLKPREP_KILL;
req->cmd_flags |= REQ_DONTPREP;
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
index 5752d50..99e6521 100644
--- a/drivers/mmc/card/queue.h
+++ b/drivers/mmc/card/queue.h
@@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct mmc_queue_req *);
extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
extern void mmc_packed_clean(struct mmc_queue *);
+extern int mmc_access_rpmb(struct mmc_queue *);
+
#endif

View file

@ -0,0 +1,40 @@
diff --git a/scripts/elf.h b/scripts/elf.h
index 2b06377790ab..2bb00580272d 100644
--- a/scripts/elf.h
+++ b/scripts/elf.h
@@ -25,8 +25,6 @@
#include <features.h>
#endif
-__BEGIN_DECLS
-
/* Standard ELF types. */
#include <stdint.h>
@@ -2798,6 +2796,4 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_M32R_NUM 256 /* Keep this the last entry. */
-__END_DECLS
-
#endif /* elf.h */
diff --git a/scripts/mod/elf.h b/scripts/mod/elf.h
index 2b06377790ab..2bb00580272d 100644
--- a/scripts/mod/elf.h
+++ b/scripts/mod/elf.h
@@ -25,8 +25,6 @@
#include <features.h>
#endif
-__BEGIN_DECLS
-
/* Standard ELF types. */
#include <stdint.h>
@@ -2798,6 +2796,4 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_M32R_NUM 256 /* Keep this the last entry. */
-__END_DECLS
-
#endif /* elf.h */

View file

@ -0,0 +1,13 @@
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 15b09dee75d4..259ec2b5d31b 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -989,8 +989,6 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
result = get_user(val, ip);
if (result)
return result;
- if (val > SG_MAX_CDB_SIZE)
- return -ENOMEM;
sfp->next_cmd_len = (val > 0) ? val : 0;
return 0;
case SG_GET_VERSION_NUM:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
diff --git a/drivers/gud/MobiCoreDriver/main.c b/drivers/gud/MobiCoreDriver/main.c
index f1ebaad22815..d32c0bc37be0 100644
--- a/drivers/gud/MobiCoreDriver/main.c
+++ b/drivers/gud/MobiCoreDriver/main.c
@@ -1489,7 +1489,7 @@ error:
/*
* This function removes this device driver from the Linux device manager .
*/
-static void __exit mobicore_exit(void)
+static void mobicore_exit(void)
{
MCDRV_DBG_VERBOSE(mcd, "enter");
#ifdef MC_MEM_TRACES

View file

@ -0,0 +1,62 @@
# Contributor: Max Pertsov <max.pertsov@gmail.com>
# Maintainer: Max Pertsov <max.pertsov@gmail.com>
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: extracted from the real device
pkgname="linux-nokia-beatles"
pkgver=3.10.49
pkgrel=0
pkgdesc="Nokia 2720 Flip kernel fork"
arch="armv7"
_carch="arm"
_flavor="nokia-beatles"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="bash bc bison devicepkg-dev flex openssl-dev perl gcc4 gcc4-aarch64 libc-dev linux-headers"
# Won't compile with newer GCC
if [ "${CC:0:5}" != "gcc4-" ]; then
CC="gcc4-$CC"
HOSTCC="gcc4-gcc"
CROSS_COMPILE="gcc4-$CROSS_COMPILE"
fi
# Source
_repository="caf-kernel-msm-3.10"
_commit="e89da83520e1225d61d03ca39dd0b5009c0b892d"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/mpertsov/$_repository/archive/$_commit.tar.gz
$_config
0001-mmc-card-not-access-RPMB-partition-for-normal-read-and-write.patch
0002-begin-end-decl.patch
0003-undeclared-SG_MAX_CDB_SIZE.patch
0004-dts-adaptations.patch
0005-mobicore-section-mismatch.patch
"
builddir="$srcdir/$_repository-$_commit"
prepare() {
default_prepare
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor"
}
sha512sums="8473bae59384009163770fdd134ed55598a18667e598ed3a098a7beb59ad658e3a302c4cc4cca02e8b523c1a62488d7c240144f9383e782a36f934ddf32c1c15 linux-nokia-beatles-e89da83520e1225d61d03ca39dd0b5009c0b892d.tar.gz
28e8c0fef855a50f097fb7c59cae22c7faf5c2973e73ab622490f9fdf5c39881ceb366587d588cd50764ed7d4b970440cb57a079c3ebcacd6846a8cb24d199f5 config-nokia-beatles.armv7
ed1c144529612e7e5320a00979095431135bd3a65271ca76b8b6ceecb26db11d11899a9104695387ffea64cc618f72c79d3caa41481fa11a8bd9b54fdf6fd1d7 0001-mmc-card-not-access-RPMB-partition-for-normal-read-and-write.patch
80aa04da9cad38d65f6c58dd7cfc8a537265f516cbb03f7da96eb193d61c8d2ec9d2d429b7ce5e95ea57d88f934930fb89c5eb90e27b756c1cfb839fbda4d64b 0002-begin-end-decl.patch
afbd100831551aff08fdd1b0f7307800877fb8483f7f77bc3ee6b3752cdd21e2d9bca8c4804c12dabc9c5e18f5f7a7cee4e8267109515fab2c9328d3da9ee4ce 0003-undeclared-SG_MAX_CDB_SIZE.patch
39b2bc3a9e8989e5ba6d49b44ced92753b5d7894891d4a5d1d79225a82e6eb909bc823fe5fdabec5dd79a26802eecdf4e45c6ccf1eb5990740eed4a2a06a9332 0004-dts-adaptations.patch
e05ff99be3ded020a995016c4c2419ad8808bed4be8713a9df5f6e9ad74800e5ea77cf890d64d67ecf5878ba6a91f1bd8c633a66e1f1a4bf28bcea7dc95862e0 0005-mobicore-section-mismatch.patch"

File diff suppressed because it is too large Load diff