2015-09-21 15:27:39 +00:00
|
|
|
/*
|
2016-07-22 04:38:32 +00:00
|
|
|
* Copyright (C) 2015-2016 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
2015-09-21 15:27:39 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MACH_INIT_H
|
|
|
|
#define __MACH_INIT_H
|
|
|
|
|
2016-02-26 05:21:40 +00:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
2016-02-26 05:21:34 +00:00
|
|
|
#define UNIPHIER_MAX_NR_DRAM_CH 3
|
|
|
|
|
|
|
|
struct uniphier_dram_ch {
|
|
|
|
unsigned long base;
|
|
|
|
unsigned long size;
|
|
|
|
unsigned int width;
|
|
|
|
};
|
|
|
|
|
2015-09-21 15:27:39 +00:00
|
|
|
struct uniphier_board_data {
|
2016-02-26 05:21:34 +00:00
|
|
|
unsigned int dram_freq;
|
|
|
|
unsigned int dram_nr_ch;
|
|
|
|
struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH];
|
2016-07-22 04:38:32 +00:00
|
|
|
unsigned int flags;
|
|
|
|
#define UNIPHIER_BD_DDR3PLUS BIT(2)
|
2016-07-22 04:38:33 +00:00
|
|
|
#define UNIPHIER_BD_PACKAGE_LD21 1
|
|
|
|
#define UNIPHIER_BD_PACKAGE_TYPE(f) ((f) & 0x3)
|
2015-09-21 15:27:39 +00:00
|
|
|
};
|
|
|
|
|
2015-12-17 08:47:42 +00:00
|
|
|
const struct uniphier_board_data *uniphier_get_board_param(void);
|
2015-09-21 15:27:39 +00:00
|
|
|
|
2016-03-30 11:17:02 +00:00
|
|
|
int uniphier_sld3_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_ld4_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pro4_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_sld8_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pro5_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pxs2_init(const struct uniphier_board_data *bd);
|
2016-05-24 12:14:01 +00:00
|
|
|
int uniphier_ld11_init(const struct uniphier_board_data *bd);
|
2016-04-21 05:43:18 +00:00
|
|
|
int uniphier_ld20_init(const struct uniphier_board_data *bd);
|
2015-09-21 15:27:39 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_MICRO_SUPPORT_CARD)
|
2016-03-30 11:17:02 +00:00
|
|
|
int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd);
|
2016-03-18 07:41:44 +00:00
|
|
|
int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd);
|
2015-09-21 15:27:39 +00:00
|
|
|
#else
|
2016-03-30 11:17:02 +00:00
|
|
|
static inline int uniphier_sbc_init_admulti(
|
|
|
|
const struct uniphier_board_data *bd)
|
2015-09-21 15:27:39 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-03-30 11:17:02 +00:00
|
|
|
static inline int uniphier_sbc_init_savepin(
|
|
|
|
const struct uniphier_board_data *bd)
|
2015-09-21 15:27:39 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-03-18 07:41:44 +00:00
|
|
|
static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd)
|
2015-09-21 15:27:41 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2015-09-21 15:27:39 +00:00
|
|
|
#endif
|
|
|
|
|
2016-03-30 11:17:02 +00:00
|
|
|
int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
|
2015-09-21 15:27:39 +00:00
|
|
|
|
|
|
|
int memconf_init(const struct uniphier_board_data *bd);
|
2016-03-30 11:17:02 +00:00
|
|
|
int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd);
|
|
|
|
|
|
|
|
int uniphier_sld3_pll_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_ld4_pll_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pro4_pll_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_sld8_pll_init(const struct uniphier_board_data *bd);
|
|
|
|
|
|
|
|
int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
|
|
|
|
|
|
|
|
int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd);
|
2016-05-24 12:14:01 +00:00
|
|
|
int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd);
|
2016-04-21 05:43:18 +00:00
|
|
|
int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd);
|
2016-03-30 11:17:02 +00:00
|
|
|
|
|
|
|
int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd);
|
2016-04-28 06:37:15 +00:00
|
|
|
int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd);
|
2016-03-30 11:17:02 +00:00
|
|
|
|
|
|
|
int uniphier_ld4_umc_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pro4_umc_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_sld8_umc_init(const struct uniphier_board_data *bd);
|
|
|
|
int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd);
|
2016-04-21 05:43:18 +00:00
|
|
|
int uniphier_ld20_umc_init(const struct uniphier_board_data *bd);
|
2016-05-24 12:14:01 +00:00
|
|
|
int uniphier_ld11_umc_init(const struct uniphier_board_data *bd);
|
2016-03-30 11:17:02 +00:00
|
|
|
|
|
|
|
void uniphier_sld3_pin_init(void);
|
|
|
|
void uniphier_ld4_pin_init(void);
|
|
|
|
void uniphier_pro4_pin_init(void);
|
|
|
|
void uniphier_sld8_pin_init(void);
|
|
|
|
void uniphier_pro5_pin_init(void);
|
|
|
|
void uniphier_pxs2_pin_init(void);
|
|
|
|
void uniphier_ld6b_pin_init(void);
|
2016-04-21 05:43:18 +00:00
|
|
|
void uniphier_ld20_pin_init(void);
|
2016-03-30 11:17:02 +00:00
|
|
|
|
|
|
|
void uniphier_ld4_clk_init(void);
|
|
|
|
void uniphier_pro4_clk_init(void);
|
|
|
|
void uniphier_pro5_clk_init(void);
|
|
|
|
void uniphier_pxs2_clk_init(void);
|
2016-05-24 12:14:01 +00:00
|
|
|
void uniphier_ld11_clk_init(void);
|
2016-04-21 05:43:18 +00:00
|
|
|
void uniphier_ld20_clk_init(void);
|
|
|
|
|
|
|
|
void cci500_init(int nr_slaves);
|
2015-09-21 15:27:39 +00:00
|
|
|
|
|
|
|
#define pr_err(fmt, args...) printf(fmt, ##args)
|
|
|
|
|
|
|
|
#endif /* __MACH_INIT_H */
|