Skip to content

Commit 674a1f9

Browse files
Merge pull request #400 from trabucayre/buildroot_refresh
Refresh buildroot / adapt from litex_hw_ci
2 parents b30b2be + d97ae0f commit 674a1f9

24 files changed

+6814
-12
lines changed

buildroot/configs/litex_vexriscv_defconfig

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BR2_RISCV_ABI_ILP32=y
2222
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_LITEX_VEXRISCV_PATH)/patches"
2323

2424
# GCC
25-
BR2_GCC_VERSION_11_X=y
25+
BR2_GCC_VERSION_13_X=y
2626

2727
# System
2828
BR2_TARGET_GENERIC_GETTY=y
@@ -35,13 +35,12 @@ BR2_TARGET_ROOTFS_CPIO=y
3535
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_LITEX_VEXRISCV_PATH)/board/litex_vexriscv/post-image.sh"
3636

3737
# Kernel header version
38-
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y
38+
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_9=y
3939

40-
# Kernel (litex-rebase branch)
40+
# Kernel (mainline + patches set)
4141
BR2_LINUX_KERNEL=y
42-
BR2_LINUX_KERNEL_CUSTOM_GIT=y
43-
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Dolu1990/litex-linux.git"
44-
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="ae80e67c6b48bbedcd13db753237a25b3dec8301"
42+
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
43+
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.9"
4544
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
4645
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_LITEX_VEXRISCV_PATH)/board/litex_vexriscv/linux.config"
4746
BR2_LINUX_KERNEL_IMAGE=y

buildroot/configs/litex_vexriscv_usbhost_defconfig

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BR2_RISCV_ABI_ILP32=y
2222
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_LITEX_VEXRISCV_PATH)/patches"
2323

2424
# GCC
25-
BR2_GCC_VERSION_11_X=y
25+
BR2_GCC_VERSION_13_X=y
2626

2727
# System
2828
BR2_TARGET_GENERIC_GETTY=y
@@ -35,13 +35,12 @@ BR2_TARGET_ROOTFS_CPIO=y
3535
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_LITEX_VEXRISCV_PATH)/board/litex_vexriscv/post-image.sh"
3636

3737
# Kernel header version
38-
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y
38+
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_9=y
3939

