Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpu: nova-core: falcon: add constant for memory block alignment

Falcon memory blocks are 256 bytes in size. This is a hard constant on
all models.

This value was hardcoded, so turn it into a documented constant. It will
also become useful with the PIO loading code.

Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260306-turing_prep-v11-2-8f0042c5d026@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>

+5 -1
+5 -1
drivers/gpu/nova-core/falcon.rs
··· 25 25 falcon::hal::LoadMethod, 26 26 gpu::Chipset, 27 27 num::{ 28 + self, 28 29 FromSafeCast, 29 30 IntoSafeCast, // 30 31 }, ··· 36 35 pub(crate) mod gsp; 37 36 mod hal; 38 37 pub(crate) mod sec2; 38 + 39 + /// Alignment (in bytes) of falcon memory blocks. 40 + pub(crate) const MEM_BLOCK_ALIGNMENT: usize = 256; 39 41 40 42 // TODO[FPRI]: Replace with `ToPrimitive`. 41 43 macro_rules! impl_from_enum_to_u8 { ··· 427 423 target_mem: FalconMem, 428 424 load_offsets: FalconLoadTarget, 429 425 ) -> Result { 430 - const DMA_LEN: u32 = 256; 426 + const DMA_LEN: u32 = num::usize_into_u32::<{ MEM_BLOCK_ALIGNMENT }>(); 431 427 432 428 // For IMEM, we want to use the start offset as a virtual address tag for each page, since 433 429 // code addresses in the firmware (and the boot vector) are virtual.