mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Implement iPod Nano 2G storage active indicator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23325 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
16a956c4f3
commit
49d4c428dc
2 changed files with 9 additions and 10 deletions
|
|
@ -23,7 +23,6 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "led.h"
|
|
||||||
#include "disk.h"
|
#include "disk.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
#include "panic.h"
|
#include "panic.h"
|
||||||
|
|
@ -41,11 +40,6 @@ static long nand_stack[20];
|
||||||
|
|
||||||
/* API Functions */
|
/* API Functions */
|
||||||
|
|
||||||
void nand_led(bool onoff)
|
|
||||||
{
|
|
||||||
led(onoff);
|
|
||||||
}
|
|
||||||
|
|
||||||
int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int incount,
|
int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int incount,
|
||||||
void* inbuf)
|
void* inbuf)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include <pmu-target.h>
|
#include <pmu-target.h>
|
||||||
#include <mmu-target.h>
|
#include <mmu-target.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "led.h"
|
||||||
|
|
||||||
|
|
||||||
#define NAND_CMD_READ 0x00
|
#define NAND_CMD_READ 0x00
|
||||||
|
|
@ -101,6 +102,7 @@ static uint8_t nand_ecc[0x30] __attribute__((aligned(16)));
|
||||||
|
|
||||||
uint32_t nand_unlock(uint32_t rc)
|
uint32_t nand_unlock(uint32_t rc)
|
||||||
{
|
{
|
||||||
|
led(false);
|
||||||
mutex_unlock(&nand_mtx);
|
mutex_unlock(&nand_mtx);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
@ -349,6 +351,7 @@ uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer,
|
||||||
if (sparebuffer && !((uint32_t)sparebuffer & 0xf))
|
if (sparebuffer && !((uint32_t)sparebuffer & 0xf))
|
||||||
spare = (uint8_t*)sparebuffer;
|
spare = (uint8_t*)sparebuffer;
|
||||||
mutex_lock(&nand_mtx);
|
mutex_lock(&nand_mtx);
|
||||||
|
led(true);
|
||||||
if (!nand_powered) nand_power_up();
|
if (!nand_powered) nand_power_up();
|
||||||
uint32_t rc, eccresult;
|
uint32_t rc, eccresult;
|
||||||
nand_set_fmctrl0(bank, FMCTRL0_ENABLEDMA);
|
nand_set_fmctrl0(bank, FMCTRL0_ENABLEDMA);
|
||||||
|
|
@ -405,6 +408,7 @@ uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer,
|
||||||
if (sparebuffer && !((uint32_t)sparebuffer & 0xf))
|
if (sparebuffer && !((uint32_t)sparebuffer & 0xf))
|
||||||
spare = (uint8_t*)sparebuffer;
|
spare = (uint8_t*)sparebuffer;
|
||||||
mutex_lock(&nand_mtx);
|
mutex_lock(&nand_mtx);
|
||||||
|
led(true);
|
||||||
if (!nand_powered) nand_power_up();
|
if (!nand_powered) nand_power_up();
|
||||||
if (sparebuffer)
|
if (sparebuffer)
|
||||||
{
|
{
|
||||||
|
|
@ -438,6 +442,7 @@ uint32_t nand_write_page(uint32_t bank, uint32_t page, void* databuffer,
|
||||||
uint32_t nand_block_erase(uint32_t bank, uint32_t page)
|
uint32_t nand_block_erase(uint32_t bank, uint32_t page)
|
||||||
{
|
{
|
||||||
mutex_lock(&nand_mtx);
|
mutex_lock(&nand_mtx);
|
||||||
|
led(true);
|
||||||
if (!nand_powered) nand_power_up();
|
if (!nand_powered) nand_power_up();
|
||||||
nand_set_fmctrl0(bank, 0);
|
nand_set_fmctrl0(bank, 0);
|
||||||
if (nand_send_cmd(NAND_CMD_BLOCKERASE)) return nand_unlock(1);
|
if (nand_send_cmd(NAND_CMD_BLOCKERASE)) return nand_unlock(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue