add flash/nor/core.[ch]
The newly moved flash TCL routines access the internals of the module too much. Fix the layering issues by adding new core NOR flash APIs: <flash/nor/core.h>: - flash_driver_find_by_name() - self-descriptive <flash/nor/imp.h>: - flash_bank_add() - encapsulates adding banks to bank list - flash_bank_list() - encapsulates retreiving bank list This allows the externs in flash/nor/imp.h to be removed, and these mechanisms may now be re-used by other flash module code.
This commit is contained in:
@@ -19,9 +19,18 @@
|
||||
#ifndef FLASH_NOR_IMP_H
|
||||
#define FLASH_NOR_IMP_H
|
||||
|
||||
#include <flash/flash.h>
|
||||
// this is an internal header
|
||||
#include "core.h"
|
||||
|
||||
extern struct flash_driver *flash_drivers[];
|
||||
extern struct flash_bank *flash_banks;
|
||||
/**
|
||||
* Adds a new NOR bank to the global list of banks.
|
||||
* @params bank The bank that should be added.
|
||||
*/
|
||||
void flash_bank_add(struct flash_bank *bank);
|
||||
|
||||
/**
|
||||
* @return The first bank in the global list.
|
||||
*/
|
||||
struct flash_bank *flash_bank_list(void);
|
||||
|
||||
#endif // FLASH_NOR_IMP_H
|
||||
|
||||
Reference in New Issue
Block a user