40-
# Kernel (litex-rebase branch)
40+
# Kernel (mainline + patches set)
4141
BR2_LINUX_KERNEL=y
42-
BR2_LINUX_KERNEL_CUSTOM_GIT=y
43-
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Dolu1990/litex-linux.git"
44-
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="ae80e67c6b48bbedcd13db753237a25b3dec8301"
42+
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
43+
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.9"
4544
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
4645
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_LITEX_VEXRISCV_PATH)/board/litex_vexriscv_usbhost/linux.config"
4746
BR2_LINUX_KERNEL_IMAGE=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
From f803101a8081466b71cf24df45675f79839bc06e Mon Sep 17 00:00:00 2001
2+
From: Antony Pavlov <[email protected]>
3+
Date: Wed, 25 Aug 2021 17:36:39 -0400
4+
Subject: [PATCH 01/19] LiteX: LiteEth: add polling support
5+
6+
Signed-off-by: Antony Pavlov <[email protected]>
7+
Signed-off-by: Gabriel Somlo <[email protected]>
8+
---
9+
drivers/net/ethernet/litex/litex_liteeth.c | 41 ++++++++++++++++++----
10+
1 file changed, 34 insertions(+), 7 deletions(-)
11+
12+
diff --git a/drivers/net/ethernet/litex/litex_liteeth.c b/drivers/net/ethernet/litex/litex_liteeth.c
13+
index ff54fbe41bcc..de2c83c1ecfe 100644
14+
--- a/drivers/net/ethernet/litex/litex_liteeth.c
15+
+++ b/drivers/net/ethernet/litex/litex_liteeth.c
16+
@@ -8,6 +8,7 @@
17+
18+
#include <linux/etherdevice.h>
19+
#include <linux/interrupt.h>
20+
+#include <linux/iopoll.h>
21+
#include <linux/litex.h>
22+
#include <linux/module.h>
23+
#include <linux/of_net.h>
24+
@@ -43,6 +44,10 @@ struct liteeth {
25+
struct device *dev;
26+
u32 slot_size;
27+
28+
+ /* Polling support */
29+
+ int use_polling;
30+
+ struct timer_list poll_timer;
31+
+
32+
/* Tx */
33+
u32 tx_slot;
34+
u32 num_tx_slots;
35+
@@ -111,6 +116,14 @@ static irqreturn_t liteeth_interrupt(int irq, void *dev_id)
36+
return IRQ_HANDLED;
37+
}
38+
39+
+static void liteeth_timeout(struct timer_list *t)
40+
+{
41+
+ struct liteeth *priv = from_timer(priv, t, poll_timer);
42+
+
43+
+ liteeth_interrupt(0, priv->netdev);
44+
+ mod_timer(&priv->poll_timer, jiffies + msecs_to_jiffies(10));
45+
+}
46+
+
47+
static int liteeth_open(struct net_device *netdev)
48+
{
49+
struct liteeth *priv = netdev_priv(netdev);
50+
@@ -120,10 +133,16 @@ static int liteeth_open(struct net_device *netdev)
51+
litex_write8(priv->base + LITEETH_WRITER_EV_PENDING, 1);
52+
litex_write8(priv->base + LITEETH_READER_EV_PENDING, 1);
53+
54+
- err = request_irq(netdev->irq, liteeth_interrupt, 0, netdev->name, netdev);
55+
- if (err) {
56+
- netdev_err(netdev, "failed to request irq %d\n", netdev->irq);
57+
- return err;
58+
+ if (priv->use_polling) {
59+
+ timer_setup(&priv->poll_timer, liteeth_timeout, 0);
60+
+ mod_timer(&priv->poll_timer, jiffies + msecs_to_jiffies(50));
61+
+ } else {
62+
+ err = request_irq(netdev->irq, liteeth_interrupt, 0, netdev->name, netdev);
63+
+ if (err) {
64+
+ netdev_err(netdev, "failed to request irq %d\n", netdev->irq);
65+
+ return err;
66+
+ }
67+
+
68+
}
69+
70+
/* Enable IRQs */
71+
@@ -146,7 +165,11 @@ static int liteeth_stop(struct net_device *netdev)
72+
litex_write8(priv->base + LITEETH_WRITER_EV_ENABLE, 0);
73+
litex_write8(priv->base + LITEETH_READER_EV_ENABLE, 0);
74+
75+
- free_irq(netdev->irq, netdev);
76+
+ if (priv->use_polling) {
77+
+ del_timer_sync(&priv->poll_timer);
78+
+ } else {
79+
+ free_irq(netdev->irq, netdev);
80+
+ }
81+
82+
return 0;
83+
}
84+
@@ -253,9 +276,13 @@ static int liteeth_probe(struct platform_device *pdev)
85+
if (!netdev->tstats)
86+
return -ENOMEM;
87+
88+
+ priv->use_polling = 0;
89+
irq = platform_get_irq(pdev, 0);
90+
- if (irq < 0)
91+
- return irq;
92+
+ if (irq < 0) {
93+
+ dev_err(&pdev->dev, "Failed to get IRQ, using polling\n");
94+
+ priv->use_polling = 1;
95+
+ irq = 0;
96+
+ }
97+
netdev->irq = irq;
98+
99+
priv->base = devm_platform_ioremap_resource_byname(pdev, "mac");
100+
--
101+
2.43.0
102+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From e4912261137f29a582455989e329b8a7ee35bf80 Mon Sep 17 00:00:00 2001
2+
From: Gabriel Somlo <[email protected]>
3+
Date: Wed, 8 Dec 2021 07:43:45 -0500
4+
Subject: [PATCH 02/19] LiteSDCard: re-introduce gpio-based card detection
5+
6+
This is untested, and therefore unsuitable for upstreaming at this
7+
time. We need an example configuration in Doc/dt/bindings/mmc/litex*
8+
and a successful `tested-by` on hardware before we should consider
9+
pushing this into upstream linux.
10+
11+
Signed-off-by: Gabriel Somlo <[email protected]>
12+
---
13+
drivers/mmc/host/litex_mmc.c | 11 ++++++++++-
14+
1 file changed, 10 insertions(+), 1 deletion(-)
15+
16+
diff --git a/drivers/mmc/host/litex_mmc.c b/drivers/mmc/host/litex_mmc.c
17+
index 4ec8072dc60b..960a19ce7d4b 100644
18+
--- a/drivers/mmc/host/litex_mmc.c
19+
+++ b/drivers/mmc/host/litex_mmc.c
20+
@@ -23,6 +23,7 @@
21+
#include <linux/mmc/host.h>
22+
#include <linux/mmc/mmc.h>
23+
#include <linux/mmc/sd.h>
24+
+#include <linux/mmc/slot-gpio.h>
25+
26+
#define LITEX_PHY_CARDDETECT 0x00
27+
#define LITEX_PHY_CLOCKERDIV 0x04
28+
@@ -240,7 +241,15 @@ static int litex_mmc_get_cd(struct mmc_host *mmc)
29+
if (!mmc_card_is_removable(mmc))
30+
return 1;
31+
32+
- ret = !litex_read8(host->sdphy + LITEX_PHY_CARDDETECT);
33+
+ ret = mmc_gpio_get_cd(mmc);
34+
+ if (ret >= 0) {
35+
+ /* GPIO based card-detect explicitly specified in DTS */
36+
+ ret = !!ret;
37+
+ } else {
38+
+ /* Use gateware card-detect bit by default */
39+
+ ret = !litex_read8(host->sdphy + LITEX_PHY_CARDDETECT);
40+
+ }
41+
+
42+
if (ret)
43+
return ret;
44+
45+
--
46+
2.43.0
47+

0 commit comments

Comments
 (0)