From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Paul Barker <paul.barker@sancloud.com>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v4 3/6] efi_loader: Add SPI I/O protocol support
Date: Mon, 24 Oct 2022 14:54:21 +0300 [thread overview]
Message-ID: <Y1Z87YhIsCK+dKg9@hera> (raw)
In-Reply-To: <20221005121839.3938771-4-paul.barker@sancloud.com>
Hi Paul,
I think the series overall is in a good state, but we are trying to figure
out if we can avoid defining SPI uuid's in the DT. OTOH U-Boot uses the DT
for it's config so that might be okay...
[...]
> +{
> + struct efi_spi_peripheral *peripheral = bus->peripheral_list;
> +
> + while (peripheral) {
> + struct efi_spi_peripheral *next =
> + peripheral->next_spi_peripheral;
> + destroy_efi_spi_peripheral(peripheral);
> + peripheral = next;
> + }
> + free(bus->friendly_name);
> + free(bus);
> +}
> +
> +static efi_status_t efi_spi_new_handle(const efi_guid_t *guid, void *proto)
> +{
> + efi_status_t status;
> + efi_handle_t handle;
> +
> + status = efi_create_handle(&handle);
> + if (status != EFI_SUCCESS) {
> + printf("Failed to create EFI handle\n");
> + goto fail_1;
> + }
> +
> + status = efi_add_protocol(handle, guid, proto);
Apologies for this it's my fault, but can you replace efi_add_protocol ->
efi_install_multiple_protocol_interfaces?
commit 05c4c9e21ae6 ("efi_loader: define internal implementations of install/uninstallmultiple")
has some details on why. A bit annoying but the change is straightforward
> + if (status != EFI_SUCCESS) {
> + printf("Failed to add protocol\n");
> + goto fail_2;
> + }
> +
> + return EFI_SUCCESS;
> +
> +fail_2:
> + efi_delete_handle(handle);
Same here, just uninstall the protocol
> +fail_1:
> + return status;
> +}
> +
> +static void
> +efi_spi_init_part(struct efi_spi_part *part,
> + struct spi_slave *target,
> + efi_string_t vendor_utf16,
> + efi_string_t part_number_utf16
> +)
> +{
> + part->vendor = vendor_utf16;
> + part->part_number = part_number_utf16;
> + part->min_clock_hz = 0;
> + part->max_clock_hz = target->max_hz;
> + part->chip_select_polarity =
> + (target->mode & SPI_CS_HIGH) ? true : false;
> +}
> +
Thanks!
/Ilias
next prev parent reply other threads:[~2022-10-24 11:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 12:18 [PATCH v4 0/6] Support UEFI SPI I/O protocol Paul Barker
2022-10-05 12:18 ` [PATCH v4 1/6] spi: Implement spi_set_speed Paul Barker
2022-10-06 3:15 ` Heinrich Schuchardt
2022-10-05 12:18 ` [PATCH v4 2/6] efi: Add string conversion helper Paul Barker
2022-10-06 3:26 ` Heinrich Schuchardt
2022-10-06 6:19 ` Ilias Apalodimas
2022-10-05 12:18 ` [PATCH v4 3/6] efi_loader: Add SPI I/O protocol support Paul Barker
2022-10-24 11:54 ` Ilias Apalodimas [this message]
2022-10-25 16:39 ` Paul Barker
2022-10-25 17:26 ` Tom Rini
2022-10-05 12:18 ` [PATCH v4 4/6] efi_selftest: Add tests for SPI " Paul Barker
2022-10-05 12:18 ` [PATCH v4 5/6] arm: dts: am335x-sancloud-bbe-lite: UEFI SPI export Paul Barker
2022-10-06 4:12 ` [U-Boot PATCH " Heinrich Schuchardt
2022-10-05 12:18 ` [PATCH v4 6/6] am335x_evm_defconfig: Enable Micron SPI flash support Paul Barker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y1Z87YhIsCK+dKg9@hera \
--to=ilias.apalodimas@linaro.org \
--cc=paul.barker@sancloud.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.