Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single firmware for both 1Gbit and 2Gbit Rev10 boards #72

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

henrygab
Copy link
Collaborator

@henrygab henrygab commented Jul 9, 2024

CMakeLists.txt

  • Remove newly added 2Gbit firmware type

nand/nand_ftl_diskio.c

  • Allow SPI NAND initialization to populate the dhara parameters dynamically

nand/spi_nand.c

  • spi_nand_init() now fills in the struct dhara_nand
  • static global page buffer is now maximum size for all supported nand chips (64 bytes extra RAM on 1Gbit Rev10) ... renamed buffer to catch and replace all uses and replace any sizeof(buffer) style length with a length calculated based on detected NAND chip.
  • Track pointer to detected chip in global variable g_Actual_Nand_Device
  • Function read_id() now fills the nand_identity_t structure, does not validate the data (now done in spi_nand_init())
  • Converted some #define symbols into macros
  • use void * instead of uint8_t * when buffer type is variable type/size
  • in spi_nand.c, rename static reset() function as spi_nand_reset() to reduce likelihood of clashing with other functions.

Other random bits

  • Rename SPI_NAND_PAGES_PER_BLOCK --> SPI_NAND_PAGES_PER_ERASE_BLOCK
  • minor formatting tweaks

#### `CMakeLists.txt`
* Remove newly added 2Gbit firmware type

#### `nand/nand_ftl_diskio.c`
* Allow SPI NAND initialization to populate the dhara parameters dynamically

#### `nand/spi_nand.c`
* `spi_nand_init()` now fills in the `struct dhara_nand`
* static global page buffer is now maximum size for all supported nand chips (64 bytes extra RAM on 1Gbit Rev10) ... renamed buffer to catch and replace all uses and replace any `sizeof(buffer)` style length with a length calculated based on detected NAND chip.
* Track pointer to detected chip in global variable `g_Actual_Nand_Device`
* Function `read_id()` now fills the `nand_identity_t` structure, does not validate the data (now done in `spi_nand_init()`)
* Converted some `#define` symbols into macros
* use `void *` instead of `uint8_t *` when buffer type is variable type/size
* in `spi_nand.c`, rename static `reset()` function as `spi_nand_reset()` to reduce likelihood of clashing with other functions.

#### Other random bits
* Rename `SPI_NAND_PAGES_PER_BLOCK` --> `SPI_NAND_PAGES_PER_ERASE_BLOCK`
* minor formatting tweaks
@DangerousPrototypes DangerousPrototypes merged commit 420aa88 into DangerousPrototypes:main Jul 9, 2024
3 checks passed
@henrygab henrygab deleted the multi_plane branch July 9, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants