2 * (C) Copyright 2009 Faraday Technology
3 * Po-Yu Chuang <ratbert@faraday-tech.com>
5 * SPDX-License-Identifier: GPL-2.0+
11 #include <faraday/ftsmc020.h>
13 struct ftsmc020_config {
18 static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config *cfg)
20 struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE;
23 printf("bank # %u invalid\n", bank);
27 writel(cfg->config, &smc->bank[bank].cr);
28 writel(cfg->timing, &smc->bank[bank].tpr);
31 void ftsmc020_init(void)
33 struct ftsmc020_config config[] = CONFIG_SYS_FTSMC020_CONFIGS;
36 for (i = 0; i < ARRAY_SIZE(config); i++)
37 ftsmc020_setup_bank(i, &config[i]);