From owner-freebsd-arm@freebsd.org Sun Mar 21 11:33:38 2021 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B982C57150D for ; Sun, 21 Mar 2021 11:33:38 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3FrK57Zxz4mY0 for ; Sun, 21 Mar 2021 11:33:37 +0000 (UTC) (envelope-from soren.schmidt@gmail.com) Received: by mail-ej1-x62c.google.com with SMTP id hq27so16686198ejc.9 for ; Sun, 21 Mar 2021 04:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=4XMtsaUPUG4BzqQc0KAAbaCeW1XGhQiXTB/ViUV2KdM=; b=JpQnIJe5GyoXO7q+2YylPyDscVch3OTuXxH/FF2TKwGPFJ4Xgin4CSL0hrXzng/BnE 8HuDRj32B/SadhnCS6WTokbyFn+wO9zvbG1rB/lczbb3NTAP+YESxEYEnGL9FUvwn6Er 9FdRAseEpBxAEsWCFSpUjE1H4f7XJZl+VbcCrFDNrE229MivTaHEtPOmy44XtG+MqPkc 6emYPjWc9O7VcXIohClko/Jc222QDidA88iHW/KOqhHShmfqTGgizIYO7m5zyZhlMP1x hyl542wZPHpbnulLtulle0SLDyk97ZsBIuGXs8mJkk6xgVRYam3czl0Zbyw4dkIJWJrO wTMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=4XMtsaUPUG4BzqQc0KAAbaCeW1XGhQiXTB/ViUV2KdM=; b=XK8mdRbq4AZc3zwBy8hrz0RTlOHuUogDgF69/zGZKqY1pTXNkpB6fdsaR7b13qEeXj XrqbM/0RbH8h1cJ1AhTsRhPBgusyxgmTm4OAzngaqmf6Ief3RUCqqnDdAPz0nVnsn79W 2X8i/WHY8SK3bXyhn+112lIITpSc1yd9kd79YHd8yjknFoD4ZF6aV7pguwgAZZR3GGpI R8GlfkKCcrgHPTf6P239dD7ioJ7cqqryVTBWbFgSK76u+48loZ4lG9dg5QGUaf7QkIVe eYfY+u22sKnr3t79349pxWL0P+2VwqBFgo+WLBMHgBK4nsZ03MaImTXzLthBA8GFqKQj i1Rg== X-Gm-Message-State: AOAM532OTv2J2aqLP2hNChiLm6BEd1s3od/LNq0MOQaT4KGNUyDIQzKH k+1aKihgz5i7ONy8zBapVVeaSAGufRY= X-Google-Smtp-Source: ABdhPJzN3NXlkcsiysTQFNACP7Sn0YnYeUGNPBp0kni/nnsJZkS1rJ/6xHpeC6bHc0O2AcZI8g8WdQ== X-Received: by 2002:a17:906:aad5:: with SMTP id kt21mr13885528ejb.160.1616326415871; Sun, 21 Mar 2021 04:33:35 -0700 (PDT) Received: from mac.deepcore.dk ([85.27.186.9]) by smtp.gmail.com with ESMTPSA id u16sm8352698edq.4.2021.03.21.04.33.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Mar 2021 04:33:35 -0700 (PDT) From: =?utf-8?Q?S=C3=B8ren_Schmidt?= Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: PinebookPro misc drivers.. Date: Sun, 21 Mar 2021 12:33:35 +0100 In-Reply-To: <20210321114651.cafd10f9bf5c8a4341cd5b67@bidouilliste.com> Cc: freebsd-arm To: Emmanuel Vadot References: <20210310160114.dd9853a0689d257388a745b5@bidouilliste.com> <88144856-F28B-4137-B0A9-4B4C8523774C@gmail.com> <20210321111957.e7ebc1261e3b7ec03c8718d6@bidouilliste.com> <20210321114651.cafd10f9bf5c8a4341cd5b67@bidouilliste.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4F3FrK57Zxz4mY0 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=JpQnIJe5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of sorenschmidt@gmail.com designates 2a00:1450:4864:20::62c as permitted sender) smtp.mailfrom=sorenschmidt@gmail.com X-Spamd-Result: default: False [-1.04 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.80)[-0.799]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_MIXED_CHARSET(0.83)[subject]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::62c:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; NEURAL_SPAM_MEDIUM(0.43)[0.425]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::62c:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62c:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting FreeBSD to ARM processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2021 11:33:38 -0000 On 21 Mar 2021, at 11.46, Emmanuel Vadot wrote: >=20 > On Sun, 21 Mar 2021 11:19:57 +0100 > Emmanuel Vadot > = wrote: >=20 >> On Sun, 21 Mar 2021 11:02:28 +0100 >> S=C3=B8ren Schmidt wrote: >>=20 >>> On 10 Mar 2021, at 16.01, Emmanuel Vadot = wrote: >>>>=20 >>>> On Wed, 10 Mar 2021 15:29:21 +0100 >>>> S=C3=B8ren Schmidt wrote: >>>>=20 >>>>> Hi >>>>>=20 >>>>> I?ve uploaded the latest from my PinebookPro collection here: >>>>> https://people.freebsd.org/~sos/PinebookPro/ = >>>>>=20 >>>>> Comment,, bugs, etc welcome? >>>>=20 >>>> Few comments, >>>>=20 >>>> - Could you at least share patches generated with git diff ? >>>=20 >>> No git here, but added patches to the one file (rk_gpio.c) that = isn?t new :) >>=20 >> Why was all the softc variable renamed, this makes reviewing much >> harder than it should be. I just cleaned up stuff to my liking, whether you want this stuff in the = official sources I dont care much :) >>>> - rk_gpiokeys.c doesn't seems correct, we already have >>>> sys/dev/gpio/gpiokeys.c so patch this one if it isn't enough for = lid >>>> switch need. >>>=20 >>> Well, the stock drivers handling of this is, well, less than optimal = and the lid support is pretty unique to the pbp so I decided to go this = way as to not ?pollute? the original. >>=20 >> Less than optimal why ? >> Pretty unique why ? >> I don't see anything unique for the pbp in the dts and if the driver >> that we already have is missing some stuff it should be patched. >=20 > So, since I'm a nice guy I've looked at the driver. > It is unique because you made it unique. > Upon lid switch even if the lid closed you deactivate the lcd power > gpio control pin (which is not referenced in the dts node for the lid > switch) using a really a gross hack. We should never do that. > You've also written that you haven't been able to get interrupts when > you open the lid but since you only configure it with > GPIO_INTR_EDGE_FALLING that's normal. What is happening if you > configure it with GPIO_INTR_EDGE_BOTH ? If it's still not working it > probably shows a problem in your gpio patch that add interrupts = support. Well, there is NO interrupt generated whether you look for raising of = failling edges, that=E2=80=99s why I resorted to plain polling (as = explained). I made it unique for my purposes, so it doesn=E2=80=99t conflict with = anything. But anyhow interrupts etc works on any ohter pin but apparently at least = my device has issue here. >=20 >>>> I could comment more if I would be able to diff more easily. >>>=20 >>> As stated above there is now a patch for you for rk_gpio.c the rest = has nothing to diff against. >>>=20 >>> BTW I added support for writing an updated u-boot-2021.01 to the SPI = flash on the pbp (also works for rockpro64), so one can boot from eMMC, = SDcard, USB and NVMe with kbd/mouse support and screen output from the = first u-boot output. >>=20 >> And again no patches make this really hard to review. >> Please create a phabricator account and post patches there, we can >> then have a proper discussion. That is just too timeconsuming for me, I=E2=80=99m just trying to be = nice and post what I=E2=80=99ve done to get my pinebookpro into a useful = state for daily usage, you can pick and choose form that og just ignore = it, I=E2=80=99m happy either way... =E2=80=94 S=C3=B8ren Schmidt sos@deepcore.dk / sos@freebsd.org "So much code to hack, so little time"