mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-07 05:13:21 +09:00
![maxims@google.com](/assets/img/avatar_default.png)
Clock Driver This driver is ast2500-specific and is not compatible with earlier versions of this chip. The differences are not that big, but they are in somewhat random places, so making it compatible with ast2400 is not worth the effort at the moment. SDRAM MC driver The driver is very ast2500-specific and is completely incompatible with previous versions of the chip. The memory controller is very poorly documented by Aspeed in the datasheet, with any mention of the whole range of registers missing. The initialization procedure has been basically taken from Aspeed SDK, where it is implemented in assembly. Here it is rewritten in C, with very limited understanding of what exactly it is doing. Reviewed-by: Simon Glass <sjg@chromium.org>
31 lines
490 B
C
31 lines
490 B
C
/*
|
|
* Copyright (C) 2016 Google, Inc
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <asm/arch/scu_ast2500.h>
|
|
|
|
int ast_get_clk(struct udevice **devp)
|
|
{
|
|
return uclass_get_device_by_driver(UCLASS_CLK,
|
|
DM_GET_DRIVER(aspeed_ast2500_scu), devp);
|
|
}
|
|
|
|
void *ast_get_scu(void)
|
|
{
|
|
struct ast2500_clk_priv *priv;
|
|
struct udevice *dev;
|
|
int ret;
|
|
|
|
ret = ast_get_clk(&dev);
|
|
if (ret)
|
|
return ERR_PTR(ret);
|
|
|
|
priv = dev_get_priv(dev);
|
|
|
|
return priv->scu;
|
|
}
|