The bulk of it is Samuel's DM_I2C rework, which removes the nasty I2C deprecation warnings for most 32-bit boards. It also includes some smaller refactorings that pave the way for more changes, mostly driven by needing to support the Allwinner RISC-V SoC later on. Board wise we gain support for the FriendlyARM NanoPi R1S H5 router board and official Pinetab support. Build-tested for all 160 sunxi boards, and boot tested on a A64, A20, H3, H6, and H616 board. USB, SD card, eMMC, and Ethernet all work there (where applicable).
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
#ifndef _AXP_PMIC_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef CONFIG_AXP152_POWER
|
||||
#include <axp152.h>
|
||||
#endif
|
||||
@@ -25,6 +27,16 @@
|
||||
#include <axp818.h>
|
||||
#endif
|
||||
|
||||
#define AXP_PMIC_MODE_REG 0x3e
|
||||
#define AXP_PMIC_MODE_I2C 0x00
|
||||
#define AXP_PMIC_MODE_P2WI 0x3e
|
||||
#define AXP_PMIC_MODE_RSB 0x7c
|
||||
|
||||
#define AXP_PMIC_PRI_DEVICE_ADDR 0x3a3
|
||||
#define AXP_PMIC_PRI_RUNTIME_ADDR 0x2d
|
||||
#define AXP_PMIC_SEC_DEVICE_ADDR 0x745
|
||||
#define AXP_PMIC_SEC_RUNTIME_ADDR 0x3a
|
||||
|
||||
int axp_set_dcdc1(unsigned int mvolt);
|
||||
int axp_set_dcdc2(unsigned int mvolt);
|
||||
int axp_set_dcdc3(unsigned int mvolt);
|
||||
|
||||
98
include/clk/sunxi.h
Normal file
98
include/clk/sunxi.h
Normal file
@@ -0,0 +1,98 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2018 Amarula Solutions.
|
||||
* Author: Jagan Teki <jagan@amarulasolutions.com>
|
||||
*/
|
||||
|
||||
#ifndef _CLK_SUNXI_H
|
||||
#define _CLK_SUNXI_H
|
||||
|
||||
#include <linux/bitops.h>
|
||||
|
||||
/**
|
||||
* enum ccu_flags - ccu clock/reset flags
|
||||
*
|
||||
* @CCU_CLK_F_IS_VALID: is given clock gate is valid?
|
||||
* @CCU_RST_F_IS_VALID: is given reset control is valid?
|
||||
*/
|
||||
enum ccu_flags {
|
||||
CCU_CLK_F_IS_VALID = BIT(0),
|
||||
CCU_RST_F_IS_VALID = BIT(1),
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ccu_clk_gate - ccu clock gate
|
||||
* @off: gate offset
|
||||
* @bit: gate bit
|
||||
* @flags: ccu clock gate flags
|
||||
*/
|
||||
struct ccu_clk_gate {
|
||||
u16 off;
|
||||
u32 bit;
|
||||
enum ccu_flags flags;
|
||||
};
|
||||
|
||||
#define GATE(_off, _bit) { \
|
||||
.off = _off, \
|
||||
.bit = _bit, \
|
||||
.flags = CCU_CLK_F_IS_VALID, \
|
||||
}
|
||||
|
||||
/**
|
||||
* struct ccu_reset - ccu reset
|
||||
* @off: reset offset
|
||||
* @bit: reset bit
|
||||
* @flags: ccu reset control flags
|
||||
*/
|
||||
struct ccu_reset {
|
||||
u16 off;
|
||||
u32 bit;
|
||||
enum ccu_flags flags;
|
||||
};
|
||||
|
||||
#define RESET(_off, _bit) { \
|
||||
.off = _off, \
|
||||
.bit = _bit, \
|
||||
.flags = CCU_RST_F_IS_VALID, \
|
||||
}
|
||||
|
||||
/**
|
||||
* struct ccu_desc - clock control unit descriptor
|
||||
*
|
||||
* @gates: clock gates
|
||||
* @resets: reset unit
|
||||
*/
|
||||
struct ccu_desc {
|
||||
const struct ccu_clk_gate *gates;
|
||||
const struct ccu_reset *resets;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ccu_priv - sunxi clock control unit
|
||||
*
|
||||
* @base: base address
|
||||
* @desc: ccu descriptor
|
||||
*/
|
||||
struct ccu_priv {
|
||||
void *base;
|
||||
const struct ccu_desc *desc;
|
||||
};
|
||||
|
||||
/**
|
||||
* sunxi_clk_probe - common sunxi clock probe
|
||||
* @dev: clock device
|
||||
*/
|
||||
int sunxi_clk_probe(struct udevice *dev);
|
||||
|
||||
extern struct clk_ops sunxi_clk_ops;
|
||||
|
||||
/**
|
||||
* sunxi_reset_bind() - reset binding
|
||||
*
|
||||
* @dev: reset device
|
||||
* @count: reset count
|
||||
* @return 0 success, or error value
|
||||
*/
|
||||
int sunxi_reset_bind(struct udevice *dev, ulong count);
|
||||
|
||||
#endif /* _CLK_SUNXI_H */
|
||||
@@ -160,23 +160,6 @@
|
||||
#define CONFIG_SPL_PAD_TO 32768 /* decimal for 'dd' */
|
||||
#endif
|
||||
|
||||
|
||||
/* I2C */
|
||||
#if defined(CONFIG_VIDEO_LCD_PANEL_I2C)
|
||||
/* We use pin names in Kconfig and sunxi_name_to_gpio() */
|
||||
#define CONFIG_SOFT_I2C_GPIO_SDA soft_i2c_gpio_sda
|
||||
#define CONFIG_SOFT_I2C_GPIO_SCL soft_i2c_gpio_scl
|
||||
#ifndef __ASSEMBLY__
|
||||
extern int soft_i2c_gpio_sda;
|
||||
extern int soft_i2c_gpio_scl;
|
||||
#endif
|
||||
#define CONFIG_VIDEO_LCD_I2C_BUS 0 /* The lcd panel soft i2c is bus 0 */
|
||||
#define CONFIG_SYS_SPD_BUS_NUM 1 /* And the axp209 i2c bus is bus 1 */
|
||||
#else
|
||||
#define CONFIG_SYS_SPD_BUS_NUM 0 /* The axp209 i2c bus is bus 0 */
|
||||
#define CONFIG_VIDEO_LCD_I2C_BUS -1 /* NA, but necessary to compile */
|
||||
#endif
|
||||
|
||||
/* Ethernet support */
|
||||
|
||||
#ifdef CONFIG_USB_EHCI_HCD
|
||||
|
||||
Reference in New Issue
Block a user