Hello,
I read the code about environment variable protection and an old
discussion: https://lists.denx.de/pipermail/u-boot/2021-April/446247.html
but I still have a question.
In env_flags_init() we have:
if (first_call) {
#ifdef CONFIG_ENV_WRITEABLE_LIST
flags_list = ENV_FLAGS_LIST_ST
Currently in _dm_gpio_set_flags() when set_flags ops is not implemented
direction_output()/_input() is used, but pull up/down is not supported by
these ops.
Signed-off-by: Zixun LI
---
We have updated our AT91 BSP to use DM, on field testing few boards
went into a failed state due to gpio pullup
Add ops get_dir_flags() to read status from GPIO registers.
Signed-off-by: Zixun LI
---
Changes in v2:
- Fix pullup read polarity
---
drivers/gpio/at91_gpio.c | 45
1 file changed, 45 insertions(+)
diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio
This patch adds support for determining whether a gpio pin is mapped as
peripheral function.
Signed-off-by: Zixun LI
---
drivers/gpio/at91_gpio.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c
index
Add ops get_dir_flags() to read status from GPIO registers.
Signed-off-by: Zixun LI
---
drivers/gpio/at91_gpio.c | 45
1 file changed, 45 insertions(+)
diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c
index 7828f9b447..c986007716 100644
Support GPIO configuration with following flags:
- in, out, out_active
- open_drain, pull_up
Signed-off-by: Zixun LI
---
drivers/gpio/at91_gpio.c | 41
1 file changed, 41 insertions(+)
diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c
Hi, sorry to bother, it seems like the patch is not picked up yet ?
Zixun
On Sun, Aug 25, 2024 at 2:13 AM Marek Vasut wrote:
>
> >
> > I am looking at the usb_add_gadget_udc_release() and
> > usb_gadget_probe_driver() and I am thinking, sigh, all that code is
> > ready to be replaced by something cleaner which does not use this
> > special struct usb_udc and udc_list, b
On Fri, Aug 23, 2024 at 4:54 AM Marek Vasut wrote:
>
> I think udc_bind_to_driver() should not call usb_gadget_connect() , that
> connect should likely be called by at some later point.
Yes it's more logical, to keep it in disconnected state you prefer modify
controllers drivers init (I can do us
On Thu, Aug 22, 2024 at 5:24 PM Marek Vasut wrote:
>
> Can you change the g_dnl_register() prototype and pass he structure in ?
> I suspect it should be available in the commands which register g_dnl ?
>
There are many places where g_dnl_register() is called, like fastboot, dfu, ums,
etc, need to
Hi,
On Thu, Aug 22, 2024 at 1:26 AM Marek Vasut wrote:
>
> Would it be possible to fix up the g_dnl ?
g_dnl's interface is pretty different from usb_ether, I can't find a
way to access
usb_gadget struct in g_dnl_register().
Meanwhile it can be fixed in udc core, by doing gadget_driver bind
afte
Hi Marek,
On Wed, Aug 21, 2024 at 11:43 PM Marek Vasut wrote:
>
> Wouldn't it be better if usb_gadget_register_driver() started in
> disconnected state right away ?
That's what I did initially. But since g_dnl doesn't do connection after
register (I explained in cover letter) doing so will keep
-110
usb usb1-port1: attempt power cycle
Disable USB pullup to prevent unwanted enumeration attempt.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/ether.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
ind
Hi Mattijs,
On Tue, Aug 13, 2024 at 10:28 AM Mattijs Korpershoek
wrote:
>
> Thank you for giving some board examples. I am still a bit unclear on
> the meaning of:
>
> """
> This breaks the capacity of using "usb" as DT alias sequence numbering
> which needs a fix afterwards.
> """
>
> I have add
Hi Mattijs,
On Wed, Aug 7, 2024 at 9:07 AM Mattijs Korpershoek
wrote:
>
>
> Have you identified boards which use the DT alias that will break
> with this patch?
>
> Maybe we can detail the required fix in the commit message a bit as well?
> Or, if you know of a board that uses "usb" as DT alias s
Hi Mattijs,
On Tue, Aug 6, 2024 at 4:00 PM Mattijs Korpershoek
wrote:
>
> I'd like to test this on my end as well. Could you please give some
> details on how this has been tested?
>
> A sequence of U-Boot commands would be helpful, for example.
My tests are done on a custom ATMEL SAM9G25 board
Currently uclass index is used for bind/unbind which ignores alias
sequence numbering. Use device sequence number instead as it's
the number explicitly set in the DT.
Also update documentation to use sequence number.
Signed-off-by: Zixun LI
---
cmd/bind.c
Currently uclass index is shown in DM tree dump which ignores alias
sequence numbering. The result could be confusing since these 2 numbers
could be different. Show device sequence number instead as it's more
meaningful.
Also update documentation to use sequence number.
Signed-off-by: Zix
ng "usb" as DT alias sequence numbering
which needs a fix afterwards.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/udc/udc-uclass.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/udc-uclass.c
b/drivers/usb/gadget/udc/udc-uclass.c
index fbe62
nse to show the seq instead of the index, but
> please update the header for the table to say 'Seq'
Will do.
> I assume no tests need updating, but please do add a note to
> doc/usage/cmd/bind.rst
Will do.
Regards,
Zixun LI
Currently both USB host uclass and USB gadget uclass are using the same
name "usb" which break uclass functions like uclass_get_by_name().
Rename the uclass to "usb_gadget" while using "usb" as sequence alias
naming to keep the alias function working.
Signed-off-
Currently uclass index is used for bind/unbind which ignores alias
sequence numbering. Use device sequence number instead as it's
the number explicitly set in the DT.
Signed-off-by: Zixun LI
---
cmd/bind.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmd/bind.c
Currently uclass index is shown in DM tree dump which ignores alias
sequence numbering. The result could be confusing since these 2 numbers
could be different. Show device sequence number instead.
Signed-off-by: Zixun LI
---
drivers/core/dump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
which is not convered by this patch set, for example in
drivers/net/sandbox.c, uclass_get_device() is used which is based on
uclass index, while in the comments it says "index - The alias index
(also DM seq number)"
Zixun LI (4):
dm: core: Add a way to specify an alt name for alias sequen
patch it's now possible
to rename these classes without break the existing alias function.
Signed-off-by: Zixun LI
---
drivers/core/device.c | 3 ++-
drivers/core/read.c | 7 ++-
drivers/core/uclass.c | 11 +--
include/dm/read.h | 9 -
include/dm/uclass.h | 2 ++
5
Bind/unbind a gadget function driver to a USB gadget device doesn't work
with class index, while using node path is ok. For example:
U-Boot> dm tree
Class Index Probed DriverName
---
root 0 [ + ] root_driv
, so the
host won't see an unresponsive device.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/ether.c | 15 +--
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index b7b7bacb00..ed55f12662 100644
--- a/
On Thu, Jul 25, 2024 at 8:24 PM Marek Vasut wrote:
>
> On 7/25/24 5:31 PM, Zixun LI wrote:
> > Changes in v4:
> > - Release clocks if probe failed
> > - Add missing endpoint data free
> > - Addressed comments
>
> Please collect any AB/RB/TB tags that were pr
e included
(sorted as Linux driver)
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 144
drivers/usb/gadget/atmel_usba_udc.h | 3 +
include/linux/usb/atmel_usba_udc.h | 2 +
3 files changed, 149 insertions(+)
diff --git a/drivers/usb/gadget/atmel_usb
Add controller attach/detach support by using
usb_gadget_ops.pullup() function.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
Rename atmel_usba_start() / atmel_usba_stop() to usba_udc_enable()
/ usba_udc_disable(), remove atmel_ prefix to be inline with other
functions. Also avoid confusion with DM start() / stop() functions.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 8
1 file changed
To make all static functions in the top, no functional change.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 80 ++---
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget
Replace "paramter" by "parameter".
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index 4641638412..2e3d8f36a2
To have a uniform printing function, also drop linux/printk.h as no
longer used.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget
Sort includes in alphabetical order.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index f99553df8d..5f78251fdb 100644
--- a
unbinding
- Separate code refactor into 2 parts
- Remove dead code
Changes in v1:
- Based on [PATCH RFC] usb: gadget: atmel: Add DM_USB_GADGET support:
https://lists.denx.de/pipermail/u-boot/2024-July/559503.html
- Addressed comments, moved the refactoring to a preparatory patch.
Zixun LI (7
> -Original Message-
> From: Zixun Li
> Sent: Monday, July 22, 2024 17:53
> To: 'Marek Vasut' ; Lukasz Majewski ;
> open list ; Mattijs Korpershoek
>
> Subject: RE: usb gadget driver initialization issue
>
> Hi, this issue only affects usb_ether,
e included
(sorted as Linux driver)
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 138
drivers/usb/gadget/atmel_usba_udc.h | 3 +
include/linux/usb/atmel_usba_udc.h | 2 +
3 files changed, 143 insertions(+)
diff --git a/drivers/usb/gadget/atmel_usb
Add controller attach/detach support by using
usb_gadget_ops.pullup() method.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index
Rename atmel_usba_start() / atmel_usba_stop() to usba_udc_enable()
/ usba_udc_disable(), remove atmel_ prefix to be inline with other
functions. Also avoid confusion with DM start() / stop() functions.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 8
1 file changed
To make all static functions in the top, no functional change.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 80 ++---
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget
To have a uniform printing function, also drop linux/printk.h as no
longer used.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget
Replace "paramter" by "parameter".
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index 83fdc36870..2e3d8f36a2 1006
Sort includes in alphabetical order.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index f99553df8d..5f78251fdb 100644
--- a
] usb: gadget: atmel: Add DM_USB_GADGET support:
https://lists.denx.de/pipermail/u-boot/2024-July/559503.html
- Addressed comments, moved the refactoring to a preparatory patch.
Zixun LI (7):
usb: gadget: atmel: Sort includes
usb: gadget: atmel: Replace printf() and pr_err() by log_err()
usb
when DM_USB_GADGET is enabled.
Disable legacy usba_udc_probe() to avoid conflict with DM when it's
enabled.
Compared to Linux driver only supported devices' DT bindings are included
(sorted as Linux driver)
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_u
- Rename atmel_usba_start() / atmel_usba_stop() to usba_udc_enable()
/ usba_udc_disable(), remove atmel_ prefix to be inline with other
functions. Also avoid confusion with DM start() / stop() functions.
- Replace printf() by log_err()
- Spelling paramter -> parameter
Signed-off-by: Zixun
- Sort includes
- Forward declare controller structures
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 59 +++--
1 file changed, 30 insertions(+), 29 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
Add controller attach/detach support by using
usb_gadget_ops.pullup() method.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index
the refactoring to a preparatory patch.
Zixun LI (4):
usb: gadget: atmel: Code refactor part 1
usb: gadget: atmel: Code refactor part 2
usb: gadget: atmel: Add attach/detach support
usb: gadget: atmel: Add DM_USB_GADGET support
drivers/usb/gadget/atmel_usba_udc.c | 214
> -Original Message-
> From: Marek Vasut
> Sent: Saturday, July 20, 2024 22:12
>
> Can you please send an RFC patch ?
>
> > I see recently there are many DM related reworking, please forgive me
> > if it's already on the Todo list.
>
> It is not on the ToDo list, no.
>
> +CC Mattijs
H
ds and chip->ecc_step_ds became
nanddev_get_ecc_requirements(). U-Boot didn't follow the refactor and
always use these 2 fields.
v2: Fix formatting, add upstream commit hash.
Signed-off-by: Zixun LI
---
drivers/mtd/nand/raw/atmel/nand-controller.c | 4
1 file changed, 4 insertions(+)
diff
usb1-port1: attempt power cycle
I think it's better to leave the device in disconnected state while
probing and connect it once a gadget function is invoked.
I see recently there are many DM related reworking, please forgive me
if it's already on the Todo list.
--
Zixun LI
included
as they are not supported by the driver yet.
Signed-off-by: Zixun LI
---
drivers/usb/gadget/atmel_usba_udc.c | 196
1 file changed, 169 insertions(+), 27 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index
for the format issue. Is there any comment from maintainers ?
I'll push a v2 if this patch is considered.
--
Zixun LI
When ECC parameters are not specified in DT, first try ONFI ECC parameters
before fallback to maximum strength. To be inline with kernel driver behavior.
Signed-off-by: Zixun LI
---
drivers/mtd/nand/raw/atmel/nand-controller.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/mtd
If the device attached to the MMC bus is not removable, set force card-detect
bit to bypass card detection procedure, so card detection pin can be used for
other purposes.
It's also a workaround for SAMA5D2 who doesn't drive CMD if using GPIO for card
detection.
Signed-off-by
Signed-off-by: Zixun LI
---
drivers/mmc/atmel_sdhci.c | 40 +--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c
index 37b0beeed4..ae56266f57 100644
--- a/drivers/mmc/atmel_sdhci.c
+++ b
IO line.
https://github.com/linux4sam/linux-at91/blob/068eaa6b4b087b3a86fc4624d0f4083844e93f1c/drivers/mmc/host/sdhci-of-at91.c#L551
I've refactored the code, setting FCD bit after sdhci_probe() with a separate
function to make the purpose more clear.
From 90177e7af8226b88dfbfc08639f768881562a
Hi,
> Can you find some place to set this bit in the atmel sdhci driver, and not in
> the core?
> The MC1R register is specific to at91 device.
I've overridden get_cd of the driver, below is the patch:
From e186af71297e9ae6ce241a85bff64683949f0e1b Mon Sep 17 00:00:00 2001
From:
Hardware: SAMA5D27 customized board, EMMC connected to SDMMC0. SDMMC0_CD pin
pulled-down for BootROM card detection, once booted it used as LED output.
Software: u-boot-at91 76f7f55
Issue:
U-Boot can't detect EMMC despite it set to non-removable in DT, unless
SDMMC0_CD pin is used (so this pin
61 matches
Mail list logo