* [PATCH V4 4/7] mmc: sdhci: add 32-bit block count support for v4 mode
From: Chunyan Zhang @ 2018-07-24 2:51 UTC (permalink / raw)
To: Ulf Hansson, Adrian Hunter
Cc: linux-mmc, linux-kernel, Orson Zhai, Baolin Wang, Billows Wu,
Jason Wu, zhang.lyra
In-Reply-To: <1532340508-8749-5-git-send-email-zhang.chunyan@linaro.org>
Host Controller Version 4.10 re-defines SDMA System Address register
as 32-bit Block Count for v4 mode, and SDMA uses ADMA System
Address register (05Fh-058h) instead if v4 mode is enabled. Also
when using 32-bit block count, 16-bit block count register need
to be set to zero.
Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
drivers/mmc/host/sdhci.c | 14 +++++++++++++-
drivers/mmc/host/sdhci.h | 1 +
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 920d8ec..c272a2b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1070,7 +1070,19 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
/* Set the DMA boundary value and block size */
sdhci_writew(host, SDHCI_MAKE_BLKSZ(host->sdma_boundary, data->blksz),
SDHCI_BLOCK_SIZE);
- sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT);
+
+ /*
+ * For Version 4.10 onwards, if v4 mode is enabled, 16-bit Block Count
+ * register need to be set to zero, 32-bit Block Count register would
+ * be selected.
+ */
+ if (host->version >= SDHCI_SPEC_410 && host->v4_mode) {
+ if (sdhci_readw(host, SDHCI_BLOCK_COUNT))
+ sdhci_writew(host, 0, SDHCI_BLOCK_COUNT);
+ sdhci_writew(host, data->blocks, SDHCI_32BIT_BLK_CNT);
+ } else {
+ sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT);
+ }
}
static inline bool sdhci_auto_cmd12(struct sdhci_host *host,
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 23318ff..81aae07 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -28,6 +28,7 @@
#define SDHCI_DMA_ADDRESS 0x00
#define SDHCI_ARGUMENT2 SDHCI_DMA_ADDRESS
+#define SDHCI_32BIT_BLK_CNT SDHCI_DMA_ADDRESS
#define SDHCI_BLOCK_SIZE 0x04
#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF))
--
2.7.4
^ permalink raw reply related
* Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...
From: Sergey Senozhatsky @ 2018-07-24 2:53 UTC (permalink / raw)
To: Minchan Kim
Cc: Tino Lehnig, ngupta, linux-kernel, Sergey Senozhatsky,
Andrew Morton
In-Reply-To: <20180724010342.GA195675@rodete-desktop-imager.corp.google.com>
On (07/24/18 10:03), Minchan Kim wrote:
> On Mon, Jul 23, 2018 at 02:29:32PM +0200, Tino Lehnig wrote:
> > Hello,
> >
> > after enabling the writeback feature in zram, I encountered the kernel bug
> > below with heavy swap utilization. There is one specific workload that
> > triggers the bug reliably and that is running Windows in KVM while
> > overcommitting memory. The Windows VMs would fill all allocated memory with
> > zero pages while booting. A few seconds after the host hits zram swap, the
> > console on the host is flooded with the bug message. A few more seconds
> > later I also encountered filesystem errors on the host causing the root
> > filesystem to be mounted read-only. The filesystem errors do not occur when
> > leaving RAM available for the host OS by limiting physical memory of the
> > QEMU processes via cgroups.
> >
> > I started three KVM instances with the following commands in my tests. Any
> > Windows ISO or disk image can be used. Less instances and smaller allocated
> > memory will also trigger the bug as long as swapping occurs. The type of
> > writeback device does not seem to matter. I have tried a SATA SSD and an
> > NVMe Optane drive so far. My test machine has 256 GB of RAM and one CPU. I
> > saw the same behavior on another machine with two CPUs and 128 GB of RAM.
> >
> > The bug does not occur when using zram as swap without "backing_dev" being
> > set, but I had even more severe problems when running the same test on
> > Ubuntu Kernels 4.15 and 4.17. Regardless of the writeback feature being used
> > or not, the host would eventually lock up entirely when swap is in use on
> > zram. The lockups may not be related directly to zram though and were
> > apparently fixed in 4.18. I had absolutely no problems on Ubuntu Kernel 4.13
> > either, before the writeback feature was introduced.
>
> We didn't release v4.18 yet. Could you say what kernel tree/what version
> you used?
>
> Now I don't have enough time to dig in.
>
> Sergey, I really appreciate if you could have availabe time to look into.
> Anyway, I could try to see it asap if Sergey is not available.
> No worry.
Interesting case.
Will take me several days to get to it.
Sorry, quite busy at the moment.
-ss
^ permalink raw reply
* Re: [PATCH v2] systemd: Allow custom coredump config options
From: ChenQi @ 2018-07-24 2:52 UTC (permalink / raw)
To: Alistair Francis, Andre McCurdy; +Cc: OE Core mailing list
In-Reply-To: <CAKmqyKNrUdU9wcUH8no9J_XNE=4ztujQ95tap7Zk5HBWv9XT9g@mail.gmail.com>
On 07/24/2018 07:16 AM, Alistair Francis wrote:
> On Wed, Jul 18, 2018 at 4:48 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
>> On Wed, Jul 18, 2018 at 3:53 PM, Alistair Francis
>> <alistair.francis@wdc.com> wrote:
>>> If the user has enabled coredump let's allow them to customise the
>>> config options.
>>>
>>> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>>> ---
>>> meta/recipes-core/systemd/systemd_239.bb | 12 ++++++++++++
>>> 1 file changed, 12 insertions(+)
>>>
>>> diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb
>>> index 7822548993..a625d060a9 100644
>>> --- a/meta/recipes-core/systemd/systemd_239.bb
>>> +++ b/meta/recipes-core/systemd/systemd_239.bb
>>> @@ -279,6 +279,18 @@ do_install() {
>>> chown polkitd:root ${D}${datadir}/polkit-1/rules.d
>>> fi
>>> fi
>>> +
>>> + # If coredump was enabled, enable it in the config.
>>> + # This just sets the default, but can be used to customise the values.
>>> + if ${@bb.utils.contains('PACKAGECONFIG', 'coredump', 'true', 'false', d)}; then
>>> + sed 's|#Storage.*|Storage=external|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> + sed 's|#Compress.*|Compress=yes|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> + sed 's|#ProcessSizeMax.*|ProcessSizeMax=2G|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> + sed 's|#ExternalSizeMax.*|ExternalSizeMax=2G|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> + sed 's|#JournalSizeMax.*|JournalSizeMax=767M|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> + sed 's|#MaxUse.*|MaxUse=|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>>> + sed 's|#KeepFree.*|KeepFree=|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> How does this allow the user to customise the config options?
> They can edit the sed command line and have different options.
>
>> By forcing the options to the _current_ default values you are
>> creating a maintenance problem - ie you'll still be forcing these
>> values even if/when the upstream defaults are changed.
> That is a good point, is there a usual way to allow edits to config
> files like this?
>
> Alistair
>
It depends on what package you are modifying, as different packages have
different ways to handle their configuration. It also depends on what
configuration you are going to customize, maybe the config customization
is generally wanted by most users, maybe it's not.
Back to this systemd coredump case, the best way to customize things is
to drop in configuration files to /etc/systemd/coredump.conf.d/ via
bbappend.
https://www.freedesktop.org/software/systemd/man/coredump.conf.html
Best Regards,
Chen Qi
>>> + fi
>>> }
>>>
>>>
>>> --
>>> 2.17.1
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply
* [PATCH V4 2/7] mmc: sdhci: Change SDMA address register for v4 mode
From: Chunyan Zhang @ 2018-07-24 2:47 UTC (permalink / raw)
To: Ulf Hansson, Adrian Hunter
Cc: linux-mmc, linux-kernel, Orson Zhai, Baolin Wang, Billows Wu,
Jason Wu, zhang.lyra
In-Reply-To: <1532340508-8749-3-git-send-email-zhang.chunyan@linaro.org>
According to the SD host controller specification version 4.10, when
Host Version 4 is enabled, SDMA uses ADMA System Address register
(05Fh-058h) instead of using SDMA System Address register to
support both 32-bit and 64-bit addressing.
Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
drivers/mmc/host/sdhci.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index cab5350..b7ad8e5 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -729,7 +729,7 @@ static void sdhci_adma_table_post(struct sdhci_host *host,
}
}
-static u32 sdhci_sdma_address(struct sdhci_host *host)
+static dma_addr_t sdhci_sdma_address(struct sdhci_host *host)
{
if (host->bounce_buffer)
return host->bounce_addr;
@@ -737,6 +737,18 @@ static u32 sdhci_sdma_address(struct sdhci_host *host)
return sg_dma_address(host->data->sg);
}
+static void sdhci_set_sdma_addr(struct sdhci_host *host, dma_addr_t addr)
+{
+ if (host->v4_mode) {
+ sdhci_writel(host, addr, SDHCI_ADMA_ADDRESS);
+ if (host->flags & SDHCI_USE_64_BIT_DMA)
+ sdhci_writel(host, (u64)addr >> 32, SDHCI_ADMA_ADDRESS_HI);
+ } else {
+ sdhci_writel(host, addr, SDHCI_DMA_ADDRESS);
+ }
+
+}
+
static unsigned int sdhci_target_timeout(struct sdhci_host *host,
struct mmc_command *cmd,
struct mmc_data *data)
@@ -996,8 +1008,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
SDHCI_ADMA_ADDRESS_HI);
} else {
WARN_ON(sg_cnt != 1);
- sdhci_writel(host, sdhci_sdma_address(host),
- SDHCI_DMA_ADDRESS);
+ sdhci_set_sdma_addr(host, sdhci_sdma_address(host));
}
}
@@ -2824,7 +2835,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
* some controllers are faulty, don't trust them.
*/
if (intmask & SDHCI_INT_DMA_END) {
- u32 dmastart, dmanow;
+ dma_addr_t dmastart, dmanow;
dmastart = sdhci_sdma_address(host);
dmanow = dmastart + host->data->bytes_xfered;
@@ -2832,12 +2843,12 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
* Force update to the next DMA block boundary.
*/
dmanow = (dmanow &
- ~(SDHCI_DEFAULT_BOUNDARY_SIZE - 1)) +
+ ~((dma_addr_t)SDHCI_DEFAULT_BOUNDARY_SIZE - 1)) +
SDHCI_DEFAULT_BOUNDARY_SIZE;
host->data->bytes_xfered = dmanow - dmastart;
- DBG("DMA base 0x%08x, transferred 0x%06x bytes, next 0x%08x\n",
- dmastart, host->data->bytes_xfered, dmanow);
- sdhci_writel(host, dmanow, SDHCI_DMA_ADDRESS);
+ DBG("DMA base %pad, transferred 0x%06x bytes, next %pad\n",
+ &dmastart, host->data->bytes_xfered, &dmanow);
+ sdhci_set_sdma_addr(host, dmanow);
}
if (intmask & SDHCI_INT_DATA_END) {
@@ -3581,8 +3592,8 @@ int sdhci_setup_host(struct sdhci_host *host)
}
}
- /* SDMA does not support 64-bit DMA */
- if (host->flags & SDHCI_USE_64_BIT_DMA)
+ /* SDMA does not support 64-bit DMA if v4 mode not set */
+ if ((host->flags & SDHCI_USE_64_BIT_DMA) && !host->v4_mode)
host->flags &= ~SDHCI_USE_SDMA;
if (host->flags & SDHCI_USE_ADMA) {
--
2.7.4
^ permalink raw reply related
* Re: [**EXTERNAL**] Re: VRF with enslaved L3 enabled bridge
From: D'Souza, Nelson @ 2018-07-24 1:43 UTC (permalink / raw)
To: David Ahern, netdev@vger.kernel.org
In-Reply-To: <51e237af-2db6-8905-22c9-9739f7d5a9b0@cumulusnetworks.com>
Hi David,
I copy and pasted the configs onto my device, but pings on test-vrf do not work in my setup.
I'm essentially seeing the same issue as I reported before.
In this case, pings sent out on test-vrf (host ns) are received and replied to by the loopback interface (foo ns). Although the replies are seen at the test-vrf level, they are not locally delivered to the ping application.
Logs are as follows...
a) pings on test-vrf or br0 fail.
# ping -I test-vrf 172.16.2.2 -c1 -w1
PING 172.16.2.2 (172.16.2.2): 56 data bytes
--- 172.16.2.2 ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss
b) tcpdump in the foo namespace, shows icmp echos/replies on veth2
# ip netns exec foo tcpdump -i veth2 icmp -c 2
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on veth2, link-type EN10MB (Ethernet), capture size 262144 bytes
18:34:13.205210 IP 172.16.1.1 > 172.16.2.2: ICMP echo request, id 19513, seq 0, length 64
18:34:13.205253 IP 172.16.2.2 > 172.16.1.1: ICMP echo reply, id 19513, seq 0, length 64
2 packets captured
2 packets received by filter
0 packets dropped by kernel
c) tcpdump in the host namespace, shows icmp echos/replies on test-vrf, br0 and veth1:
# tcpdump -i test-vrf icmp -c 2
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on test-vrf, link-type EN10MB (Ethernet), capture size 262144 bytes
18:34:13.204061 IP 172.16.1.1 > 172.16.2.2: ICMP echo request, id 19513, seq 0, length 64
18:34:13.205278 IP 172.16.2.2 > 172.16.1.1: ICMP echo reply, id 19513, seq 0, length 64
2 packets captured
2 packets received by filter
0 packets dropped by kernel
Thanks,
Nelson
On 7/23/18, 3:00 PM, "David Ahern" <dsa@cumulusnetworks.com> wrote:
On 7/20/18 1:03 PM, D'Souza, Nelson wrote:
> Setup is as follows:
>
> ethUSB(ingress port) -> mgmtbr0 (bridge) -> mgmtvrf (vrf)
| netns foo
[ test-vrf ] |
| |
[ br0 ] 172.16.1.1 |
| |
[ veth1 ] ============|======= [ veth2 ] lo
| 172.16.1.2 172.16.2.2
|
Copy and paste the following into your environment:
ip netns add foo
ip li add veth1 type veth peer name veth2
ip li set veth2 netns foo
ip -netns foo li set lo up
ip -netns foo li set veth2 up
ip -netns foo addr add 172.16.1.2/24 dev veth2
ip li add test-vrf type vrf table 123
ip li set test-vrf up
ip ro add vrf test-vrf unreachable default
ip li add br0 type bridge
ip li set veth1 master br0
ip li set veth1 up
ip li set br0 up
ip addr add dev br0 172.16.1.1/24
ip li set br0 master test-vrf
ip -netns foo addr add 172.16.2.2/32 dev lo
ip ro add vrf test-vrf 172.16.2.2/32 via 172.16.1.2
Does ping work?
# ping -I test-vrf 172.16.2.2
ping: Warning: source address might be selected on device other than
test-vrf.
PING 172.16.2.2 (172.16.2.2) from 172.16.1.1 test-vrf: 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.228 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.263 ms
and:
# ping -I br0 172.16.2.2
PING 172.16.2.2 (172.16.2.2) from 172.16.1.1 br0: 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.227 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.223 ms
^C
--- 172.16.2.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.223/0.225/0.227/0.002 ms
^ permalink raw reply
* Re: [PATCH rdma-next v2 0/8] Support mlx5 flow steering with RAW data
From: Jason Gunthorpe @ 2018-07-24 2:42 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Doug Ledford, Leon Romanovsky, RDMA mailing list, Yishai Hadas,
Saeed Mahameed, linux-netdev
In-Reply-To: <20180723122512.20967-1-leon@kernel.org>
On Mon, Jul 23, 2018 at 03:25:04PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
>
> Changelog:
> v1->v2:
> * Fix matcher to use the correct size.
> * Rephrase commit log of the first patch.
> v0->v1:
> * Fixed ADD_UVERBS_ATTRIBUTES_SIMPLE macro to pass the real address.
> ?* Replaced UA_ALLOC_AND_COPY to regular copy_from
> * Added UVERBS_ATTR_NO_DATA new macro for cleaner code.
> * Used ib_dev from uobj when it exists.
> * ib_is_destroy_retryable was replaced by ib_destroy_usecnt
>
> >From Yishai:
>
> This series introduces vendor create and destroy flow methods on the
> uverbs flow object by using the KABI infra-structure.
>
> It's done in a way that enables the driver to get its specific device
> attributes in a raw data to match its underlay specification while still
> using the generic ib_flow object for cleanup and code sharing.
>
> In addition, a specific mlx5 matcher object and its create/destroy
> methods were introduced. This object matches the underlay flow steering
> mask specification and is used as part of mlx5 create flow input data.
>
> This series supports IB_QP/TIR as its flow steering destination as
> applicable today via the ib_create_flow API, however, it adds also an
> option to work with DEVX object which its destination can be both TIR
> and flow table.
>
> Few changes were done in the mlx5 core layer to support forward
> compatible for the device specification raw data and to support flow
> table when the DEVX destination is used.
>
> As part of this series the default IB destroy handler
> (i.e. uverbs_destroy_def_handler()) was exposed from IB core to be
> used by the drivers and existing code was refactored to use it.
>
> Thanks
>
> Yishai Hadas (8):
> net/mlx5: Add forward compatible support for the FTE match data
> net/mlx5: Add support for flow table destination number
> IB/mlx5: Introduce flow steering matcher object
> IB: Consider ib_flow creation by the KABI infrastructure
> IB/mlx5: Introduce vendor create and destroy flow methods
> IB/mlx5: Support adding flow steering rule by raw data
> IB/mlx5: Add support for a flow table destination
> IB/mlx5: Expose vendor flow trees
This seems fine to me. Can you send the mlx5 shared branch for the
first two patches?
Thanks,
Jason
^ permalink raw reply
* Re: [PATCH v3] f2fs: issue discard align to section in LFS mode
From: Chao Yu @ 2018-07-24 2:40 UTC (permalink / raw)
To: Yunlong Song, jaegeuk, chao, yunlong.song
Cc: miaoxie, bintian.wang, shengyong1, heyunlei, linux-f2fs-devel,
linux-kernel
In-Reply-To: <1532005095-111878-1-git-send-email-yunlong.song@huawei.com>
On 2018/7/19 20:58, Yunlong Song wrote:
> For the case when sbi->segs_per_sec > 1 with lfs mode, take
> section:segment = 5 for example, if the section prefree_map is
> ...previous section | current section (1 1 0 1 1) | next section...,
> then the start = x, end = x + 1, after start = start_segno +
> sbi->segs_per_sec, start = x + 5, then it will skip x + 3 and x + 4, but
> their bitmap is still set, which will cause duplicated
> f2fs_issue_discard of this same section in the next write_checkpoint:
>
> round 1: section bitmap : 1 1 1 1 1, all valid, prefree_map: 0 0 0 0 0
> then rm data block NO.2, block NO.2 becomes invalid, prefree_map: 0 0 1 0 0
> write_checkpoint: section bitmap: 1 1 0 1 1, prefree_map: 0 0 0 0 0,
> prefree of NO.2 is cleared, and no discard issued
>
> round 2: rm data block NO.0, NO.1, NO.3, NO.4
> all invalid, but prefree bit of NO.2 is set and cleared in round 1, then
> prefree_map: 1 1 0 1 1
> write_checkpoint: section bitmap: 0 0 0 0 0, prefree_map: 0 0 0 1 1, no
> valid blocks of this section, so discard issued, but this time prefree
> bit of NO.3 and NO.4 is skipped due to start = start_segno + sbi->segs_per_sec;
>
> round 3:
> write_checkpoint: section bitmap: 0 0 0 0 0, prefree_map: 0 0 0 1 1 ->
> 0 0 0 0 0, no valid blocks of this section, so discard issued,
> this time prefree bit of NO.3 and NO.4 is cleared, but the discard of
> this section is sent again...
>
> To fix this problem, we can align the start and end value to section
> boundary for fstrim and real-time discard operation, and decide to issue
> discard only when the whole section is invalid, which can issue discard
> aligned to section size as much as possible and avoid redundant discard.
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply
* Re: [PATCH v3] f2fs: issue discard align to section in LFS mode
From: Chao Yu @ 2018-07-24 2:40 UTC (permalink / raw)
To: Yunlong Song, jaegeuk, chao, yunlong.song
Cc: miaoxie, bintian.wang, shengyong1, heyunlei, linux-f2fs-devel,
linux-kernel
In-Reply-To: <1532005095-111878-1-git-send-email-yunlong.song@huawei.com>
On 2018/7/19 20:58, Yunlong Song wrote:
> For the case when sbi->segs_per_sec > 1 with lfs mode, take
> section:segment = 5 for example, if the section prefree_map is
> ...previous section | current section (1 1 0 1 1) | next section...,
> then the start = x, end = x + 1, after start = start_segno +
> sbi->segs_per_sec, start = x + 5, then it will skip x + 3 and x + 4, but
> their bitmap is still set, which will cause duplicated
> f2fs_issue_discard of this same section in the next write_checkpoint:
>
> round 1: section bitmap : 1 1 1 1 1, all valid, prefree_map: 0 0 0 0 0
> then rm data block NO.2, block NO.2 becomes invalid, prefree_map: 0 0 1 0 0
> write_checkpoint: section bitmap: 1 1 0 1 1, prefree_map: 0 0 0 0 0,
> prefree of NO.2 is cleared, and no discard issued
>
> round 2: rm data block NO.0, NO.1, NO.3, NO.4
> all invalid, but prefree bit of NO.2 is set and cleared in round 1, then
> prefree_map: 1 1 0 1 1
> write_checkpoint: section bitmap: 0 0 0 0 0, prefree_map: 0 0 0 1 1, no
> valid blocks of this section, so discard issued, but this time prefree
> bit of NO.3 and NO.4 is skipped due to start = start_segno + sbi->segs_per_sec;
>
> round 3:
> write_checkpoint: section bitmap: 0 0 0 0 0, prefree_map: 0 0 0 1 1 ->
> 0 0 0 0 0, no valid blocks of this section, so discard issued,
> this time prefree bit of NO.3 and NO.4 is cleared, but the discard of
> this section is sent again...
>
> To fix this problem, we can align the start and end value to section
> boundary for fstrim and real-time discard operation, and decide to issue
> discard only when the whole section is invalid, which can issue discard
> aligned to section size as much as possible and avoid redundant discard.
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply
* Re: [linux-sunxi] Re: [PATCH 3/3] arm64: allwinner: dts: h6: add Wi-Fi support for Pine H64 model A/B
From: Icenowy Zheng @ 2018-07-24 2:39 UTC (permalink / raw)
To: wens, Chen-Yu Tsai
Cc: Maxime Ripard, linux-arm-kernel, devicetree, linux-kernel,
linux-sunxi
In-Reply-To: <CAGb2v656oPmAX=_y88b05xqrona3HFtU-VmNQhHxK_n-4gD+aw@mail.gmail.com>
于 2018年7月24日 GMT+08:00 上午10:37:51, Chen-Yu Tsai <wens@csie.org> 写到:
>On Tue, Jul 24, 2018 at 10:28 AM, Icenowy Zheng <icenowy@aosc.io>
>wrote:
>>
>>
>> 于 2018年7月24日 GMT+08:00 上午10:26:02, Chen-Yu Tsai <wens@csie.org> 写到:
>>>On Tue, Jul 24, 2018 at 10:23 AM, Icenowy Zheng <icenowy@aosc.io>
>>>wrote:
>>>>
>>>>
>>>> 于 2018年7月24日 GMT+08:00 上午10:21:59, Chen-Yu Tsai <wens@csie.org> 写到:
>>>>>On Tue, Jul 24, 2018 at 9:15 AM, Icenowy Zheng <icenowy@aosc.io>
>>>wrote:
>>>>>> The Pine H64 model A has a Wi-Fi module connector and the model B
>>>has
>>>>>an
>>>>>> on-board RTL8723BS Wi-Fi module.
>>>>>>
>>>>>> Add support for them. For model A, as it's not defaultly present,
>>>>>keep
>>>>>> it disabled now.
>>>>>
>>>>>Nope. Pine64 actually has two WiFi/BT modules. And they require
>>>>>different
>>>>>device tree snippets for both the WiFi and BT side. This is better
>>>>>resolved
>>>>>with device tree overlays.
>>>>>
>>>>>I have both, though I've yet found time to work on them.
>>>>
>>>> I have also both.
>>>>
>>>> The skeleton here can get the Wi-Fi of both to work.
>>>
>>>Cool. Then I can put away my RTL module for now. :)
>>
>> P.S. SDIO is auto detectable, and for BCM chips, the OOB interrupt
>> is only a bonus function and it can fall back to standard in-band
>> interrupt (which doesn't need special binding, and is currently
>> used by mainline r8723bs driver.)
>
>Correct. With BT you'll have serdev device nodes with different
>compatibles. Then you'll have to resort to overlays, and you'd probably
>end up adding WiFi OOB interrupt bits as well.
>
>So the question remaining is: should we enable the MMC part, along
>with power sequencing and regulator supplies, by default? Thinking
>more about it, I'm actually OK with it. The board connectors are
>clearly marked as being for a WiFi+BT module. The whole space on
>the board is surrounded by a box in silkscreen. Sorry for the
>initial nack.
>
>Maxime, any thoughts?
I remember he refused it for Pine A64.
>
>>>
>>>ChenYu
>>>
>>>>
>>>>>
>>>>>ChenYu
>>>>>
>>>>>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>>>>>> ---
>>>>>> .../allwinner/sun50i-h6-pine-h64-model-b.dts | 8 +++++
>>>>>> .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 29
>>>>>+++++++++++++++++++
>>>>>> 2 files changed, 37 insertions(+)
>>>>>>
>>>>>> diff --git
>>>>>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> index d0fcc25efb00..d0f775613c9b 100644
>>>>>> ---
>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> +++
>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> @@ -18,3 +18,11 @@
>>>>>> };
>>>>>> };
>>>>>> };
>>>>>> +
>>>>>> +&mmc1 {
>>>>>> + status = "okay";
>>>>>> +};
>>>>>> +
>>>>>> +&wifi_pwrseq {
>>>>>> + status = "okay";
>>>>>> +};
>>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> index a85867f8b684..75db6d4139bf 100644
>>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> @@ -40,6 +40,12 @@
>>>>>> gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /*
>>>PL7
>>>>>*/
>>>>>> };
>>>>>> };
>>>>>> +
>>>>>> + wifi_pwrseq: wifi_pwrseq {
>>>>>> + compatible = "mmc-pwrseq-simple";
>>>>>> + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /*
>PL2
>>>*/
>>>>>> + status = "disabled";
>>>>>> + };
>>>>>> };
>>>>>>
>>>>>> &mmc0 {
>>>>>> @@ -50,6 +56,17 @@
>>>>>> status = "okay";
>>>>>> };
>>>>>>
>>>>>> +&mmc1 {
>>>>>> + pinctrl-names = "default";
>>>>>> + pinctrl-0 = <&mmc1_pins>;
>>>>>> + vmmc-supply = <®_cldo2>;
>>>>>> + vqmmc-supply = <®_bldo2>;
>>>>>> + mmc-pwrseq = <&wifi_pwrseq>;
>>>>>> + bus-width = <4>;
>>>>>> + non-removable;
>>>>>> + status = "disabled";
>>>>>> +};
>>>>>> +
>>>>>> &mmc2 {
>>>>>> pinctrl-names = "default";
>>>>>> pinctrl-0 = <&mmc2_pins>;
>>>>>> @@ -128,12 +145,24 @@
>>>>>> };
>>>>>>
>>>>>> reg_cldo2: cldo2 {
>>>>>> + /*
>>>>>> + * This regulator is connected
>with
>>>>>CLDO3.
>>>>>> + * Before the kernel can support
>>>>>synchronized
>>>>>> + * enable of coupled regulators,
>>>keep
>>>>>them
>>>>>> + * both always on as a ugly hack.
>>>>>> + */
>>>>>> + regulator-always-on;
>>>>>> regulator-min-microvolt =
>>><3300000>;
>>>>>> regulator-max-microvolt =
>>><3300000>;
>>>>>> regulator-name = "vcc-wifi-1";
>>>>>> };
>>>>>>
>>>>>> reg_cldo3: cldo3 {
>>>>>> + /*
>>>>>> + * This regulator is connected
>with
>>>>>CLDO2.
>>>>>> + * See the comments for CLDO2.
>>>>>> + */
>>>>>> + regulator-always-on;
>>>>>> regulator-min-microvolt =
>>><3300000>;
>>>>>> regulator-max-microvolt =
>>><3300000>;
>>>>>> regulator-name = "vcc-wifi-2";
>>>>>> --
>>>>>> 2.18.0
>>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>Groups "linux-sunxi" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>>send an email to linux-sunxi+unsubscribe@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google
>Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it,
>send an email to linux-sunxi+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply
* [PATCH 9/9] openssl: minor indent fixes
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Fix inconsistent indent (and also make the openssl 1.1 recipe more
consistent and consistent with the openssl 1.0 recipe).
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
.../recipes-connectivity/openssl/openssl_1.1.0h.bb | 69 +++++++++++-----------
1 file changed, 35 insertions(+), 34 deletions(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
index 5dc2966..a7cd6a4 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
@@ -44,7 +44,7 @@ do_configure () {
linux-musl )
os=linux
;;
- *)
+ *)
;;
esac
target="$os-${HOST_ARCH}"
@@ -80,21 +80,21 @@ do_configure () {
target=linux-x86_64
;;
linux-mips)
- # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
+ # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
target="linux-mips32 ${TARGET_CC_ARCH}"
;;
linux-mipsel)
target="linux-mips32 ${TARGET_CC_ARCH}"
;;
- linux-gnun32-mips*)
- target=linux-mips64
- ;;
- linux-*-mips64 | linux-mips64)
- target=linux64-mips64
- ;;
- linux-*-mips64el | linux-mips64el)
- target=linux64-mips64
- ;;
+ linux-gnun32-mips*)
+ target=linux-mips64
+ ;;
+ linux-*-mips64 | linux-mips64)
+ target=linux64-mips64
+ ;;
+ linux-*-mips64el | linux-mips64el)
+ target=linux64-mips64
+ ;;
linux-microblaze*|linux-nios2*)
target=linux-generic32
;;
@@ -104,12 +104,12 @@ do_configure () {
linux-powerpc64)
target=linux-ppc64
;;
- linux-riscv64)
- target=linux-generic64
- ;;
linux-riscv32)
target=linux-generic32
;;
+ linux-riscv64)
+ target=linux-generic64
+ ;;
linux-supersparc)
target=linux-sparcv9
;;
@@ -120,40 +120,41 @@ do_configure () {
target=darwin-i386-cc
;;
esac
- useprefix=${prefix}
- if [ "x$useprefix" = "x" ]; then
- useprefix=/
- fi
+
+ useprefix=${prefix}
+ if [ "x$useprefix" = "x" ]; then
+ useprefix=/
+ fi
libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
- perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdirleaf} $target
+ perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=$libdirleaf $target
}
do_install () {
- oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
- oe_multilib_header openssl/opensslconf.h
+ oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
+ oe_multilib_header openssl/opensslconf.h
}
do_install_append_class-native () {
- # Install a custom version of c_rehash that can handle sysroots properly.
- # This version is used for example when installing ca-certificates during
- # image creation.
- install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
- sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
+ # Install a custom version of c_rehash that can handle sysroots properly.
+ # This version is used for example when installing ca-certificates during
+ # image creation.
+ install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
+ sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
}
do_install_append_class-nativesdk () {
- mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
- install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
+ mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
+ install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
}
do_install_ptest() {
- cp -r * ${D}${PTEST_PATH}
+ cp -r * ${D}${PTEST_PATH}
- # Putting .so files in ptest package will mess up the dependencies of the main openssl package
- # so we rename them to .so.ptest and patch the test accordingly
- mv ${D}${PTEST_PATH}/libcrypto.so ${D}${PTEST_PATH}/libcrypto.so.ptest
- mv ${D}${PTEST_PATH}/libssl.so ${D}${PTEST_PATH}/libssl.so.ptest
- sed -i 's/$target{shared_extension_simple}/".so.ptest"/' ${D}${PTEST_PATH}/test/recipes/90-test_shlibload.t
+ # Putting .so files in ptest package will mess up the dependencies of the main openssl package
+ # so we rename them to .so.ptest and patch the test accordingly
+ mv ${D}${PTEST_PATH}/libcrypto.so ${D}${PTEST_PATH}/libcrypto.so.ptest
+ mv ${D}${PTEST_PATH}/libssl.so ${D}${PTEST_PATH}/libssl.so.ptest
+ sed -i 's/$target{shared_extension_simple}/".so.ptest"/' ${D}${PTEST_PATH}/test/recipes/90-test_shlibload.t
}
PACKAGES =+ "${PN}-engines"
--
1.9.1
^ permalink raw reply related
* [PATCH 8/9] openssl: support musl-x32 build
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Align the openssl 1.1 recipe with changes made to openssl 1.0:
http://git.openembedded.org/openembedded-core/commit/?id=a072d4620db462c5d3459441d5684cfd99938400
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-connectivity/openssl/openssl_1.1.0h.bb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
index a2f5d67..5dc2966 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
@@ -39,7 +39,9 @@ do_configure () {
case $os in
linux-gnueabi |\
linux-gnuspe |\
- linux-musl*)
+ linux-musleabi |\
+ linux-muslspe |\
+ linux-musl )
os=linux
;;
*)
@@ -71,7 +73,7 @@ do_configure () {
linux-i686)
target=linux-elf
;;
- linux-gnux32-x86_64)
+ linux-gnux32-x86_64 | linux-muslx32-x86_64 )
target=linux-x32
;;
linux-gnu64-x86_64)
--
1.9.1
^ permalink raw reply related
* [PATCH 7/9] openssl: remove uclibc remnants
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Align the openssl 1.1 recipe with changes made to openssl 1.0:
http://git.openembedded.org/openembedded-core/commit/?id=e01e7c543a559c8926d72159b5cd55db0c661434
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-connectivity/openssl/openssl_1.1.0h.bb | 3 ---
1 file changed, 3 deletions(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
index c0aaaf6..a2f5d67 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
@@ -37,10 +37,7 @@ EXTRA_OECONF_append_libc-musl = " -DOPENSSL_NO_ASYNC"
do_configure () {
os=${HOST_OS}
case $os in
- linux-uclibc |\
- linux-uclibceabi |\
linux-gnueabi |\
- linux-uclibcspe |\
linux-gnuspe |\
linux-musl*)
os=linux
--
1.9.1
^ permalink raw reply related
* Re: Re: [PATCH 3/3] arm64: allwinner: dts: h6: add Wi-Fi support for Pine H64 model A/B
From: Icenowy Zheng @ 2018-07-24 2:39 UTC (permalink / raw)
To: wens-jdAy2FN1RRM
Cc: Maxime Ripard, linux-arm-kernel, devicetree, linux-kernel,
linux-sunxi
In-Reply-To: <CAGb2v656oPmAX=_y88b05xqrona3HFtU-VmNQhHxK_n-4gD+aw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
于 2018年7月24日 GMT+08:00 上午10:37:51, Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> 写到:
>On Tue, Jul 24, 2018 at 10:28 AM, Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
>wrote:
>>
>>
>> 于 2018年7月24日 GMT+08:00 上午10:26:02, Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> 写到:
>>>On Tue, Jul 24, 2018 at 10:23 AM, Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
>>>wrote:
>>>>
>>>>
>>>> 于 2018年7月24日 GMT+08:00 上午10:21:59, Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> 写到:
>>>>>On Tue, Jul 24, 2018 at 9:15 AM, Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
>>>wrote:
>>>>>> The Pine H64 model A has a Wi-Fi module connector and the model B
>>>has
>>>>>an
>>>>>> on-board RTL8723BS Wi-Fi module.
>>>>>>
>>>>>> Add support for them. For model A, as it's not defaultly present,
>>>>>keep
>>>>>> it disabled now.
>>>>>
>>>>>Nope. Pine64 actually has two WiFi/BT modules. And they require
>>>>>different
>>>>>device tree snippets for both the WiFi and BT side. This is better
>>>>>resolved
>>>>>with device tree overlays.
>>>>>
>>>>>I have both, though I've yet found time to work on them.
>>>>
>>>> I have also both.
>>>>
>>>> The skeleton here can get the Wi-Fi of both to work.
>>>
>>>Cool. Then I can put away my RTL module for now. :)
>>
>> P.S. SDIO is auto detectable, and for BCM chips, the OOB interrupt
>> is only a bonus function and it can fall back to standard in-band
>> interrupt (which doesn't need special binding, and is currently
>> used by mainline r8723bs driver.)
>
>Correct. With BT you'll have serdev device nodes with different
>compatibles. Then you'll have to resort to overlays, and you'd probably
>end up adding WiFi OOB interrupt bits as well.
>
>So the question remaining is: should we enable the MMC part, along
>with power sequencing and regulator supplies, by default? Thinking
>more about it, I'm actually OK with it. The board connectors are
>clearly marked as being for a WiFi+BT module. The whole space on
>the board is surrounded by a box in silkscreen. Sorry for the
>initial nack.
>
>Maxime, any thoughts?
I remember he refused it for Pine A64.
>
>>>
>>>ChenYu
>>>
>>>>
>>>>>
>>>>>ChenYu
>>>>>
>>>>>> Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
>>>>>> ---
>>>>>> .../allwinner/sun50i-h6-pine-h64-model-b.dts | 8 +++++
>>>>>> .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 29
>>>>>+++++++++++++++++++
>>>>>> 2 files changed, 37 insertions(+)
>>>>>>
>>>>>> diff --git
>>>>>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> index d0fcc25efb00..d0f775613c9b 100644
>>>>>> ---
>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> +++
>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> @@ -18,3 +18,11 @@
>>>>>> };
>>>>>> };
>>>>>> };
>>>>>> +
>>>>>> +&mmc1 {
>>>>>> + status = "okay";
>>>>>> +};
>>>>>> +
>>>>>> +&wifi_pwrseq {
>>>>>> + status = "okay";
>>>>>> +};
>>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> index a85867f8b684..75db6d4139bf 100644
>>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> @@ -40,6 +40,12 @@
>>>>>> gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /*
>>>PL7
>>>>>*/
>>>>>> };
>>>>>> };
>>>>>> +
>>>>>> + wifi_pwrseq: wifi_pwrseq {
>>>>>> + compatible = "mmc-pwrseq-simple";
>>>>>> + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /*
>PL2
>>>*/
>>>>>> + status = "disabled";
>>>>>> + };
>>>>>> };
>>>>>>
>>>>>> &mmc0 {
>>>>>> @@ -50,6 +56,17 @@
>>>>>> status = "okay";
>>>>>> };
>>>>>>
>>>>>> +&mmc1 {
>>>>>> + pinctrl-names = "default";
>>>>>> + pinctrl-0 = <&mmc1_pins>;
>>>>>> + vmmc-supply = <®_cldo2>;
>>>>>> + vqmmc-supply = <®_bldo2>;
>>>>>> + mmc-pwrseq = <&wifi_pwrseq>;
>>>>>> + bus-width = <4>;
>>>>>> + non-removable;
>>>>>> + status = "disabled";
>>>>>> +};
>>>>>> +
>>>>>> &mmc2 {
>>>>>> pinctrl-names = "default";
>>>>>> pinctrl-0 = <&mmc2_pins>;
>>>>>> @@ -128,12 +145,24 @@
>>>>>> };
>>>>>>
>>>>>> reg_cldo2: cldo2 {
>>>>>> + /*
>>>>>> + * This regulator is connected
>with
>>>>>CLDO3.
>>>>>> + * Before the kernel can support
>>>>>synchronized
>>>>>> + * enable of coupled regulators,
>>>keep
>>>>>them
>>>>>> + * both always on as a ugly hack.
>>>>>> + */
>>>>>> + regulator-always-on;
>>>>>> regulator-min-microvolt =
>>><3300000>;
>>>>>> regulator-max-microvolt =
>>><3300000>;
>>>>>> regulator-name = "vcc-wifi-1";
>>>>>> };
>>>>>>
>>>>>> reg_cldo3: cldo3 {
>>>>>> + /*
>>>>>> + * This regulator is connected
>with
>>>>>CLDO2.
>>>>>> + * See the comments for CLDO2.
>>>>>> + */
>>>>>> + regulator-always-on;
>>>>>> regulator-min-microvolt =
>>><3300000>;
>>>>>> regulator-max-microvolt =
>>><3300000>;
>>>>>> regulator-name = "vcc-wifi-2";
>>>>>> --
>>>>>> 2.18.0
>>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>Groups "linux-sunxi" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>>send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google
>Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it,
>send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply
* [linux-sunxi] Re: [PATCH 3/3] arm64: allwinner: dts: h6: add Wi-Fi support for Pine H64 model A/B
From: Icenowy Zheng @ 2018-07-24 2:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAGb2v656oPmAX=_y88b05xqrona3HFtU-VmNQhHxK_n-4gD+aw@mail.gmail.com>
? 2018?7?24? GMT+08:00 ??10:37:51, Chen-Yu Tsai <wens@csie.org> ??:
>On Tue, Jul 24, 2018 at 10:28 AM, Icenowy Zheng <icenowy@aosc.io>
>wrote:
>>
>>
>> ? 2018?7?24? GMT+08:00 ??10:26:02, Chen-Yu Tsai <wens@csie.org> ??:
>>>On Tue, Jul 24, 2018 at 10:23 AM, Icenowy Zheng <icenowy@aosc.io>
>>>wrote:
>>>>
>>>>
>>>> ? 2018?7?24? GMT+08:00 ??10:21:59, Chen-Yu Tsai <wens@csie.org> ??:
>>>>>On Tue, Jul 24, 2018 at 9:15 AM, Icenowy Zheng <icenowy@aosc.io>
>>>wrote:
>>>>>> The Pine H64 model A has a Wi-Fi module connector and the model B
>>>has
>>>>>an
>>>>>> on-board RTL8723BS Wi-Fi module.
>>>>>>
>>>>>> Add support for them. For model A, as it's not defaultly present,
>>>>>keep
>>>>>> it disabled now.
>>>>>
>>>>>Nope. Pine64 actually has two WiFi/BT modules. And they require
>>>>>different
>>>>>device tree snippets for both the WiFi and BT side. This is better
>>>>>resolved
>>>>>with device tree overlays.
>>>>>
>>>>>I have both, though I've yet found time to work on them.
>>>>
>>>> I have also both.
>>>>
>>>> The skeleton here can get the Wi-Fi of both to work.
>>>
>>>Cool. Then I can put away my RTL module for now. :)
>>
>> P.S. SDIO is auto detectable, and for BCM chips, the OOB interrupt
>> is only a bonus function and it can fall back to standard in-band
>> interrupt (which doesn't need special binding, and is currently
>> used by mainline r8723bs driver.)
>
>Correct. With BT you'll have serdev device nodes with different
>compatibles. Then you'll have to resort to overlays, and you'd probably
>end up adding WiFi OOB interrupt bits as well.
>
>So the question remaining is: should we enable the MMC part, along
>with power sequencing and regulator supplies, by default? Thinking
>more about it, I'm actually OK with it. The board connectors are
>clearly marked as being for a WiFi+BT module. The whole space on
>the board is surrounded by a box in silkscreen. Sorry for the
>initial nack.
>
>Maxime, any thoughts?
I remember he refused it for Pine A64.
>
>>>
>>>ChenYu
>>>
>>>>
>>>>>
>>>>>ChenYu
>>>>>
>>>>>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>>>>>> ---
>>>>>> .../allwinner/sun50i-h6-pine-h64-model-b.dts | 8 +++++
>>>>>> .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 29
>>>>>+++++++++++++++++++
>>>>>> 2 files changed, 37 insertions(+)
>>>>>>
>>>>>> diff --git
>>>>>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> index d0fcc25efb00..d0f775613c9b 100644
>>>>>> ---
>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> +++
>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>>> @@ -18,3 +18,11 @@
>>>>>> };
>>>>>> };
>>>>>> };
>>>>>> +
>>>>>> +&mmc1 {
>>>>>> + status = "okay";
>>>>>> +};
>>>>>> +
>>>>>> +&wifi_pwrseq {
>>>>>> + status = "okay";
>>>>>> +};
>>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> index a85867f8b684..75db6d4139bf 100644
>>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>>> @@ -40,6 +40,12 @@
>>>>>> gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /*
>>>PL7
>>>>>*/
>>>>>> };
>>>>>> };
>>>>>> +
>>>>>> + wifi_pwrseq: wifi_pwrseq {
>>>>>> + compatible = "mmc-pwrseq-simple";
>>>>>> + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /*
>PL2
>>>*/
>>>>>> + status = "disabled";
>>>>>> + };
>>>>>> };
>>>>>>
>>>>>> &mmc0 {
>>>>>> @@ -50,6 +56,17 @@
>>>>>> status = "okay";
>>>>>> };
>>>>>>
>>>>>> +&mmc1 {
>>>>>> + pinctrl-names = "default";
>>>>>> + pinctrl-0 = <&mmc1_pins>;
>>>>>> + vmmc-supply = <®_cldo2>;
>>>>>> + vqmmc-supply = <®_bldo2>;
>>>>>> + mmc-pwrseq = <&wifi_pwrseq>;
>>>>>> + bus-width = <4>;
>>>>>> + non-removable;
>>>>>> + status = "disabled";
>>>>>> +};
>>>>>> +
>>>>>> &mmc2 {
>>>>>> pinctrl-names = "default";
>>>>>> pinctrl-0 = <&mmc2_pins>;
>>>>>> @@ -128,12 +145,24 @@
>>>>>> };
>>>>>>
>>>>>> reg_cldo2: cldo2 {
>>>>>> + /*
>>>>>> + * This regulator is connected
>with
>>>>>CLDO3.
>>>>>> + * Before the kernel can support
>>>>>synchronized
>>>>>> + * enable of coupled regulators,
>>>keep
>>>>>them
>>>>>> + * both always on as a ugly hack.
>>>>>> + */
>>>>>> + regulator-always-on;
>>>>>> regulator-min-microvolt =
>>><3300000>;
>>>>>> regulator-max-microvolt =
>>><3300000>;
>>>>>> regulator-name = "vcc-wifi-1";
>>>>>> };
>>>>>>
>>>>>> reg_cldo3: cldo3 {
>>>>>> + /*
>>>>>> + * This regulator is connected
>with
>>>>>CLDO2.
>>>>>> + * See the comments for CLDO2.
>>>>>> + */
>>>>>> + regulator-always-on;
>>>>>> regulator-min-microvolt =
>>><3300000>;
>>>>>> regulator-max-microvolt =
>>><3300000>;
>>>>>> regulator-name = "vcc-wifi-2";
>>>>>> --
>>>>>> 2.18.0
>>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>Groups "linux-sunxi" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>>send an email to linux-sunxi+unsubscribe at googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google
>Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it,
>send an email to linux-sunxi+unsubscribe at googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply
* [PATCH 6/9] openssl_1.0: avoid running make twice for target do_compile()
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Currently target builds call make twice as part of do_compile(). It
appears to be an accidental side effect of needing to only pass
CC_INFO on the make command line for target builds, since CC_INFO is
only referenced by the reproducible build patches.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-connectivity/openssl/openssl_1.0.2o.bb | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
index 58627b0..9e5e7ec 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
@@ -210,16 +210,16 @@ do_configure () {
perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=$libdirleaf $target
}
-do_compile_prepend_class-target () {
- sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
+do_compile () {
oe_runmake depend
- cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
- oe_runmake CC_INFO="$cc_sanitized"
+ oe_runmake
}
-do_compile () {
+do_compile_class-target () {
+ sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
oe_runmake depend
- oe_runmake
+ cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
+ oe_runmake CC_INFO="$cc_sanitized"
}
do_compile_ptest () {
--
1.9.1
^ permalink raw reply related
* [PATCH 5/9] openssl_1.0: drop leading "-" from no-ssl3 config option
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Although passing -no-ssl3 works, comments in the openssl Configure
script suggest doing so isn't really correct:
s /^-no-/no-/; # some people just can't read the instructions
The documented way to pass no-<cipher> config options is without a
leading "-"
https://github.com/openssl/openssl/blob/OpenSSL_1_0_2-stable/INSTALL
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-connectivity/openssl/openssl_1.0.2o.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
index d9e9c84..58627b0 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
@@ -71,7 +71,7 @@ PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryp
# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
# vulnerability
-EXTRA_OECONF = "-no-ssl3"
+EXTRA_OECONF = "no-ssl3"
export DIRS = "crypto ssl apps engines"
export AS = "${CC} -c"
--
1.9.1
^ permalink raw reply related
* [PATCH 4/9] openssl_1.0: fix cryptodev-linux PACKAGECONFIG support
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Since openssl isn't an autotools recipe, defining cryptodev-linux
related config options via PACKAGECONFIG hasn't worked correctly
since PACKAGECONFIG_CONFARGS stopped being automatically appended to
EXTRA_OECONF in 2016:
http://git.openembedded.org/openembedded-core/commit/?id=c98fb5f5129e71829ffab4449b3d28082bc95ab4
The issue appears to have been hidden as the flags are also hardcoded
in CFLAG - and therefore always enabled, regardless of the state of
the PACKAGECONFIG option. Fix by passing both EXTRA_OECONF and
PACKAGECONFIG_CONFARGS when running the openssl Configure script.
Although the openssl 1.1 recipe doesn't contain any PACKAGECONFIG
options yet, pre-emptively make the same fix there too.
Also only enable cryptodev-linux by default for target builds (based
on the historical comments in the recipe, that seems to have been the
original intention).
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-connectivity/openssl/openssl_1.0.2o.bb | 9 ++++-----
meta/recipes-connectivity/openssl/openssl_1.1.0h.bb | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
index 9bc9e64..d9e9c84 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
@@ -63,6 +63,9 @@ UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar"
inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
PACKAGECONFIG ?= "cryptodev-linux"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
PACKAGECONFIG[perl] = ",,,"
PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux"
@@ -88,10 +91,6 @@ CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB
# (and it causes issues with SELinux)
CFLAG += "-Wa,--noexecstack"
-# For target side versions of openssl enable support for OCF Linux driver
-# if they are available.
-CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
-
CFLAG_append_class-native = " -fPIC"
do_configure_prepend_darwin () {
@@ -208,7 +207,7 @@ do_configure () {
useprefix=/
fi
libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
- perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=$libdirleaf $target
+ perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=$libdirleaf $target
}
do_compile_prepend_class-target () {
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
index 8d445e4..c0aaaf6 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
@@ -126,7 +126,7 @@ do_configure () {
useprefix=/
fi
libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
- perl ./Configure ${EXTRA_OECONF} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdirleaf} $target
+ perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdirleaf} $target
}
do_install () {
--
1.9.1
^ permalink raw reply related
* [PATCH 3/9] openssl_1.0: drop curly brackets from shell local variables
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Make clear distinction between local variables and bitbake variables.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-connectivity/openssl/openssl_1.0.2o.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
index 7f32d09..9bc9e64 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
@@ -208,14 +208,14 @@ do_configure () {
useprefix=/
fi
libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
- perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target
+ perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=$libdirleaf $target
}
do_compile_prepend_class-target () {
sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
oe_runmake depend
cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
- oe_runmake CC_INFO="${cc_sanitized}"
+ oe_runmake CC_INFO="$cc_sanitized"
}
do_compile () {
--
1.9.1
^ permalink raw reply related
* [PATCH 2/9] openssl_1.0: minor recipe formatting tweaks etc
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <1532399935-32296-1-git-send-email-armccurdy@gmail.com>
Drop redundant setting of S to its default value, fix inconsistent
indent and re-order variables to align more closely to the OE
style-guide.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
.../recipes-connectivity/openssl/openssl_1.0.2o.bb | 121 +++++++++++----------
1 file changed, 61 insertions(+), 60 deletions(-)
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
index 619f3d8..7f32d09 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
@@ -46,7 +46,7 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
file://0001-openssl-force-soft-link-to-avoid-rare-race.patch \
"
-SRC_URI_append_class-target = "\
+SRC_URI_append_class-target = " \
file://reproducible-cflags.patch \
file://reproducible-mkbuildinf.patch \
"
@@ -58,75 +58,55 @@ SRC_URI_append_class-nativesdk = " \
SRC_URI[md5sum] = "44279b8557c3247cbe324e2322ecd114"
SRC_URI[sha256sum] = "ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d"
-S = "${WORKDIR}/openssl-${PV}"
UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar"
+inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
+
PACKAGECONFIG ?= "cryptodev-linux"
PACKAGECONFIG[perl] = ",,,"
PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux"
-TERMIO_libc-musl = "-DTERMIOS"
-TERMIO ?= "-DTERMIO"
-# Avoid binaries being marked as requiring an executable stack since it
-# doesn't(which causes and this causes issues with SELinux
-CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
- ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
-
-# For target side versions of openssl enable support for OCF Linux driver
-# if they are available.
-
-CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
-CFLAG_append_class-native = " -fPIC"
+# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
+# vulnerability
+EXTRA_OECONF = "-no-ssl3"
export DIRS = "crypto ssl apps engines"
-export EX_LIBS = "-lgcc -ldl"
export AS = "${CC} -c"
-
+export EX_LIBS = "-lgcc -ldl"
export OE_LDFLAGS = "${LDFLAGS}"
# openssl fails with ccache: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12810
CCACHE = ""
-inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
+TERMIO ?= "-DTERMIO"
+TERMIO_libc-musl = "-DTERMIOS"
-PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
-FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
-FILES_libssl = "${libdir}/libssl${SOLIBS}"
-FILES_${PN} =+ " ${libdir}/ssl/*"
-FILES_${PN}-misc = "${libdir}/ssl/misc"
-RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
+CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
+ ${TERMIO} ${CFLAGS} -Wall"
-# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
-# package RRECOMMENDS on this package. This will enable the configuration
-# file to be installed for both the base openssl package and the libcrypto
-# package since the base openssl package depends on the libcrypto package.
-FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
-CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
-RRECOMMENDS_libcrypto += "openssl-conf"
-RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
+# Avoid binaries being marked as requiring an executable stack since they don't
+# (and it causes issues with SELinux)
+CFLAG += "-Wa,--noexecstack"
-PACKAGES =+ "${PN}-engines"
-FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
+# For target side versions of openssl enable support for OCF Linux driver
+# if they are available.
+CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
-# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
-# vulnerability
-EXTRA_OECONF = " -no-ssl3"
+CFLAG_append_class-native = " -fPIC"
do_configure_prepend_darwin () {
sed -i -e '/version-script=openssl\.ld/d' Configure
}
-# The crypto_use_bigint patch means that perl's bignum module needs to be
-# installed, but some distributions (for example Fedora 23) don't ship it by
-# default. As the resulting error is very misleading check for bignum before
-# building.
-do_configure_prepend() {
+do_configure () {
+ # The crypto_use_bigint patch means that perl's bignum module needs to be
+ # installed, but some distributions (for example Fedora 23) don't ship it by
+ # default. As the resulting error is very misleading check for bignum before
+ # building.
if ! perl -Mbigint -e true; then
bbfatal "The perl module 'bignum' was not found but this is required to build openssl. Please install this module (often packaged as perl-bignum) and re-run bitbake."
fi
-}
-do_configure () {
cd util
perl perlpath.pl ${STAGING_BINDIR_NATIVE}
cd ..
@@ -141,7 +121,7 @@ do_configure () {
linux-musl )
os=linux
;;
- *)
+ *)
;;
esac
target="$os-${HOST_ARCH}"
@@ -203,12 +183,12 @@ do_configure () {
linux-powerpc64)
target=linux-ppc64
;;
- linux-riscv64)
- target=linux-generic64
- ;;
linux-riscv32)
target=linux-generic32
;;
+ linux-riscv64)
+ target=linux-generic64
+ ;;
linux-supersparc)
target=linux-sparcv8
;;
@@ -219,19 +199,21 @@ do_configure () {
target=darwin-i386-cc
;;
esac
+
# inject machine-specific flags
sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
- useprefix=${prefix}
- if [ "x$useprefix" = "x" ]; then
- useprefix=/
- fi
+
+ useprefix=${prefix}
+ if [ "x$useprefix" = "x" ]; then
+ useprefix=/
+ fi
libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target
}
do_compile_prepend_class-target () {
- sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
- oe_runmake depend
+ sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
+ oe_runmake depend
cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
oe_runmake CC_INFO="${cc_sanitized}"
}
@@ -296,8 +278,8 @@ do_install () {
do_install_ptest () {
cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
- # Replace the path to native perl with the path to target perl
- sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
+ # Replace the path to native perl with the path to target perl
+ sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
cp Configure config e_os.h ${D}${PTEST_PATH}
cp -r -L include ${D}${PTEST_PATH}
@@ -336,9 +318,9 @@ do_install_ptest () {
# Remove build host references
sed -i \
- -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
- -e 's|${DEBUG_PREFIX_MAP}||g' \
- ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure
}
do_install_append_class-native() {
@@ -350,10 +332,29 @@ do_install_append_class-native() {
}
do_install_append_class-nativesdk() {
- mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
- install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
+ mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
+ install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
}
+# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
+# package RRECOMMENDS on this package. This will enable the configuration
+# file to be installed for both the base openssl package and the libcrypto
+# package since the base openssl package depends on the libcrypto package.
+
+PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc"
+
+FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
+FILES_libssl = "${libdir}/libssl${SOLIBS}"
+FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
+FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
+FILES_${PN}-misc = "${libdir}/ssl/misc"
+FILES_${PN} =+ "${libdir}/ssl/*"
FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
+CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
+
+RRECOMMENDS_libcrypto += "openssl-conf"
+RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
+RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
+
BBCLASSEXTEND = "native nativesdk"
--
1.9.1
^ permalink raw reply related
* [PATCH 1/9] openssl_1.0: merge openssl10.inc into the openssl_1.0.2o.bb recipe
From: Andre McCurdy @ 2018-07-24 2:38 UTC (permalink / raw)
To: openembedded-core
The openssl10.inc include file only has one user, so we can improve
maintainability by merging the include file into the recipe which
uses it.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/recipes-connectivity/openssl/openssl10.inc | 296 --------------------
.../recipes-connectivity/openssl/openssl_1.0.2o.bb | 310 ++++++++++++++++++++-
2 files changed, 300 insertions(+), 306 deletions(-)
delete mode 100644 meta/recipes-connectivity/openssl/openssl10.inc
diff --git a/meta/recipes-connectivity/openssl/openssl10.inc b/meta/recipes-connectivity/openssl/openssl10.inc
deleted file mode 100644
index 1f8834f..0000000
--- a/meta/recipes-connectivity/openssl/openssl10.inc
+++ /dev/null
@@ -1,296 +0,0 @@
-SUMMARY = "Secure Socket Layer"
-DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
-HOMEPAGE = "http://www.openssl.org/"
-BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
-SECTION = "libs/network"
-
-# "openssl | SSLeay" dual license
-LICENSE = "openssl"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8"
-
-DEPENDS = "makedepend-native hostperl-runtime-native"
-DEPENDS_append_class-target = " openssl-native"
-
-PROVIDES += "openssl10"
-
-SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
- "
-S = "${WORKDIR}/openssl-${PV}"
-UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar"
-
-PACKAGECONFIG ?= "cryptodev-linux"
-PACKAGECONFIG[perl] = ",,,"
-PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux"
-
-TERMIO_libc-musl = "-DTERMIOS"
-TERMIO ?= "-DTERMIO"
-# Avoid binaries being marked as requiring an executable stack since it
-# doesn't(which causes and this causes issues with SELinux
-CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
- ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
-
-export DIRS = "crypto ssl apps"
-export EX_LIBS = "-lgcc -ldl"
-export AS = "${CC} -c"
-
-# openssl fails with ccache: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12810
-CCACHE = ""
-
-inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
-
-PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
-FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
-FILES_libssl = "${libdir}/libssl${SOLIBS}"
-FILES_${PN} =+ " ${libdir}/ssl/*"
-FILES_${PN}-misc = "${libdir}/ssl/misc"
-RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
-
-# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
-# package RRECOMMENDS on this package. This will enable the configuration
-# file to be installed for both the base openssl package and the libcrypto
-# package since the base openssl package depends on the libcrypto package.
-FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
-CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
-RRECOMMENDS_libcrypto += "openssl-conf"
-RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
-
-# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
-# vulnerability
-EXTRA_OECONF = " -no-ssl3"
-
-do_configure_prepend_darwin () {
- sed -i -e '/version-script=openssl\.ld/d' Configure
-}
-
-do_configure () {
- cd util
- perl perlpath.pl ${STAGING_BINDIR_NATIVE}
- cd ..
- ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
-
- os=${HOST_OS}
- case $os in
- linux-gnueabi |\
- linux-gnuspe |\
- linux-musleabi |\
- linux-muslspe |\
- linux-musl )
- os=linux
- ;;
- *)
- ;;
- esac
- target="$os-${HOST_ARCH}"
- case $target in
- linux-arm)
- target=linux-armv4
- ;;
- linux-armeb)
- target=linux-elf-armeb
- ;;
- linux-aarch64*)
- target=linux-aarch64
- ;;
- linux-sh3)
- target=debian-sh3
- ;;
- linux-sh4)
- target=debian-sh4
- ;;
- linux-i486)
- target=debian-i386-i486
- ;;
- linux-i586 | linux-viac3)
- target=debian-i386-i586
- ;;
- linux-i686)
- target=debian-i386-i686/cmov
- ;;
- linux-gnux32-x86_64 | linux-muslx32-x86_64 )
- target=linux-x32
- ;;
- linux-gnu64-x86_64)
- target=linux-x86_64
- ;;
- linux-gnun32-mips*el)
- target=debian-mipsn32el
- ;;
- linux-gnun32-mips*)
- target=debian-mipsn32
- ;;
- linux-mips*64*el)
- target=debian-mips64el
- ;;
- linux-mips*64*)
- target=debian-mips64
- ;;
- linux-mips*el)
- target=debian-mipsel
- ;;
- linux-mips*)
- target=debian-mips
- ;;
- linux-microblaze*|linux-nios2*|linux-gnu*ilp32**)
- target=linux-generic32
- ;;
- linux-powerpc)
- target=linux-ppc
- ;;
- linux-powerpc64)
- target=linux-ppc64
- ;;
- linux-riscv64)
- target=linux-generic64
- ;;
- linux-riscv32)
- target=linux-generic32
- ;;
- linux-supersparc)
- target=linux-sparcv8
- ;;
- linux-sparc)
- target=linux-sparcv8
- ;;
- darwin-i386)
- target=darwin-i386-cc
- ;;
- esac
- # inject machine-specific flags
- sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
- useprefix=${prefix}
- if [ "x$useprefix" = "x" ]; then
- useprefix=/
- fi
- libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
- perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target
-}
-
-do_compile_prepend_class-target () {
- sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
- oe_runmake depend
- cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
- oe_runmake CC_INFO="${cc_sanitized}"
-}
-
-do_compile () {
- oe_runmake depend
- oe_runmake
-}
-
-do_compile_ptest () {
- # build dependencies for test directory too
- export DIRS="$DIRS test"
- oe_runmake depend
- oe_runmake buildtest
-}
-
-do_install () {
- # Create ${D}/${prefix} to fix parallel issues
- mkdir -p ${D}/${prefix}/
-
- oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install
-
- oe_libinstall -so libcrypto ${D}${libdir}
- oe_libinstall -so libssl ${D}${libdir}
-
- install -d ${D}${includedir}
- cp --dereference -R include/openssl ${D}${includedir}
-
- install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
- sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
-
- oe_multilib_header openssl/opensslconf.h
- if [ "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" ]; then
- sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
- sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
- else
- rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
- fi
-
- # Create SSL structure
- install -d ${D}${sysconfdir}/ssl/
- mv ${D}${libdir}/ssl/openssl.cnf \
- ${D}${libdir}/ssl/certs \
- ${D}${libdir}/ssl/private \
- \
- ${D}${sysconfdir}/ssl/
- ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
- ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
- ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
-
- # Rename man pages to prefix openssl10-*
- for f in `find ${D}${mandir} -type f`; do
- mv $f $(dirname $f)/openssl10-$(basename $f)
- done
- for f in `find ${D}${mandir} -type l`; do
- ln_f=`readlink $f`
- rm -f $f
- ln -s openssl10-$ln_f $(dirname $f)/openssl10-$(basename $f)
- done
-}
-
-do_install_ptest () {
- cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
-
- # Replace the path to native perl with the path to target perl
- sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
-
- cp Configure config e_os.h ${D}${PTEST_PATH}
- cp -r -L include ${D}${PTEST_PATH}
- ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
- ln -sf ${libdir}/libssl.a ${D}${PTEST_PATH}
- mkdir -p ${D}${PTEST_PATH}/crypto
- cp crypto/constant_time_locl.h ${D}${PTEST_PATH}/crypto
- cp -r certs ${D}${PTEST_PATH}
- mkdir -p ${D}${PTEST_PATH}/apps
- ln -sf ${libdir}/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
- ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
- ln -sf ${bindir}/openssl ${D}${PTEST_PATH}/apps
- cp apps/server.pem ${D}${PTEST_PATH}/apps
- cp apps/server2.pem ${D}${PTEST_PATH}/apps
- mkdir -p ${D}${PTEST_PATH}/util
- install util/opensslwrap.sh ${D}${PTEST_PATH}/util
- install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
- # Time stamps are relevant for "make alltests", otherwise
- # make may try to recompile binaries. Not only must the
- # binary files be newer than the sources, they also must
- # be more recent than the header files in /usr/include.
- #
- # Using "cp -a" is not sufficient, because do_install
- # does not preserve the original time stamps.
- #
- # So instead of using the original file stamps, we set
- # the current time for all files. Binaries will get
- # modified again later when stripping them, but that's okay.
- touch ${D}${PTEST_PATH}
- find ${D}${PTEST_PATH} -type f -print0 | xargs --verbose -0 touch -r ${D}${PTEST_PATH}
-
- # exclude binary files or the package won't install
- for d in ssltest_old v3ext x509aux; do
- rm -rf ${D}${libdir}/${BPN}/ptest/test/$d
- done
-
- # Remove build host references
- sed -i \
- -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
- -e 's|${DEBUG_PREFIX_MAP}||g' \
- ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure
-}
-
-do_install_append_class-native() {
- create_wrapper ${D}${bindir}/openssl \
- OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
- SSL_CERT_DIR=${libdir}/ssl/certs \
- SSL_CERT_FILE=${libdir}/ssl/cert.pem \
- OPENSSL_ENGINES=${libdir}/ssl/engines
-}
-
-do_install_append_class-nativesdk() {
- mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
- install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
-}
-
-FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
-
-BBCLASSEXTEND = "native nativesdk"
-
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
index 7cae553..619f3d8 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
@@ -1,17 +1,20 @@
-require openssl10.inc
-
-# For target side versions of openssl enable support for OCF Linux driver
-# if they are available.
-
-CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
-CFLAG_append_class-native = " -fPIC"
+SUMMARY = "Secure Socket Layer"
+DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
+HOMEPAGE = "http://www.openssl.org/"
+BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
+SECTION = "libs/network"
+# "openssl | SSLeay" dual license
+LICENSE = "openssl"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f475368924827d06d4b416111c8bdb77"
-export DIRS = "crypto ssl apps engines"
-export OE_LDFLAGS="${LDFLAGS}"
+DEPENDS = "makedepend-native hostperl-runtime-native"
+DEPENDS_append_class-target = " openssl-native"
+
+PROVIDES += "openssl10"
-SRC_URI += "file://find.pl;subdir=openssl-${PV}/util/ \
+SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
+ file://find.pl;subdir=openssl-${PV}/util/ \
file://run-ptest \
file://openssl-c_rehash.sh \
file://configure-targets.patch \
@@ -55,9 +58,64 @@ SRC_URI_append_class-nativesdk = " \
SRC_URI[md5sum] = "44279b8557c3247cbe324e2322ecd114"
SRC_URI[sha256sum] = "ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d"
+S = "${WORKDIR}/openssl-${PV}"
+UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar"
+
+PACKAGECONFIG ?= "cryptodev-linux"
+PACKAGECONFIG[perl] = ",,,"
+PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux"
+
+TERMIO_libc-musl = "-DTERMIOS"
+TERMIO ?= "-DTERMIO"
+# Avoid binaries being marked as requiring an executable stack since it
+# doesn't(which causes and this causes issues with SELinux
+CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
+ ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
+
+# For target side versions of openssl enable support for OCF Linux driver
+# if they are available.
+
+CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
+CFLAG_append_class-native = " -fPIC"
+
+export DIRS = "crypto ssl apps engines"
+export EX_LIBS = "-lgcc -ldl"
+export AS = "${CC} -c"
+
+export OE_LDFLAGS = "${LDFLAGS}"
+
+# openssl fails with ccache: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12810
+CCACHE = ""
+
+inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
+
+PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
+FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
+FILES_libssl = "${libdir}/libssl${SOLIBS}"
+FILES_${PN} =+ " ${libdir}/ssl/*"
+FILES_${PN}-misc = "${libdir}/ssl/misc"
+RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
+
+# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
+# package RRECOMMENDS on this package. This will enable the configuration
+# file to be installed for both the base openssl package and the libcrypto
+# package since the base openssl package depends on the libcrypto package.
+FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
+CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
+RRECOMMENDS_libcrypto += "openssl-conf"
+RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
+
PACKAGES =+ "${PN}-engines"
FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
+# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
+# vulnerability
+EXTRA_OECONF = " -no-ssl3"
+
+do_configure_prepend_darwin () {
+ sed -i -e '/version-script=openssl\.ld/d' Configure
+}
+
# The crypto_use_bigint patch means that perl's bignum module needs to be
# installed, but some distributions (for example Fedora 23) don't ship it by
# default. As the resulting error is very misleading check for bignum before
@@ -67,3 +125,235 @@ do_configure_prepend() {
bbfatal "The perl module 'bignum' was not found but this is required to build openssl. Please install this module (often packaged as perl-bignum) and re-run bitbake."
fi
}
+
+do_configure () {
+ cd util
+ perl perlpath.pl ${STAGING_BINDIR_NATIVE}
+ cd ..
+ ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
+
+ os=${HOST_OS}
+ case $os in
+ linux-gnueabi |\
+ linux-gnuspe |\
+ linux-musleabi |\
+ linux-muslspe |\
+ linux-musl )
+ os=linux
+ ;;
+ *)
+ ;;
+ esac
+ target="$os-${HOST_ARCH}"
+ case $target in
+ linux-arm)
+ target=linux-armv4
+ ;;
+ linux-armeb)
+ target=linux-elf-armeb
+ ;;
+ linux-aarch64*)
+ target=linux-aarch64
+ ;;
+ linux-sh3)
+ target=debian-sh3
+ ;;
+ linux-sh4)
+ target=debian-sh4
+ ;;
+ linux-i486)
+ target=debian-i386-i486
+ ;;
+ linux-i586 | linux-viac3)
+ target=debian-i386-i586
+ ;;
+ linux-i686)
+ target=debian-i386-i686/cmov
+ ;;
+ linux-gnux32-x86_64 | linux-muslx32-x86_64 )
+ target=linux-x32
+ ;;
+ linux-gnu64-x86_64)
+ target=linux-x86_64
+ ;;
+ linux-gnun32-mips*el)
+ target=debian-mipsn32el
+ ;;
+ linux-gnun32-mips*)
+ target=debian-mipsn32
+ ;;
+ linux-mips*64*el)
+ target=debian-mips64el
+ ;;
+ linux-mips*64*)
+ target=debian-mips64
+ ;;
+ linux-mips*el)
+ target=debian-mipsel
+ ;;
+ linux-mips*)
+ target=debian-mips
+ ;;
+ linux-microblaze*|linux-nios2*|linux-gnu*ilp32**)
+ target=linux-generic32
+ ;;
+ linux-powerpc)
+ target=linux-ppc
+ ;;
+ linux-powerpc64)
+ target=linux-ppc64
+ ;;
+ linux-riscv64)
+ target=linux-generic64
+ ;;
+ linux-riscv32)
+ target=linux-generic32
+ ;;
+ linux-supersparc)
+ target=linux-sparcv8
+ ;;
+ linux-sparc)
+ target=linux-sparcv8
+ ;;
+ darwin-i386)
+ target=darwin-i386-cc
+ ;;
+ esac
+ # inject machine-specific flags
+ sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
+ useprefix=${prefix}
+ if [ "x$useprefix" = "x" ]; then
+ useprefix=/
+ fi
+ libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
+ perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target
+}
+
+do_compile_prepend_class-target () {
+ sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
+ oe_runmake depend
+ cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
+ oe_runmake CC_INFO="${cc_sanitized}"
+}
+
+do_compile () {
+ oe_runmake depend
+ oe_runmake
+}
+
+do_compile_ptest () {
+ # build dependencies for test directory too
+ export DIRS="$DIRS test"
+ oe_runmake depend
+ oe_runmake buildtest
+}
+
+do_install () {
+ # Create ${D}/${prefix} to fix parallel issues
+ mkdir -p ${D}/${prefix}/
+
+ oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install
+
+ oe_libinstall -so libcrypto ${D}${libdir}
+ oe_libinstall -so libssl ${D}${libdir}
+
+ install -d ${D}${includedir}
+ cp --dereference -R include/openssl ${D}${includedir}
+
+ install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
+ sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
+
+ oe_multilib_header openssl/opensslconf.h
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" ]; then
+ sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
+ sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
+ else
+ rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
+ fi
+
+ # Create SSL structure
+ install -d ${D}${sysconfdir}/ssl/
+ mv ${D}${libdir}/ssl/openssl.cnf \
+ ${D}${libdir}/ssl/certs \
+ ${D}${libdir}/ssl/private \
+ \
+ ${D}${sysconfdir}/ssl/
+ ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
+ ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
+ ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
+
+ # Rename man pages to prefix openssl10-*
+ for f in `find ${D}${mandir} -type f`; do
+ mv $f $(dirname $f)/openssl10-$(basename $f)
+ done
+ for f in `find ${D}${mandir} -type l`; do
+ ln_f=`readlink $f`
+ rm -f $f
+ ln -s openssl10-$ln_f $(dirname $f)/openssl10-$(basename $f)
+ done
+}
+
+do_install_ptest () {
+ cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
+
+ # Replace the path to native perl with the path to target perl
+ sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
+
+ cp Configure config e_os.h ${D}${PTEST_PATH}
+ cp -r -L include ${D}${PTEST_PATH}
+ ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
+ ln -sf ${libdir}/libssl.a ${D}${PTEST_PATH}
+ mkdir -p ${D}${PTEST_PATH}/crypto
+ cp crypto/constant_time_locl.h ${D}${PTEST_PATH}/crypto
+ cp -r certs ${D}${PTEST_PATH}
+ mkdir -p ${D}${PTEST_PATH}/apps
+ ln -sf ${libdir}/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
+ ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
+ ln -sf ${bindir}/openssl ${D}${PTEST_PATH}/apps
+ cp apps/server.pem ${D}${PTEST_PATH}/apps
+ cp apps/server2.pem ${D}${PTEST_PATH}/apps
+ mkdir -p ${D}${PTEST_PATH}/util
+ install util/opensslwrap.sh ${D}${PTEST_PATH}/util
+ install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
+ # Time stamps are relevant for "make alltests", otherwise
+ # make may try to recompile binaries. Not only must the
+ # binary files be newer than the sources, they also must
+ # be more recent than the header files in /usr/include.
+ #
+ # Using "cp -a" is not sufficient, because do_install
+ # does not preserve the original time stamps.
+ #
+ # So instead of using the original file stamps, we set
+ # the current time for all files. Binaries will get
+ # modified again later when stripping them, but that's okay.
+ touch ${D}${PTEST_PATH}
+ find ${D}${PTEST_PATH} -type f -print0 | xargs --verbose -0 touch -r ${D}${PTEST_PATH}
+
+ # exclude binary files or the package won't install
+ for d in ssltest_old v3ext x509aux; do
+ rm -rf ${D}${libdir}/${BPN}/ptest/test/$d
+ done
+
+ # Remove build host references
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}${bindir}/openssl \
+ OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
+ SSL_CERT_DIR=${libdir}/ssl/certs \
+ SSL_CERT_FILE=${libdir}/ssl/cert.pem \
+ OPENSSL_ENGINES=${libdir}/ssl/engines
+}
+
+do_install_append_class-nativesdk() {
+ mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
+ install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
+}
+
+FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
+
+BBCLASSEXTEND = "native nativesdk"
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] f2fs: fix wrong kernel message when recover fsync data on ro fs
From: Chao Yu @ 2018-07-24 2:38 UTC (permalink / raw)
To: Yunlei He, jaegeuk, linux-f2fs-devel; +Cc: zhangdianfang
In-Reply-To: <1531983434-30722-1-git-send-email-heyunlei@huawei.com>
On 2018/7/19 14:57, Yunlei He wrote:
> This patch fix wrong message info for recover fsync data
> on readonly fs.
>
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply
* Re: [linux-sunxi] Re: [PATCH 3/3] arm64: allwinner: dts: h6: add Wi-Fi support for Pine H64 model A/B
From: Chen-Yu Tsai @ 2018-07-24 2:37 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Maxime Ripard, linux-arm-kernel, devicetree, linux-kernel,
linux-sunxi
In-Reply-To: <AC678B03-19B7-4110-B333-72188CE71296@aosc.io>
On Tue, Jul 24, 2018 at 10:28 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
> 于 2018年7月24日 GMT+08:00 上午10:26:02, Chen-Yu Tsai <wens@csie.org> 写到:
>>On Tue, Jul 24, 2018 at 10:23 AM, Icenowy Zheng <icenowy@aosc.io>
>>wrote:
>>>
>>>
>>> 于 2018年7月24日 GMT+08:00 上午10:21:59, Chen-Yu Tsai <wens@csie.org> 写到:
>>>>On Tue, Jul 24, 2018 at 9:15 AM, Icenowy Zheng <icenowy@aosc.io>
>>wrote:
>>>>> The Pine H64 model A has a Wi-Fi module connector and the model B
>>has
>>>>an
>>>>> on-board RTL8723BS Wi-Fi module.
>>>>>
>>>>> Add support for them. For model A, as it's not defaultly present,
>>>>keep
>>>>> it disabled now.
>>>>
>>>>Nope. Pine64 actually has two WiFi/BT modules. And they require
>>>>different
>>>>device tree snippets for both the WiFi and BT side. This is better
>>>>resolved
>>>>with device tree overlays.
>>>>
>>>>I have both, though I've yet found time to work on them.
>>>
>>> I have also both.
>>>
>>> The skeleton here can get the Wi-Fi of both to work.
>>
>>Cool. Then I can put away my RTL module for now. :)
>
> P.S. SDIO is auto detectable, and for BCM chips, the OOB interrupt
> is only a bonus function and it can fall back to standard in-band
> interrupt (which doesn't need special binding, and is currently
> used by mainline r8723bs driver.)
Correct. With BT you'll have serdev device nodes with different
compatibles. Then you'll have to resort to overlays, and you'd probably
end up adding WiFi OOB interrupt bits as well.
So the question remaining is: should we enable the MMC part, along
with power sequencing and regulator supplies, by default? Thinking
more about it, I'm actually OK with it. The board connectors are
clearly marked as being for a WiFi+BT module. The whole space on
the board is surrounded by a box in silkscreen. Sorry for the
initial nack.
Maxime, any thoughts?
>>
>>ChenYu
>>
>>>
>>>>
>>>>ChenYu
>>>>
>>>>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>>>>> ---
>>>>> .../allwinner/sun50i-h6-pine-h64-model-b.dts | 8 +++++
>>>>> .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 29
>>>>+++++++++++++++++++
>>>>> 2 files changed, 37 insertions(+)
>>>>>
>>>>> diff --git
>>>>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> index d0fcc25efb00..d0f775613c9b 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> @@ -18,3 +18,11 @@
>>>>> };
>>>>> };
>>>>> };
>>>>> +
>>>>> +&mmc1 {
>>>>> + status = "okay";
>>>>> +};
>>>>> +
>>>>> +&wifi_pwrseq {
>>>>> + status = "okay";
>>>>> +};
>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> index a85867f8b684..75db6d4139bf 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> @@ -40,6 +40,12 @@
>>>>> gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /*
>>PL7
>>>>*/
>>>>> };
>>>>> };
>>>>> +
>>>>> + wifi_pwrseq: wifi_pwrseq {
>>>>> + compatible = "mmc-pwrseq-simple";
>>>>> + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PL2
>>*/
>>>>> + status = "disabled";
>>>>> + };
>>>>> };
>>>>>
>>>>> &mmc0 {
>>>>> @@ -50,6 +56,17 @@
>>>>> status = "okay";
>>>>> };
>>>>>
>>>>> +&mmc1 {
>>>>> + pinctrl-names = "default";
>>>>> + pinctrl-0 = <&mmc1_pins>;
>>>>> + vmmc-supply = <®_cldo2>;
>>>>> + vqmmc-supply = <®_bldo2>;
>>>>> + mmc-pwrseq = <&wifi_pwrseq>;
>>>>> + bus-width = <4>;
>>>>> + non-removable;
>>>>> + status = "disabled";
>>>>> +};
>>>>> +
>>>>> &mmc2 {
>>>>> pinctrl-names = "default";
>>>>> pinctrl-0 = <&mmc2_pins>;
>>>>> @@ -128,12 +145,24 @@
>>>>> };
>>>>>
>>>>> reg_cldo2: cldo2 {
>>>>> + /*
>>>>> + * This regulator is connected with
>>>>CLDO3.
>>>>> + * Before the kernel can support
>>>>synchronized
>>>>> + * enable of coupled regulators,
>>keep
>>>>them
>>>>> + * both always on as a ugly hack.
>>>>> + */
>>>>> + regulator-always-on;
>>>>> regulator-min-microvolt =
>><3300000>;
>>>>> regulator-max-microvolt =
>><3300000>;
>>>>> regulator-name = "vcc-wifi-1";
>>>>> };
>>>>>
>>>>> reg_cldo3: cldo3 {
>>>>> + /*
>>>>> + * This regulator is connected with
>>>>CLDO2.
>>>>> + * See the comments for CLDO2.
>>>>> + */
>>>>> + regulator-always-on;
>>>>> regulator-min-microvolt =
>><3300000>;
>>>>> regulator-max-microvolt =
>><3300000>;
>>>>> regulator-name = "vcc-wifi-2";
>>>>> --
>>>>> 2.18.0
>>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>Groups "linux-sunxi" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>send an email to linux-sunxi+unsubscribe@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply
* Re: [PATCH] input: pxrc - do not store USB device in private struct
From: Dmitry Torokhov @ 2018-07-24 2:38 UTC (permalink / raw)
To: Marcus Folkesson; +Cc: Alexey Khoroshilov, linux-input, linux-kernel
In-Reply-To: <20180716144014.6331-1-marcus.folkesson@gmail.com>
Hi Marcus,
On Mon, Jul 16, 2018 at 04:40:14PM +0200, Marcus Folkesson wrote:
> The USB device is only needed during setup, so put it back after
> initialization and do not store it in our private struct.
>
> Also, the USB device is a parent of USB interface so our driver
> model rules ensure that USB device should not disappear while
> interface device is still there.
> So not keep a refcount on the device is safe.
>
> Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---
> drivers/input/joystick/pxrc.c | 22 ++++++++++++----------
> 1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/input/joystick/pxrc.c b/drivers/input/joystick/pxrc.c
> index 07a0dbd3ced2..46a7acb747bf 100644
> --- a/drivers/input/joystick/pxrc.c
> +++ b/drivers/input/joystick/pxrc.c
...
> @@ -204,23 +204,25 @@ static int pxrc_probe(struct usb_interface *intf,
> return -ENOMEM;
>
> mutex_init(&pxrc->pm_mutex);
> - pxrc->udev = usb_get_dev(interface_to_usbdev(intf));
> + udev = usb_get_dev(interface_to_usbdev(intf));
There is really no need to "get" device for the probe duration, or in
general, when you are not storing the reference to it.
I posted series with an updated version of this patch plus couple more
cleanups/fixes, and would appreciate if you could give it a spin.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: Re: [PATCH 3/3] arm64: allwinner: dts: h6: add Wi-Fi support for Pine H64 model A/B
From: Chen-Yu Tsai @ 2018-07-24 2:37 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Maxime Ripard, linux-arm-kernel, devicetree, linux-kernel,
linux-sunxi
In-Reply-To: <AC678B03-19B7-4110-B333-72188CE71296-h8G6r0blFSE@public.gmane.org>
On Tue, Jul 24, 2018 at 10:28 AM, Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org> wrote:
>
>
> 于 2018年7月24日 GMT+08:00 上午10:26:02, Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> 写到:
>>On Tue, Jul 24, 2018 at 10:23 AM, Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
>>wrote:
>>>
>>>
>>> 于 2018年7月24日 GMT+08:00 上午10:21:59, Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> 写到:
>>>>On Tue, Jul 24, 2018 at 9:15 AM, Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
>>wrote:
>>>>> The Pine H64 model A has a Wi-Fi module connector and the model B
>>has
>>>>an
>>>>> on-board RTL8723BS Wi-Fi module.
>>>>>
>>>>> Add support for them. For model A, as it's not defaultly present,
>>>>keep
>>>>> it disabled now.
>>>>
>>>>Nope. Pine64 actually has two WiFi/BT modules. And they require
>>>>different
>>>>device tree snippets for both the WiFi and BT side. This is better
>>>>resolved
>>>>with device tree overlays.
>>>>
>>>>I have both, though I've yet found time to work on them.
>>>
>>> I have also both.
>>>
>>> The skeleton here can get the Wi-Fi of both to work.
>>
>>Cool. Then I can put away my RTL module for now. :)
>
> P.S. SDIO is auto detectable, and for BCM chips, the OOB interrupt
> is only a bonus function and it can fall back to standard in-band
> interrupt (which doesn't need special binding, and is currently
> used by mainline r8723bs driver.)
Correct. With BT you'll have serdev device nodes with different
compatibles. Then you'll have to resort to overlays, and you'd probably
end up adding WiFi OOB interrupt bits as well.
So the question remaining is: should we enable the MMC part, along
with power sequencing and regulator supplies, by default? Thinking
more about it, I'm actually OK with it. The board connectors are
clearly marked as being for a WiFi+BT module. The whole space on
the board is surrounded by a box in silkscreen. Sorry for the
initial nack.
Maxime, any thoughts?
>>
>>ChenYu
>>
>>>
>>>>
>>>>ChenYu
>>>>
>>>>> Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
>>>>> ---
>>>>> .../allwinner/sun50i-h6-pine-h64-model-b.dts | 8 +++++
>>>>> .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 29
>>>>+++++++++++++++++++
>>>>> 2 files changed, 37 insertions(+)
>>>>>
>>>>> diff --git
>>>>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> index d0fcc25efb00..d0f775613c9b 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> @@ -18,3 +18,11 @@
>>>>> };
>>>>> };
>>>>> };
>>>>> +
>>>>> +&mmc1 {
>>>>> + status = "okay";
>>>>> +};
>>>>> +
>>>>> +&wifi_pwrseq {
>>>>> + status = "okay";
>>>>> +};
>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> index a85867f8b684..75db6d4139bf 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> @@ -40,6 +40,12 @@
>>>>> gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /*
>>PL7
>>>>*/
>>>>> };
>>>>> };
>>>>> +
>>>>> + wifi_pwrseq: wifi_pwrseq {
>>>>> + compatible = "mmc-pwrseq-simple";
>>>>> + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PL2
>>*/
>>>>> + status = "disabled";
>>>>> + };
>>>>> };
>>>>>
>>>>> &mmc0 {
>>>>> @@ -50,6 +56,17 @@
>>>>> status = "okay";
>>>>> };
>>>>>
>>>>> +&mmc1 {
>>>>> + pinctrl-names = "default";
>>>>> + pinctrl-0 = <&mmc1_pins>;
>>>>> + vmmc-supply = <®_cldo2>;
>>>>> + vqmmc-supply = <®_bldo2>;
>>>>> + mmc-pwrseq = <&wifi_pwrseq>;
>>>>> + bus-width = <4>;
>>>>> + non-removable;
>>>>> + status = "disabled";
>>>>> +};
>>>>> +
>>>>> &mmc2 {
>>>>> pinctrl-names = "default";
>>>>> pinctrl-0 = <&mmc2_pins>;
>>>>> @@ -128,12 +145,24 @@
>>>>> };
>>>>>
>>>>> reg_cldo2: cldo2 {
>>>>> + /*
>>>>> + * This regulator is connected with
>>>>CLDO3.
>>>>> + * Before the kernel can support
>>>>synchronized
>>>>> + * enable of coupled regulators,
>>keep
>>>>them
>>>>> + * both always on as a ugly hack.
>>>>> + */
>>>>> + regulator-always-on;
>>>>> regulator-min-microvolt =
>><3300000>;
>>>>> regulator-max-microvolt =
>><3300000>;
>>>>> regulator-name = "vcc-wifi-1";
>>>>> };
>>>>>
>>>>> reg_cldo3: cldo3 {
>>>>> + /*
>>>>> + * This regulator is connected with
>>>>CLDO2.
>>>>> + * See the comments for CLDO2.
>>>>> + */
>>>>> + regulator-always-on;
>>>>> regulator-min-microvolt =
>><3300000>;
>>>>> regulator-max-microvolt =
>><3300000>;
>>>>> regulator-name = "vcc-wifi-2";
>>>>> --
>>>>> 2.18.0
>>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>Groups "linux-sunxi" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply
* [linux-sunxi] Re: [PATCH 3/3] arm64: allwinner: dts: h6: add Wi-Fi support for Pine H64 model A/B
From: Chen-Yu Tsai @ 2018-07-24 2:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AC678B03-19B7-4110-B333-72188CE71296@aosc.io>
On Tue, Jul 24, 2018 at 10:28 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
> ? 2018?7?24? GMT+08:00 ??10:26:02, Chen-Yu Tsai <wens@csie.org> ??:
>>On Tue, Jul 24, 2018 at 10:23 AM, Icenowy Zheng <icenowy@aosc.io>
>>wrote:
>>>
>>>
>>> ? 2018?7?24? GMT+08:00 ??10:21:59, Chen-Yu Tsai <wens@csie.org> ??:
>>>>On Tue, Jul 24, 2018 at 9:15 AM, Icenowy Zheng <icenowy@aosc.io>
>>wrote:
>>>>> The Pine H64 model A has a Wi-Fi module connector and the model B
>>has
>>>>an
>>>>> on-board RTL8723BS Wi-Fi module.
>>>>>
>>>>> Add support for them. For model A, as it's not defaultly present,
>>>>keep
>>>>> it disabled now.
>>>>
>>>>Nope. Pine64 actually has two WiFi/BT modules. And they require
>>>>different
>>>>device tree snippets for both the WiFi and BT side. This is better
>>>>resolved
>>>>with device tree overlays.
>>>>
>>>>I have both, though I've yet found time to work on them.
>>>
>>> I have also both.
>>>
>>> The skeleton here can get the Wi-Fi of both to work.
>>
>>Cool. Then I can put away my RTL module for now. :)
>
> P.S. SDIO is auto detectable, and for BCM chips, the OOB interrupt
> is only a bonus function and it can fall back to standard in-band
> interrupt (which doesn't need special binding, and is currently
> used by mainline r8723bs driver.)
Correct. With BT you'll have serdev device nodes with different
compatibles. Then you'll have to resort to overlays, and you'd probably
end up adding WiFi OOB interrupt bits as well.
So the question remaining is: should we enable the MMC part, along
with power sequencing and regulator supplies, by default? Thinking
more about it, I'm actually OK with it. The board connectors are
clearly marked as being for a WiFi+BT module. The whole space on
the board is surrounded by a box in silkscreen. Sorry for the
initial nack.
Maxime, any thoughts?
>>
>>ChenYu
>>
>>>
>>>>
>>>>ChenYu
>>>>
>>>>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>>>>> ---
>>>>> .../allwinner/sun50i-h6-pine-h64-model-b.dts | 8 +++++
>>>>> .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 29
>>>>+++++++++++++++++++
>>>>> 2 files changed, 37 insertions(+)
>>>>>
>>>>> diff --git
>>>>a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> index d0fcc25efb00..d0f775613c9b 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts
>>>>> @@ -18,3 +18,11 @@
>>>>> };
>>>>> };
>>>>> };
>>>>> +
>>>>> +&mmc1 {
>>>>> + status = "okay";
>>>>> +};
>>>>> +
>>>>> +&wifi_pwrseq {
>>>>> + status = "okay";
>>>>> +};
>>>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> index a85867f8b684..75db6d4139bf 100644
>>>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
>>>>> @@ -40,6 +40,12 @@
>>>>> gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /*
>>PL7
>>>>*/
>>>>> };
>>>>> };
>>>>> +
>>>>> + wifi_pwrseq: wifi_pwrseq {
>>>>> + compatible = "mmc-pwrseq-simple";
>>>>> + reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PL2
>>*/
>>>>> + status = "disabled";
>>>>> + };
>>>>> };
>>>>>
>>>>> &mmc0 {
>>>>> @@ -50,6 +56,17 @@
>>>>> status = "okay";
>>>>> };
>>>>>
>>>>> +&mmc1 {
>>>>> + pinctrl-names = "default";
>>>>> + pinctrl-0 = <&mmc1_pins>;
>>>>> + vmmc-supply = <®_cldo2>;
>>>>> + vqmmc-supply = <®_bldo2>;
>>>>> + mmc-pwrseq = <&wifi_pwrseq>;
>>>>> + bus-width = <4>;
>>>>> + non-removable;
>>>>> + status = "disabled";
>>>>> +};
>>>>> +
>>>>> &mmc2 {
>>>>> pinctrl-names = "default";
>>>>> pinctrl-0 = <&mmc2_pins>;
>>>>> @@ -128,12 +145,24 @@
>>>>> };
>>>>>
>>>>> reg_cldo2: cldo2 {
>>>>> + /*
>>>>> + * This regulator is connected with
>>>>CLDO3.
>>>>> + * Before the kernel can support
>>>>synchronized
>>>>> + * enable of coupled regulators,
>>keep
>>>>them
>>>>> + * both always on as a ugly hack.
>>>>> + */
>>>>> + regulator-always-on;
>>>>> regulator-min-microvolt =
>><3300000>;
>>>>> regulator-max-microvolt =
>><3300000>;
>>>>> regulator-name = "vcc-wifi-1";
>>>>> };
>>>>>
>>>>> reg_cldo3: cldo3 {
>>>>> + /*
>>>>> + * This regulator is connected with
>>>>CLDO2.
>>>>> + * See the comments for CLDO2.
>>>>> + */
>>>>> + regulator-always-on;
>>>>> regulator-min-microvolt =
>><3300000>;
>>>>> regulator-max-microvolt =
>><3300000>;
>>>>> regulator-name = "vcc-wifi-2";
>>>>> --
>>>>> 2.18.0
>>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>Groups "linux-sunxi" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>send an email to linux-sunxi+unsubscribe at googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.