mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
Normalize drivers between stage1 and 2
This commit is contained in:
parent
306555e522
commit
1aa6b92bc4
6 changed files with 46 additions and 30 deletions
7
fusee/fusee-primary/src/lib/driver_utils.h
Normal file
7
fusee/fusee-primary/src/lib/driver_utils.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef FUSEE_DRIVER_UTILS_H
|
||||
#define FUSEE_DRIVER_UTILS_H
|
||||
|
||||
#include "vsprintf.h"
|
||||
#include "printk.h"
|
||||
|
||||
#endif
|
|
@ -7,6 +7,7 @@
|
|||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib/driver_utils.h"
|
||||
#include "sdmmc.h"
|
||||
#include "car.h"
|
||||
#include "pinmux.h"
|
||||
|
@ -16,7 +17,6 @@
|
|||
#include "supplies.h"
|
||||
#include "pmc.h"
|
||||
#include "pad_control.h"
|
||||
#include "lib/printk.h"
|
||||
|
||||
#define TEGRA_SDMMC_BASE (0x700B0000)
|
||||
#define TEGRA_SDMMC_SIZE (0x200)
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* ~ktemkin
|
||||
*/
|
||||
|
||||
#include "lib/driver_utils.h"
|
||||
#include "supplies.h"
|
||||
#include "lib/printk.h"
|
||||
|
||||
// FIXME: replace hwinit with our own code
|
||||
#include "hwinit/max7762x.h"
|
||||
|
|
10
fusee/fusee-secondary/src/lib/driver_utils.h
Normal file
10
fusee/fusee-secondary/src/lib/driver_utils.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef FUSEE_DRIVER_UTILS_H
|
||||
#define FUSEE_DRIVER_UTILS_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define vprintk vprintf
|
||||
#define printk printf
|
||||
|
||||
#endif
|
|
@ -2,12 +2,11 @@
|
|||
* Fusée SD/MMC driver for the Switch
|
||||
* ~ktemkin
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib/driver_utils.h"
|
||||
#include "sdmmc.h"
|
||||
#include "car.h"
|
||||
#include "pinmux.h"
|
||||
|
@ -427,9 +426,9 @@ static void mmc_vprint(struct mmc *mmc, char *fmt, int required_loglevel, va_lis
|
|||
if (sdmmc_loglevel < required_loglevel)
|
||||
return;
|
||||
|
||||
printf("%s: ", mmc->name);
|
||||
vprintf(fmt, list);
|
||||
printf("\n");
|
||||
printk("%s: ", mmc->name);
|
||||
vprintk(fmt, list);
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -732,7 +731,7 @@ static int sdmmc_set_up_clocking_parameters(struct mmc *mmc)
|
|||
break;
|
||||
|
||||
default:
|
||||
printf("ERROR: initialization not yet writen for SDMMC%d", mmc->controller);
|
||||
printk("ERROR: initialization not yet writen for SDMMC%d", mmc->controller);
|
||||
return ENODEV;
|
||||
}
|
||||
|
||||
|
@ -1480,7 +1479,7 @@ static uint32_t sdmmc_extract_csd_bits(uint32_t *csd, int start, int width)
|
|||
|
||||
// Sanity check our span.
|
||||
if ((start + width) > 128) {
|
||||
printf("MMC ERROR: invalid CSD slice!\n");
|
||||
printk("MMC ERROR: invalid CSD slice!\n");
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
|
@ -2205,7 +2204,7 @@ static void sdmmc_initialize_defaults(struct mmc *mmc)
|
|||
break;
|
||||
|
||||
default:
|
||||
printf("ERROR: initialization not yet writen for SDMMC%d", mmc->controller);
|
||||
printk("ERROR: initialization not yet writen for SDMMC%d", mmc->controller);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* ~ktemkin
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lib/driver_utils.h"
|
||||
#include "supplies.h"
|
||||
|
||||
// FIXME: replace hwinit with our own code
|
||||
|
@ -23,7 +23,7 @@ void supply_enable(enum switch_power_supply supply)
|
|||
return;
|
||||
|
||||
default:
|
||||
printf("ERROR: could not enable unknown supply %d!\n", supply);
|
||||
printk("ERROR: could not enable unknown supply %d!\n", supply);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue