Only if the farm is an emc loop Meaning you do something to an item to increase its emc value using a process that cost less emc to use than how much you are increasing it by (if that makes sense) But farming crops and Generating ores with something like a laser drill or quarrying are perfectely legal
Pretty much right on the head. If you get more EMC out than the raw materials going in it's a Loop and not allowed. But feeding in crops, or other things like ore, as said by Coolgi3000, is fine. If in doubt, post your planned farm here and the community can vet it for you.
A loop, is defined as any "Closed system" that generates EMC. As a farm has constant input, this can not be considered an EMC dupe.