blob: f519ddaf0a84f7250de62674f6d3c7af8ade6e76 [file] [log] [blame]
/*
* board/amlogic/txl_skt_v1/firmware/board_init.c
*
* Copyright (C) 2015 Amlogic, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "power.c"
/* bl2 customer code */
#define PNL_PREG_PAD_GPIO1_EN_N 0x0f
#define PNL_PREG_PAD_GPIO1_O 0x10
#define PNL_PREG_PAD_GPIO1_I 0x11
#define PNL_PREG_PAD_GPIO3_EN_N 0x15
#define PNL_PREG_PAD_GPIO3_O 0x16
#define PNL_PREG_PAD_GPIO3_I 0x17
#define PNL_REG_BASE (0xff634400L)
#define PNL_REG(reg) (PNL_REG_BASE + (reg << 2))
#define PNL_REG_R(_reg) (*(volatile unsigned int *)PNL_REG(_reg))
#define PNL_REG_W(_reg, _value) *(volatile unsigned int *)PNL_REG(_reg) = (_value);
static void panel_power_init(void)
{
serial_puts("init panel power\n");
/* panel: GPIOZ_13/8/9 */ /* remove GPIOZ_10 for 2D/3D special case */
PNL_REG_W(PNL_PREG_PAD_GPIO3_O,
(PNL_REG_R(PNL_PREG_PAD_GPIO3_O) & ~((0x3 << 8) | (1 << 13))));
PNL_REG_W(PNL_PREG_PAD_GPIO3_EN_N,
(PNL_REG_R(PNL_PREG_PAD_GPIO3_EN_N) & ~((0x3 << 8) | (1 << 13))));
/* panel: GPIOH_4/5 */
PNL_REG_W(PNL_PREG_PAD_GPIO1_O,
(PNL_REG_R(PNL_PREG_PAD_GPIO1_O) & ~(0x3 << 24)));
PNL_REG_W(PNL_PREG_PAD_GPIO1_EN_N,
(PNL_REG_R(PNL_PREG_PAD_GPIO1_EN_N) & ~(0x3 << 24)));
/* backlight: GPIOZ_4/6/7 */
PNL_REG_W(PNL_PREG_PAD_GPIO3_O,
(PNL_REG_R(PNL_PREG_PAD_GPIO3_O) & ~((1 << 4) | (0x3 << 6))));
PNL_REG_W(PNL_PREG_PAD_GPIO3_EN_N,
(PNL_REG_R(PNL_PREG_PAD_GPIO3_EN_N) & ~((1 << 4) | (0x3 << 6))));
}
void board_init(void)
{
power_init(0);
panel_power_init();
}