[Nouveau] MediaWriter & Nouveau

2016-11-02 Thread poma
Pan Bříza, to se stane, když Custom image - Pick a file from your drives(s) ... nouveau :02:00.0: fifo: DMA_PUSHER - ch 5 [mediawriter[20975]] get 0020171c34 put 00201746ec ib_get 0017 ib_put 0018 state 8000a32c (err: INVALID_CMD) push 00406040 nouveau :02:00.0: gr: DATA_ERROR

[Nouveau] [PATCH v3 02/15] core: add falcon library

2016-11-02 Thread Alexandre Courbot
Some falcon functionality, like loading code/data into IMEM/DMEM, is re-implemented in various parts of the driver. Create a small falcon library that will contain most common operations in order to avoid duplicate code. For now this library contains various defines that are used in secure boot

[Nouveau] [PATCH v3 15/15] secboot: safer zeroing of BL descriptors

2016-11-02 Thread Alexandre Courbot
Perform the zeroing of BL descriptors in the caller function instead of trusting each generator will do it. This could avoid a few pulled hairs. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 4 ++--

[Nouveau] [PATCH v3 04/15] secboot: rename init() hook to oneinit()

2016-11-02 Thread Alexandre Courbot
The init() hook is called by the subdev's oneinit(). Rename it accordingly to avoid confusion about the lifetime of objects allocated in it. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/base.c | 4 ++-- drm/nouveau/nvkm/subdev/secboot/gm200.c | 4

[Nouveau] [PATCH v3 09/15] secboot: add LS flags to LS func structure

2016-11-02 Thread Alexandre Courbot
Add a flag that can be set when declaring how a LS firmware should be loaded. This allows us to remove falcon-specific code in the loader. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 9 -

[Nouveau] [PATCH v3 03/15] secboot: use falcon library's IMEM/DMEM loading functions

2016-11-02 Thread Alexandre Courbot
Replace the falcon loading functions with calls to the equivalent functions of the falcon library. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/gm200.c | 31 +-- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git

[Nouveau] [PATCH v3 00/15] Secure Boot refactoring

2016-11-02 Thread Alexandre Courbot
This is a rework of the secure boot code that moves the building of the blob into its own set of source files (and own hooks), making the code more flexible and (hopefully) easier to understand as well. This rework is needed to support more signed firmware for existing and new chips. Since the

[Nouveau] [PATCH v3 14/15] secboot: abstract LS firmware loading functions

2016-11-02 Thread Alexandre Courbot
The WPR and LSB headers, used to generate the LS blob, may have a different layout and sizes depending on the driver version they come from. Abstract them and confine their use to driver-specific code. Signed-off-by: Alexandre Courbot ---

[Nouveau] [PATCH v3 10/15] secboot: split reset function

2016-11-02 Thread Alexandre Courbot
Split the reset function into more meaningful and reusable ones. Signed-off-by: Alexandre Courbot --- drm/nouveau/include/nvkm/subdev/secboot.h | 3 ++ drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 78 -- 2 files changed, 56 insertions(+), 25

[Nouveau] [PATCH v3 13/15] secboot: remove ls_ucode_mgr

2016-11-02 Thread Alexandre Courbot
This was used only locally to one function and can be replaced by ad-hoc variables. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 90 +++--- 1 file changed, 33 insertions(+), 57 deletions(-) diff --git

[Nouveau] [PATCH v3 05/15] secboot: remove fixup_hs_desc hook

2016-11-02 Thread Alexandre Courbot
This hook can be removed if the function writing the HS descriptor is aware of WPR settings. Let's do that as it allows us to make the ACR descriptor structure private and save some code. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/gm200.c | 95

[Nouveau] [PATCH v3 12/15] secboot: remove unneeded ls_ucode_img member

2016-11-02 Thread Alexandre Courbot
ucode_header is not used anywhere, so just get rid of it. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/acr_r352.c| 25 +++-- drm/nouveau/nvkm/subdev/secboot/ls_ucode.h| 2 -- drm/nouveau/nvkm/subdev/secboot/ls_ucode_gr.c

[Nouveau] [PATCH v3 06/15] secboot: add low-secure firmware hooks

2016-11-02 Thread Alexandre Courbot
Secure firmwares provided by NVIDIA will follow the same overall principle, but may slightly differ in format, or not use the same bootloader descriptor even on the same chip. In order to handle this as gracefully as possible, turn the LS firmware functions into hooks that can be overloaded as

[Nouveau] [PATCH v3 07/15] secboot: generate HS BL descriptor in hook

2016-11-02 Thread Alexandre Courbot
Use the HS hook to completely generate the HS BL descriptor, similarly to what is done in the LS hook, instead of (arbitrarily) using the acr_v1 format as an intermediate. This allows us to make the bootloader descriptor structures private to each implementation, resulting in a cleaner an more

[Nouveau] [PATCH v3 01/15] core: constify nv*_printk macros

2016-11-02 Thread Alexandre Courbot
Constify the local variables declared in these macros so we can pass const pointers to them. Signed-off-by: Alexandre Courbot --- drm/nouveau/include/nvkm/core/client.h | 4 ++-- drm/nouveau/include/nvkm/core/device.h | 2 +- drm/nouveau/include/nvkm/core/subdev.h | 2 +- 3

[Nouveau] [PATCH v3 11/15] secboot: disable falcon interrupts before running

2016-11-02 Thread Alexandre Courbot
Make sure we are not disturbed by spurious interrupts, as we poll the halt bit anyway. Signed-off-by: Alexandre Courbot --- drm/nouveau/nvkm/subdev/secboot/gm200.c | 4 1 file changed, 4 insertions(+) diff --git a/drm/nouveau/nvkm/subdev/secboot/gm200.c

Re: [Nouveau] [PATCH] gr: fallback to legacy paths during firmware lookup

2016-11-02 Thread Alexandre Courbot
On 11/02/2016 02:07 PM, Ilia Mirkin wrote: > On Wed, Nov 2, 2016 at 12:54 AM, Alexandre Courbot > wrote: >> Look for firmware files using the legacy ("nouveau/nvxx_fuc") path >> if they cannot be found in the new, "official" path. User setups were >> broken by the