mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 13:41:31 +00:00
mtd: nand: denali_dt: add clock support
Enable clock in the probe hook. The clock rate will be necessary when setup_data_interface hook is supported. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
c7372d61fd
commit
a89b9bc095
2 changed files with 13 additions and 0 deletions
|
@ -435,6 +435,7 @@ struct nand_buf {
|
||||||
|
|
||||||
struct denali_nand_info {
|
struct denali_nand_info {
|
||||||
struct nand_chip nand;
|
struct nand_chip nand;
|
||||||
|
unsigned long clk_x_rate; /* bus interface clock rate */
|
||||||
int flash_bank; /* currently selected chip */
|
int flash_bank; /* currently selected chip */
|
||||||
int status;
|
int status;
|
||||||
int platform;
|
int platform;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <clk.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/ioport.h>
|
#include <linux/ioport.h>
|
||||||
|
@ -52,6 +53,7 @@ static int denali_dt_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct denali_nand_info *denali = dev_get_priv(dev);
|
struct denali_nand_info *denali = dev_get_priv(dev);
|
||||||
const struct denali_dt_data *data;
|
const struct denali_dt_data *data;
|
||||||
|
struct clk clk;
|
||||||
struct resource res;
|
struct resource res;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -73,6 +75,16 @@ static int denali_dt_probe(struct udevice *dev)
|
||||||
|
|
||||||
denali->flash_mem = devm_ioremap(dev, res.start, resource_size(&res));
|
denali->flash_mem = devm_ioremap(dev, res.start, resource_size(&res));
|
||||||
|
|
||||||
|
ret = clk_get_by_index(dev, 0, &clk);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = clk_enable(&clk);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
denali->clk_x_rate = clk_get_rate(&clk);
|
||||||
|
|
||||||
return denali_init(denali);
|
return denali_init(denali);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue