[stage2] Remove printk, introduce UTF-8 console stdio

This commit is contained in:
TuxSH
2018-05-05 23:55:40 +02:00
parent 02217bde55
commit 8648cac77b
15 changed files with 246 additions and 149 deletions

View File

@@ -1,12 +1,12 @@
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include "gpio.h"
#include "lib/printk.h"
enum tegra_gpio_shifts {
GPIO_BANK_SHIFT = 5,
GPIO_BANK_SHIFT = 5,
GPIO_PORT_SHIFT = 3,
};
@@ -56,7 +56,7 @@ static volatile uint32_t gpio_get_mask(enum tegra_named_gpio pin)
*
* @param pin The GPIO pin to work with, as created with TEGRA_GPIO, or a named GPIO.
* @param should_be_set True iff the relevant bit should be set; or false if it should be cleared.
* @param offset The offset into a gpio_bank structure
* @param offset The offset into a gpio_bank structure
*/
static void gpio_simple_register_set(enum tegra_named_gpio pin, bool should_be_set, size_t offset)
{
@@ -83,7 +83,7 @@ static void gpio_simple_register_set(enum tegra_named_gpio pin, bool should_be_s
*
* @param pin The GPIO pin to work with, as created with TEGRA_GPIO, or a named GPIO.
* @param should_be_set True iff the relevant bit should be set; or false if it should be cleared.
* @param offset The offset into a gpio_bank structure
* @param offset The offset into a gpio_bank structure
*/
static bool gpio_simple_register_get(enum tegra_named_gpio pin, size_t offset)
{
@@ -121,7 +121,7 @@ void gpio_configure_mode(enum tegra_named_gpio pin, enum tegra_gpio_mode mode)
*/
void gpio_configure_direction(enum tegra_named_gpio pin, enum tegra_gpio_direction dir)
{
gpio_simple_register_set(pin, dir == GPIO_DIRECTION_OUTPUT, offsetof(struct tegra_gpio_bank, direction));
gpio_simple_register_set(pin, dir == GPIO_DIRECTION_OUTPUT, offsetof(struct tegra_gpio_bank, direction));
}
@@ -133,7 +133,7 @@ void gpio_configure_direction(enum tegra_named_gpio pin, enum tegra_gpio_directi
*/
void gpio_write(enum tegra_named_gpio pin, enum tegra_gpio_value value)
{
gpio_simple_register_set(pin, value == GPIO_LEVEL_HIGH, offsetof(struct tegra_gpio_bank, out));
gpio_simple_register_set(pin, value == GPIO_LEVEL_HIGH, offsetof(struct tegra_gpio_bank, out));
}
@@ -145,5 +145,5 @@ void gpio_write(enum tegra_named_gpio pin, enum tegra_gpio_value value)
*/
enum tegra_gpio_value gpio_read(enum tegra_named_gpio pin)
{
return gpio_simple_register_get(pin, offsetof(struct tegra_gpio_bank, in));
return gpio_simple_register_get(pin, offsetof(struct tegra_gpio_bank, in));
}